/[MITgcm]/MITgcm/tools/genmake2
ViewVC logotype

Diff of /MITgcm/tools/genmake2

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.11 by edhill, Mon Sep 29 16:15:23 2003 UTC revision 1.26 by heimbach, Thu Oct 30 19:11:45 2003 UTC
# Line 8  Line 8 
8  #   modified by aja 01/00  #   modified by aja 01/00
9  #   rewritten in bash by eh3 08/03  #   rewritten in bash by eh3 08/03
10    
11    # Search for particular CPP #cmds associated with packages
12    # usage: test_for_package_in_cpp_options CPP_file package_name
13    test_for_package_in_cpp_options() {
14        cpp_options=$1
15        pkg=$2
16        grep -i "#define.*ALLOW_$pkg" $cpp_options > /dev/null 2>&1
17        RETVAL=$?
18        if test "x${RETVAL}" = x0 ; then
19            echo "Error: In $cpp_options there is an illegal line: #define ALLOW_$pkg"
20            exit 99
21        fi
22        grep -i "#undef.*ALLOW_$pkg" $cpp_options > /dev/null 2>&1
23        RETVAL=$?
24        if test "x${RETVAL}" = x0 ; then
25            echo "Error: In $cpp_options there is an illegal line: #undef ALLOW_$pkg"
26            exit 99
27        fi
28        grep -i "#define.*DISABLE_$pkg" $cpp_options > /dev/null 2>&1
29        RETVAL=$?
30        if test "x${RETVAL}" = x0 ; then
31            echo "Error: In $cpp_options there is an illegal line: #define DISABLE_$pkg"
32            exit 99
33        fi
34        grep -i "#undef.*DISABLE_$pkg" $cpp_options > /dev/null 2>&1
35        RETVAL=$?
36        if test "x${RETVAL}" = x0 ; then
37            echo "Error: In $cpp_options there is an illegal line: #undef DISABLE_$pkg"
38            exit 99
39       fi
40    }
41    
42    # Read the $ROOTDIR/pkg/pkg_groups file and expand any references to
43    # the package list.
44    expand_pkg_groups() {
45        new_packages=
46        PKG_GROUPS=$ROOTDIR"/pkg/pkg_groups"
47        if test -r $PKG_GROUPS ; then
48            cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > ./p1.tmp
49            cat ./p1.tmp | $AWK '(NF>2 && $2==":"){ print $0 }' > ./p2.tmp
50            matched=0
51            for i in $PACKAGES ; do
52                line=`grep "^ *$i" ./p2.tmp`
53                RETVAL=$?
54                if test "x$RETVAL" = x0 ; then
55                    matched=1
56                    replace=`echo $line | $AWK '{ $1=""; $2=""; print $0 }'`
57                    echo "    replacing \"$i\" with: $replace"
58                    new_packages="$new_packages $replace"
59                else
60                    new_packages="$new_packages $i"
61                fi
62            done
63            PACKAGES=$new_packages
64            rm -f ./p[1,2].tmp
65        else
66            echo "Warning: can't read package groups definition file: $PKG_GROUPS"
67        fi
68    }
69    
70  # Guess possible config options for this host  # Guess possible config options for this host
71  find_possible_configs()  {  find_possible_configs()  {
72    
73      tmp1=`uname`"_"`uname -m`      tmp1=`uname`"_"`uname -m`
74      tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`      tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
75      PLATFORM=`echo $tmp2 | sed -e 's/i[3-6]86/ia32/'`      tmp3=`echo $tmp2 | sed -e 's/power macintosh/ppc/'`
76        PLATFORM=`echo $tmp3 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'`
77      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`
78      echo "  The platform appears to be:  $PLATFORM"      echo "  The platform appears to be:  $PLATFORM"
79  #     if test "x$OFLIST" = x ; then  #     if test "x$OFLIST" = x ; then
# Line 46  find_possible_configs()  { Line 105  find_possible_configs()  {
105      fi      fi
106    
107      # look for possible fortran compilers      # look for possible fortran compilers
108      tmp="$MITGCM_FC $FC g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95"      tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95"
109      p_FC=      p_FC=
110      for c in $tmp ; do      for c in $tmp ; do
111          rm -f ./hello.f ./hello          rm -f ./hello.f ./hello
# Line 63  EOF Line 122  EOF
122              p_FC="$p_FC $c"              p_FC="$p_FC $c"
123          fi          fi
124      done      done
125        rm -f ./hello.f ./hello
126      if test "x${p_FC}" = x ; then      if test "x${p_FC}" = x ; then
127          cat 1>&2 <<EOF          cat 1>&2 <<EOF
128    
# Line 78  EOF Line 138  EOF
138          echo "  The possible FORTRAN compilers found in your path are:"          echo "  The possible FORTRAN compilers found in your path are:"
139          echo "   "$p_FC          echo "   "$p_FC
140          if test "x$FC" = x ; then          if test "x$FC" = x ; then
141              FC=`echo $p_FC | awk '{print $1}'`              FC=`echo $p_FC | $AWK '{print $1}'`
142          fi          fi
143      fi      fi
144    
# Line 144  get_pdepend_list()  { Line 204  get_pdepend_list()  {
204      #  strip the comments and then convert the dependency file into      #  strip the comments and then convert the dependency file into
205      #  two arrays: PNAME, DNAME      #  two arrays: PNAME, DNAME
206      cat $1 | sed -e 's/#.*$//g' \      cat $1 | sed -e 's/#.*$//g' \
207          | awk 'BEGIN{nn=0;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME["nn"]="$1"\nDNAME["nn"]="$i} }' \          | $AWK 'BEGIN{nn=0;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME["nn"]="$1"\nDNAME["nn"]="$i} }' \
208          > ./.pd_tmp          > ./.pd_tmp
209      source ./.pd_tmp      source ./.pd_tmp
210      rm -f ./.pd_tmp      rm -f ./.pd_tmp
# Line 181  usage()  { Line 241  usage()  {
241      echo "      -disable=NAME | --disable=NAME"      echo "      -disable=NAME | --disable=NAME"
242      echo "    -enable NAME | --enable NAME"      echo "    -enable NAME | --enable NAME"
243      echo "      -enable=NAME | --enable=NAME"      echo "      -enable=NAME | --enable=NAME"
244        echo "    -standarddirs NAME | --standarddirs NAME"
245        echo "      -standarddirs=NAME | --standarddirs=NAME"
246      echo "    -noopt NAME | --noopt NAME"      echo "    -noopt NAME | --noopt NAME"
247      echo "      -noopt=NAME | --noopt=NAME"      echo "      -noopt=NAME | --noopt=NAME"
248  #    echo "    -cpp NAME | --cpp NAME"  #    echo "    -cpp NAME | --cpp NAME"
# Line 255  MODS= Line 317  MODS=
317  TOOLSDIR=  TOOLSDIR=
318  SOURCEDIRS=  SOURCEDIRS=
319  INCLUDEDIRS=  INCLUDEDIRS=
320    STANDARDDIRS=
321    
322  PWD=`pwd`  PWD=`pwd`
323  MAKE=make  MAKE=make
324    AWK=awk
325  THISHOSTNAME=`hostname`  THISHOSTNAME=`hostname`
326  THISCWD=`pwd`  THISCWD=`pwd`
327  THISDATE=`date`  THISDATE=`date`
# Line 265  MACHINE=`uname -a` Line 329  MACHINE=`uname -a`
329  EXECUTABLE=  EXECUTABLE=
330  EXEHOOK=  EXEHOOK=
331  EXEDIR=  EXEDIR=
332    PACKAGES_CONF=
333    IEEE=
334    if test "x$MITGCM_IEEE" != x ; then
335        IEEE=$MITGCM_IEEE
336    fi
337    
338    AUTODIFF_PKG_USED=f
339    AD_OPTFILE=
340    TAF=
341    AD_TAF_FLAGS=
342    FTL_TAF_FLAGS=
343    SVD_TAF_FLAGS=
344    TAF_EXTRA=
345    TAMC=
346    AD_TAMC_FLAGS=
347    FTL_TAF_FLAGS=
348    SVD_TAMC_FLAGS=
349    TAMC_EXTRA=
350    
351    
352  #  The following state can be set directly by command-line switches  #  The following state can be set directly by command-line switches
353  gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE NOOPT"  gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE NOOPT"
354  gm_s2="FC IEEE MPI JAM DUMPSTATE"  gm_s2="FC IEEE MPI JAM DUMPSTATE STANDARDDIRS"
355    
356  #  The following state is not directly set by command-line switches  #  The following state is not directly set by command-line switches
357  gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM "  gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM "
358  gm_s4="CFLAGS KFLAGS1 KFLAGS2 LIBS KPPFILES NOOPTFILES NOOPTFLAGS"  gm_s4="CFLAGS KFLAGS1 KFLAGS2 LIBS KPPFILES NOOPTFILES NOOPTFLAGS"
359  gm_s5="TOOLSDIR SOURCEDIRS INCLUDEDIRS PWD MAKE THISHOSTNAME THISDATE MACHINE"  gm_s5="TOOLSDIR SOURCEDIRS INCLUDEDIRS PWD MAKE THISHOSTNAME THISDATE MACHINE"
360  gm_s6="EXECUTABLE EXEHOOK EXEDIR"  gm_s6="EXECUTABLE EXEHOOK EXEDIR PACKAGES_CONF"
361    
362    #  The following are all related to adjoint/tangent-linear stuff
363    gm_s7="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS"
364    gm_s8="FTL_TAMC_FLAGS FTL_TAF_FLAGS SVD_TAMC_FLAGS SVD_TAF_FLAGS"
365    gm_s9="TAF_EXTRA TAMC_EXTRA"
366    
367  gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6"  gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6 $gm_s7 $gm_s8 $gm_s9"
368    
369    
370  echo  echo
371  echo "===  Processing options files and arguments  ==="  echo "===  Processing options files and arguments  ==="
372  gm_local="./gm_local"  gm_local="genmake_local"
373    for i in . $MODS ; do
374        if test -r $i/$gm_local ; then
375            source $i/$gm_local
376            break
377        fi
378    done
379  echo -n "  getting local config information:  "  echo -n "  getting local config information:  "
380  if test -e $gm_local ; then  if test -e $gm_local ; then
381      echo "using $gm_local"      echo "using $gm_local"
# Line 303  fi Line 397  fi
397  #   n=$(( $n + 1 ))  #   n=$(( $n + 1 ))
398  #done  #done
399  #parse_options  #parse_options
   
400  ac_prev=  ac_prev=
401  for ac_option ; do  for ac_option ; do
402    
# Line 328  for ac_option ; do Line 421  for ac_option ; do
421          -optfile=* | --optfile=* | -of=* | --of=*)          -optfile=* | --optfile=* | -of=* | --of=*)
422              OPTFILE=$ac_optarg ;;              OPTFILE=$ac_optarg ;;
423                    
424            -adoptfile | --adoptfile | -ad | --ad)
425                ac_prev=AD_OPTFILE ;;
426            -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)
427                AD_OPTFILE=$ac_optarg ;;
428            
429          -pdepend | --pdepend)          -pdepend | --pdepend)
430              ac_prev=PDEPEND ;;              ac_prev=PDEPEND ;;
431          -pdepend=* | --pdepend=*)          -pdepend=* | --pdepend=*)
# Line 373  for ac_option ; do Line 471  for ac_option ; do
471          -enable=* | --enable=*)          -enable=* | --enable=*)
472              ENABLE=$ac_optarg ;;              ENABLE=$ac_optarg ;;
473                    
474            -standarddirs | --standarddirs)
475                ac_prev=STANDARDDIRS ;;
476            -standarddirs=* | --standarddirs=*)
477                STANDARDDIRS=$ac_optarg ;;
478    
479          -noopt | --noopt)          -noopt | --noopt)
480              ac_prev=NOOPT ;;              ac_prev=NOOPT ;;
481          -noopt=* | --noopt=*)          -noopt=* | --noopt=*)
# Line 389  for ac_option ; do Line 492  for ac_option ; do
492              FC=$ac_optarg ;;              FC=$ac_optarg ;;
493                    
494          -ieee | --ieee)          -ieee | --ieee)
495              IEEE=1 ;;              IEEE=true ;;
496          -noieee | --noieee)          -noieee | --noieee)
497              IEEE=0 ;;              IEEE= ;;
498                    
499          -mpi | --mpi)          -mpi | --mpi)
500              MPI=1 ;;              MPI=true ;;
501          -nompi | --nompi)          -nompi | --nompi)
502              MPI=0 ;;              MPI= ;;
503                    
504          -jam | --jam)          -jam | --jam)
505              JAM=1 ;;              JAM=1 ;;
# Line 406  for ac_option ; do Line 509  for ac_option ; do
509          -ds | --ds)          -ds | --ds)
510              DUMPSTATE=t ;;              DUMPSTATE=t ;;
511                    
512            -taf_extra | --taf_extra)
513                ac_prev=TAF_EXTRA ;;
514            -taf_extra=* | --taf_extra=*)
515                TAF_EXTRA=$ac_optarg ;;
516    
517            -tamc_extra | --tamc_extra)
518                ac_prev=TAMC_EXTRA ;;
519            -tamc_extra=* | --tamc_extra=*)
520                TAMC_EXTRA=$ac_optarg ;;
521    
522          -*)          -*)
523              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
524              usage              usage
# Line 420  for ac_option ; do Line 533  for ac_option ; do
533            
534  done  done
535    
536    if test -f ./.genmakerc ; then
537        echo
538        echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\""
539        echo "  file.  This file format is no longer supported.  Please see:"
540        echo
541        echo "    http://mitgcm.org/devel_HOWTO/"
542        echo
543        echo "  for directions on how to setup and use the new \"genmake2\" input"
544        echo "  files and send an email to MITgcm-support@mitgcm.org if you want help."
545        echo
546    fi
547    
548  if test "x${ROOTDIR}" = x ; then  if test "x${ROOTDIR}" = x ; then
549      if test "${PWD##/*/}" = "bin" -a -d ../model -a -d ../eesup -a -d ../pkg ; then      if test "${PWD##/*/}" = "bin" -a -d ../model -a -d ../eesup -a -d ../pkg ; then
550          ROOTDIR=".."          ROOTDIR=".."
# Line 466  if test "x$OPTFILE" != xNONE ; then Line 591  if test "x$OPTFILE" != xNONE ; then
591              exit 1              exit 1
592          fi          fi
593          if test "x$DUMPSTATE" != xf ; then          if test "x$DUMPSTATE" != xf ; then
594              cp -f $OPTFILE "gm_optfile"              cp -f $OPTFILE "genmake_optfile"
595          fi          fi
596      else      else
597          echo "Error: can't read OPTFILE=\"$OPTFILE\""          echo "Error: can't read OPTFILE=\"$OPTFILE\""
# Line 474  if test "x$OPTFILE" != xNONE ; then Line 599  if test "x$OPTFILE" != xNONE ; then
599      fi      fi
600  fi  fi
601    
602    echo "  getting AD_OPTFILE information:  "
603    if test "x${AD_OPTFILE}" = x ; then
604        if test "x$MITGCM_AD_OF" = x ; then
605            AD_OPTFILE=$ROOTDIR/tools/adjoint_options/adjoint_default
606        else
607            AD_OPTFILE=$MITGCM_AD_OF
608        fi
609    fi
610    if test "x${AD_OPTFILE}" != xNONE ; then
611        if test -f "$AD_OPTFILE" -a -r "$AD_OPTFILE" ; then
612            echo "    using AD_OPTFILE=\"$AD_OPTFILE\""
613            source "$AD_OPTFILE"
614            RETVAL=$?
615            if test "x$RETVAL" != x0 ; then
616                echo -n "Error: failed to source AD_OPTFILE \"$AD_OPTFILE\""
617                echo "--please check that variable syntax is bash-compatible"
618                exit 1
619            fi
620            if test "x$DUMPSTATE" != xf ; then
621                cp -f $AD_OPTFILE "genmake_ad_optfile"
622            fi
623        else
624            echo "Error: can't read AD_OPTFILE=\"$AD_OPTFILE\""
625            exit 1
626        fi
627    fi
628    
629  #  Check that FC, LINK, CPP, and S64 are defined.  If not, complain  #  Check that FC, LINK, CPP, and S64 are defined.  If not, complain
630  #  and abort!  #  and abort!
631  if test "x$FC" = x ; then  if test "x$FC" = x ; then
# Line 482  if test "x$FC" = x ; then Line 634  if test "x$FC" = x ; then
634  Error: no Fortran compiler: please specify using one of the following:  Error: no Fortran compiler: please specify using one of the following:
635    1) within the options file ("FC=...") as specified by "-of=OPTFILE"    1) within the options file ("FC=...") as specified by "-of=OPTFILE"
636    2) the "-fc=XXX" command-line option    2) the "-fc=XXX" command-line option
637    3) the "./gm_local" file    3) the "./genmake_local" file
638  EOF  EOF
639      exit 1      exit 1
640  fi  fi
# Line 492  fi Line 644  fi
644  if test "x$CPP" = x ; then  if test "x$CPP" = x ; then
645      CPP="cpp"      CPP="cpp"
646  fi  fi
647  echo "#define A a" | cpp > test_cpp 2>&1  echo "#define A a" | $CPP > test_cpp 2>&1
648  RETVAL=$?  RETVAL=$?
649  if test "x$RETVAL" != x0 ; then  if test "x$RETVAL" != x0 ; then
650      cat <<EOF 1>&2      cat <<EOF 1>&2
# Line 500  if test "x$RETVAL" != x0 ; then Line 652  if test "x$RETVAL" != x0 ; then
652  Error: C pre-processor "$CPP" failed the test case: please specify using:  Error: C pre-processor "$CPP" failed the test case: please specify using:
653    
654    1) within the options file ("CPP=...") as specified by "-of=OPTFILE"    1) within the options file ("CPP=...") as specified by "-of=OPTFILE"
655    2) the "./gm_local" file    2) the "./genmake_local" file
656    
657  EOF  EOF
658      exit 1      exit 1
# Line 593  echo "  getting package dependency info Line 745  echo "  getting package dependency info
745  #  Strip the comments and then convert the dependency file into  #  Strip the comments and then convert the dependency file into
746  #  two arrays: PNAME, DNAME  #  two arrays: PNAME, DNAME
747  cat $PDEPEND | sed -e 's/#.*$//g' \  cat $PDEPEND | sed -e 's/#.*$//g' \
748      | awk 'BEGIN{nn=-1;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME_"nn"="$1"\nDNAME_"nn"="$i}} END{print "nname="nn}' \      | $AWK 'BEGIN{nn=-1;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME_"nn"="$1"\nDNAME_"nn"="$i}} END{print "nname="nn}' \
749      > ./.pd_tmp      > ./.pd_tmp
750  RETVAL=$?  RETVAL=$?
751  if test ! "x${RETVAL}" = x0 ; then  if test ! "x${RETVAL}" = x0 ; then
# Line 603  fi Line 755  fi
755  source ./.pd_tmp  source ./.pd_tmp
756  rm -f ./.pd_tmp  rm -f ./.pd_tmp
757    
758    #  Search for default packages.  Note that a "$ROOTDIR/pkg/pkg_groups"
759    #  file should eventually be added so that, for convenience, one can
760    #  specify groups of packages using names like "ocean" and "atmosphere".
761  echo  -n "  checking default package list:  "  echo  -n "  checking default package list:  "
762  if test "x${PDEFAULT}" = x ; then  if test "x${PDEFAULT}" = x ; then
763        for i in "." $MODS ; do
764            if test -r $i"/packages.conf" ; then
765                    PDEFAULT=$i"/packages.conf"
766                    break
767            fi
768        done
769    fi
770    if test "x${PDEFAULT}" = x ; then
771      PDEFAULT="$ROOTDIR/pkg/pkg_default"      PDEFAULT="$ROOTDIR/pkg/pkg_default"
772  fi  fi
773  if test "x${PDEFAULT}" = xNONE ; then  if test "x${PDEFAULT}" = xNONE ; then
# Line 616  else Line 779  else
779      else      else
780          echo "  using PDEFAULT=\"$PDEFAULT\""          echo "  using PDEFAULT=\"$PDEFAULT\""
781          #  Strip the comments and add all the names          #  Strip the comments and add all the names
782          def=`cat $PDEFAULT | sed -e 's/#.*$//g' | awk '(NF>0){print $0}'`          def=`cat $PDEFAULT | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`
783          RETVAL=$?          RETVAL=$?
784          if test "x${RETVAL}" != x0 ; then          if test "x${RETVAL}" != x0 ; then
785              echo -n "Error: can't parse default package list "              echo -n "Error: can't parse default package list "
# Line 626  else Line 789  else
789          for i in $def ; do          for i in $def ; do
790              PACKAGES="$PACKAGES $i"              PACKAGES="$PACKAGES $i"
791          done          done
792          echo "    packages are:  $PACKAGES"          echo "    before group expansion packages are: $PACKAGES"
793            expand_pkg_groups
794            echo "    after group expansion packages are:  $PACKAGES"
795      fi      fi
796  fi  fi
797    
# Line 645  for p in $PACKAGES ; do Line 810  for p in $PACKAGES ; do
810  done  done
811  PACKAGES="$pack"  PACKAGES="$pack"
812  echo "  applying ENABLE settings"  echo "  applying ENABLE settings"
813  rm -f ./.tmp_pack  echo "" > ./.tmp_pack
814  PACKAGES="$PACKAGES $ENABLE"  PACKAGES="$PACKAGES $ENABLE"
815  for i in $PACKAGES ; do  for i in $PACKAGES ; do
816      if test ! -d "$ROOTDIR/pkg/$i" ; then      if test ! -d "$ROOTDIR/pkg/$i" ; then
# Line 736  for i in $PACKAGES ; do Line 901  for i in $PACKAGES ; do
901      if test -d $adr ; then      if test -d $adr ; then
902          SOURCEDIRS="$SOURCEDIRS $adr"          SOURCEDIRS="$SOURCEDIRS $adr"
903          INCLUDEDIRS="$INCLUDEDIRS $adr"          INCLUDEDIRS="$INCLUDEDIRS $adr"
904            if test "x$i" = xautodiff ; then
905                AUTODIFF_PKG_USED=t
906            fi
907      else      else
908          echo "Error: the directory \"$adr\" for package $i doesn't exist"          echo "Error: the directory \"$adr\" for package $i doesn't exist"
909          exit 1          exit 1
# Line 761  done Line 929  done
929  # done  # done
930  # echo  # echo
931    
932  echo "  Searching for CPP_OPTIONS.h (macros and flags for configuring the model):"  # Create a list of #define and #undef to enable/disable packages
933  CPP_OPTIONS=  PACKAGES_DOT_H=PACKAGES_CONFIG.h
934  spaths=". $SOURCEDIRS"  cat <<EOF >$PACKAGES_DOT_H".tmp"
 for i in $spaths ; do  
     try="$i/CPP_OPTIONS.h"  
     #  echo -n "    trying $try : "  
     if test -f $try -a -r $try ; then  
         echo "    found CPP_OPTIONS=\"$try\""  
         CPP_OPTIONS="$try"  
         if test "x$i" != "x." ; then  
             cp -f $CPP_OPTIONS .  
         fi  
         break  
     fi  
 done  
 if test "x$CPP_OPTIONS" = x ; then  
     echo "Error: can't find \"CPP_OPTIONS.h\" in the path list: $spaths"  
     exit 1  
 fi  
 if test -e CPP_OPTIONS.h ; then  
     if test ! -e CPP_OPTIONS.h.bak ; then  
         cp -f CPP_OPTIONS.h CPP_OPTIONS.h.bak  
     fi  
     cat CPP_OPTIONS.h \  
         | awk 'BEGIN{p=1;} ($1=="C===" && $2=="GENMAKE"){p=0;} {if (p==1) print $0}' \  
         > CPP_OPTIONS.h.tmp  
 fi  
 cat <<EOF >>CPP_OPTIONS.h.tmp  
935  C=== GENMAKE v2 ===  C=== GENMAKE v2 ===
936  C  The following defines have been set by GENMAKE, so please do not  C  The following defines have been set by GENMAKE, so please do not
937  C  edit anything below these comments.  In general, you should  C  edit anything below these comments.  In general, you should
938  C  add or remove packages by re-running genmake with different  C  add or remove packages by re-running genmake with different
939  C  "-enable" and/or "-disable" options.  C  "-enable" and/or "-disable" options.
940    
941    #ifndef PACKAGES_H
942    #define PACKAGES_H
943    
944  C  Packages disabled by genmake:  C  Packages disabled by genmake:
945  EOF  EOF
946  #  The following UGLY HACK sets multiple "#undef"s and it needs to go  #  The following UGLY HACK sets multiple "#undef"s and it needs to go
# Line 813  for n in $names ; do Line 959  for n in $names ; do
959              fi              fi
960          done          done
961          if test "x$has_pack" = xf ; then          if test "x$has_pack" = xf ; then
962              undef=`echo "ALLOW_$n" | awk '{print toupper($0)}'`              undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'`
963              echo "#undef $undef" >> CPP_OPTIONS.h.tmp              echo "#undef $undef" >> $PACKAGES_DOT_H".tmp"
964    #           DEFINES="$DEFINES -U$undef"
965    
966  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!
967              case $n in              case $n in
# Line 824  for n in $names ; do Line 971  for n in $names ; do
971                  mom_vecinv)                  mom_vecinv)
972                      DEFINES="$DEFINES -DDISABLE_MOM_VECINV"                      DEFINES="$DEFINES -DDISABLE_MOM_VECINV"
973                      ;;                      ;;
                 generic_advdiff)  
                     DEFINES="$DEFINES -DDISABLE_GENERIC_ADVDIFF"  
                     ;;  
974                  debug)                  debug)
975                      DEFINES="$DEFINES -DDISABLE_DEBUGMODE"                      DEFINES="$DEFINES -DDISABLE_DEBUGMODE"
976                      ;;                      ;;
# Line 836  for n in $names ; do Line 980  for n in $names ; do
980          fi          fi
981      fi      fi
982  done  done
983  cat <<EOF >>CPP_OPTIONS.h.tmp  cat <<EOF >>$PACKAGES_DOT_H".tmp"
984    
985  C  Packages enabled by genmake:  C  Packages enabled by genmake:
986  EOF  EOF
987  for i in $PACKAGES ; do  for i in $PACKAGES ; do
988      def=`echo "ALLOW_$i" | awk '{print toupper($0)}'`      def=`echo "ALLOW_$i" | $AWK '{print toupper($0)}'`
989      echo "#define $def" >> CPP_OPTIONS.h.tmp      echo "#define $def" >> $PACKAGES_DOT_H".tmp"
990    #eh3 DEFINES="$DEFINES -D$def"
991    
992  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!
993      case $i in      case $i in
994          aim_v23)          aim_v23)
995              echo "#define   ALLOW_AIM" >> CPP_OPTIONS.h.tmp              echo "#define   ALLOW_AIM" >> $PACKAGES_DOT_H".tmp"
996                DEFINES="$DEFINES -DALLOW_AIM"
997                echo "Warning: ALLOW_AIM is set to enable aim_v23. This is REALLY ugly Jean-Michel :-)"
998              ;;              ;;
999      esac      esac
1000  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!
1001    
1002  done  done
1003  mv -f CPP_OPTIONS.h.tmp CPP_OPTIONS.h  cat <<EOF >>$PACKAGES_DOT_H".tmp"
1004    
1005    #endif /* PACKAGES_H */
1006    EOF
1007    
1008    if test ! -f $PACKAGES_DOT_H ; then
1009        mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H
1010    else
1011        cmp $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H
1012        RETVAL=$?
1013        if test "x$RETVAL" = x0 ; then
1014            rm -f $PACKAGES_DOT_H".tmp"
1015        else
1016            mv -f $PACKAGES_DOT_H $PACKAGES_DOT_H".bak"
1017            mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H
1018        fi
1019    fi
1020    
1021  echo "  Adding STANDARDDIRS"  echo "  Adding STANDARDDIRS"
1022  BUILDDIR=${BUILDDIR:-.}  BUILDDIR=${BUILDDIR:-.}
1023  STANDARDDIRS=${STANDARDDIRS:-"eesupp model"}  if test "x$STANDARDDIRS" = x ; then
1024        STANDARDDIRS="eesupp model"
1025    fi
1026  for d in $STANDARDDIRS ; do  for d in $STANDARDDIRS ; do
1027      adr="$ROOTDIR/$d/src"      adr="$ROOTDIR/$d/src"
1028      if test ! -d $adr ; then      if test ! -d $adr ; then
# Line 877  for d in $STANDARDDIRS ; do Line 1042  for d in $STANDARDDIRS ; do
1042      fi      fi
1043  done  done
1044    
1045    echo "  Searching for CPP_OPTIONS.h in order to warn about the presence"
1046    echo "    of \"#define ALLOW_PKGNAME\"-type statements:"
1047    CPP_OPTIONS=
1048    spaths=". $INCLUDEDIRS"
1049    for i in $spaths ; do
1050        try="$i/CPP_OPTIONS.h"
1051        #  echo -n "    trying $try : "
1052        if test -f $try -a -r $try ; then
1053            echo "    found CPP_OPTIONS=\"$try\""
1054            CPP_OPTIONS="$try"
1055            break
1056        fi
1057    done
1058    if test "x$CPP_OPTIONS" = x ; then
1059        echo "Error: can't find \"CPP_OPTIONS.h\" in the path list: $spaths"
1060        exit 1
1061    fi
1062    # New safety test: make sure packages are not mentioned in CPP_OPTIONS.h
1063    names=`ls -1 "$ROOTDIR/pkg"`
1064    for n in $names ; do
1065        test_for_package_in_cpp_options $CPP_OPTIONS $n
1066    done
1067    
1068    
1069    #  Here, we build the list of files to be "run through" the adjoint
1070    #  compiler.
1071    if test -f ./ad_files ; then
1072        rm -f ./ad_files
1073    fi
1074    echo "  Creating the list of files for the adjoint compiler."
1075    for i in $SOURCEDIRS ; do
1076        list_files=`( cd $i && ls -1 *.list 2>/dev/null )`
1077        for j in $list_files ; do
1078            cat $i/$j >> ad_files
1079        done
1080    done
1081    
1082    cat <<EOF > adjoint_sed
1083    s/call adopen(/call adopen ( mythid,\\
1084         \&           /g
1085    s/call adclose(/call adclose( mythid,\\
1086         \&           /g
1087    s/call adread(/call adread ( mythid,\\
1088         \&           /g
1089    s/call adwrite(/call adwrite( mythid,\\
1090         \&           /g
1091    
1092    EOF
1093    
1094  echo  echo
1095  echo "===  Creating the Makefile  ==="  echo "===  Creating the Makefile  ==="
1096  echo "  setting INCLUDES"  echo "  setting INCLUDES"
1097  for i in $INCLUDEDIRS ; do  for i in $INCLUDEDIRS ; do
1098      if test -d $i ; then      if ! test -d $i ; then
1099          INCLUDES="$INCLUDES -I$i"  #       INCLUDES="$INCLUDES -I$i"
1100      else  #   else
1101          echo "Warning: can't find INCLUDEDIRS=\"$i\""          echo "Warning: can't find INCLUDEDIRS=\"$i\""
1102      fi      fi
1103  done  done
# Line 898  echo -n 'SRCFILES = '    > srclist.inc Line 1111  echo -n 'SRCFILES = '    > srclist.inc
1111  echo -n 'CSRCFILES = '   > csrclist.inc  echo -n 'CSRCFILES = '   > csrclist.inc
1112  echo -n 'F90SRCFILES = ' > f90srclist.inc  echo -n 'F90SRCFILES = ' > f90srclist.inc
1113  echo -n 'HEADERFILES = ' > hlist.inc  echo -n 'HEADERFILES = ' > hlist.inc
1114    echo -n 'AD_FLOW_FILES = ' > ad_flow_files.inc
1115  alldirs="$SOURCEDIRS $INCLUDEDIRS ."  alldirs="$SOURCEDIRS $INCLUDEDIRS ."
1116  for d in $alldirs ; do  for d in $alldirs ; do
1117      deplist=      deplist=
1118      sfiles=`( cd $d; echo *.[h,c,F] )`      sfiles=`( cd $d; echo *.[h,c,F] *.flow )`
1119      sfiles=`( echo $sfiles; cd $d; echo *.F90 )`      sfiles=`( echo $sfiles; cd $d; echo *.F90 )`
1120      for sf in $sfiles ; do      for sf in $sfiles ; do
1121          if test ! -r ".links.tmp/$sf" ; then          if test ! -r ".links.tmp/$sf" ; then
1122              if test -f "$d/$sf" ; then              if test -f "$d/$sf" ; then
1123                  extn=`echo $sf | awk -F '.' '{print $NF}'`                  extn=`echo $sf | $AWK -F '.' '{print $NF}'`
1124                  touch .links.tmp/$sf                  touch .links.tmp/$sf
1125                  deplist="$deplist $sf"                  deplist="$deplist $sf"
1126                  case $extn in                  case $extn in
# Line 926  for d in $alldirs ; do Line 1140  for d in $alldirs ; do
1140                          echo    " \\"  >> hlist.inc                          echo    " \\"  >> hlist.inc
1141                          echo -n " $sf" >> hlist.inc                          echo -n " $sf" >> hlist.inc
1142                          ;;                          ;;
1143                        flow)
1144                            echo    " \\"  >> ad_flow_files.inc
1145                            echo -n " $sf" >> ad_flow_files.inc
1146                            ;;
1147                  esac                  esac
1148              fi              fi
1149          fi          fi
# Line 942  echo "" >> srclist.inc Line 1160  echo "" >> srclist.inc
1160  echo "" >> csrclist.inc  echo "" >> csrclist.inc
1161  echo "" >> f90srclist.inc  echo "" >> f90srclist.inc
1162  echo "" >> hlist.inc  echo "" >> hlist.inc
1163    echo "" >> ad_flow_files.inc
1164    
1165  if test -e $MAKEFILE ; then  if test -e $MAKEFILE ; then
1166      mv -f $MAKEFILE "$MAKEFILE.bak"      mv -f $MAKEFILE "$MAKEFILE.bak"
# Line 955  echo "# by the command:" >> $MAKEFILE Line 1174  echo "# by the command:" >> $MAKEFILE
1174  echo "#    $0 $@" >> $MAKEFILE  echo "#    $0 $@" >> $MAKEFILE
1175  echo "# executed by:" >> $MAKEFILE  echo "# executed by:" >> $MAKEFILE
1176  echo "#    $USER@${THISHOSTNAME}:${THISCWD}" >> $MAKEFILE  echo "#    $USER@${THISHOSTNAME}:${THISCWD}" >> $MAKEFILE
1177    
1178    EXE_AD=$EXECUTABLE"_ad"
1179    EXE_FTL=$EXECUTABLE"_ftl"
1180    EXE_SVD=$EXECUTABLE"_svd"
1181    
1182  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
1183  #  #
1184  # BUILDDIR     : Directory where object files are written  # BUILDDIR     : Directory where object files are written
# Line 983  EXEDIR      = ${EXEDIR} Line 1207  EXEDIR      = ${EXEDIR}
1207  EXECUTABLE  = \$(EXEDIR)/${EXECUTABLE}  EXECUTABLE  = \$(EXEDIR)/${EXECUTABLE}
1208  TOOLSDIR    = ${TOOLSDIR}  TOOLSDIR    = ${TOOLSDIR}
1209    
1210    #eh3  new defines for the adjoint work
1211    AUTODIFF    = ${ROOTDIR}/pkg/autodiff
1212    EXE_AD      = ${EXE_AD}
1213    EXE_FTL     = ${EXE_FTL}
1214    EXE_SVD     = ${EXE_SVD}
1215    
1216  EOF  EOF
1217    
1218  #  Note: figure out some way to add Hyades JAM libraries here  #  Note: figure out some way to add Hyades JAM libraries here
# Line 1028  MAKEFILE=${MAKEFILE} Line 1258  MAKEFILE=${MAKEFILE}
1258    
1259  EOF  EOF
1260    
1261  cat srclist.inc    >> $MAKEFILE  cat srclist.inc       >> $MAKEFILE
1262  cat csrclist.inc   >> $MAKEFILE  cat csrclist.inc      >> $MAKEFILE
1263  cat f90srclist.inc >> $MAKEFILE  cat f90srclist.inc    >> $MAKEFILE
1264  cat hlist.inc      >> $MAKEFILE  cat hlist.inc         >> $MAKEFILE
1265    cat ad_flow_files.inc >> $MAKEFILE
1266    echo               >> $MAKEFILE
1267  echo 'F77FILES =  $(SRCFILES:.F=.f)'                                           >> $MAKEFILE  echo 'F77FILES =  $(SRCFILES:.F=.f)'                                           >> $MAKEFILE
1268  echo 'F90FILES =  $(F90SRCFILES:.F90=.f90)'                                    >> $MAKEFILE  echo 'F90FILES =  $(F90SRCFILES:.F90=.f90)'                                    >> $MAKEFILE
1269  echo 'OBJFILES =  $(SRCFILES:.F=.o) $(CSRCFILES:.c=.o) $(F90SRCFILES:.F90=.o)' >> $MAKEFILE  echo 'OBJFILES =  $(SRCFILES:.F=.o) $(CSRCFILES:.c=.o) $(F90SRCFILES:.F90=.o)' >> $MAKEFILE
1270    
1271  rm -f srclist.inc csrclist.inc hlist.inc flist.tmp clist.tmp f90srclist.inc  rm -f srclist.inc csrclist.inc hlist.inc flist.tmp clist.tmp f90srclist.inc
1272    rm -f ad_flow_files.inc
1273    
1274  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
1275    
# Line 1060  output.txt: \$(EXECUTABLE) Line 1293  output.txt: \$(EXECUTABLE)
1293          @\$(EXECUTABLE) > \$@          @\$(EXECUTABLE) > \$@
1294    
1295  clean:  clean:
1296            -cat AD_CONFIG.template > AD_CONFIG.h
1297          -rm -rf *.o *.f *.p *.f90 *.mod ${RMFILES} work.{pc,pcl}          -rm -rf *.o *.f *.p *.f90 *.mod ${RMFILES} work.{pc,pcl}
1298  Clean:  Clean:
1299          @make clean          @make clean
1300          @make cleanlinks          @make cleanlinks
1301          -rm -f Makefile.bak          -rm -f Makefile.bak genmake_state genmake_*optfile make.log
1302  CLEAN:  CLEAN:
1303          @make Clean          @make Clean
1304          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
1305          -find \$(EXEDIR) -name "*.data" -exec rm {} \;          -find \$(EXEDIR) -name "*.data" -exec rm {} \;
1306          -find \$(EXEDIR) -name "fort.*" -exec rm {} \;          -find \$(EXEDIR) -name "fort.*" -exec rm {} \;
1307          -rm -f \$(EXECUTABLE)          -rm -f \$(EXECUTABLE) output.txt
1308    
1309    #eh3 Makefile: makefile
1310  makefile:  makefile:
1311          ${0} $@          ${0} $@
1312  cleanlinks:  cleanlinks:
# Line 1095  cleanlinks: Line 1330  cleanlinks:
1330  .p.f:  .p.f:
1331          \$(KPP) \$(KFLAGS1)\$@ \$(KFLAGS2) \$<          \$(KPP) \$(KFLAGS1)\$@ \$(KFLAGS2) \$<
1332    
1333    #=========================================
1334    #===  Automatic Differentiation Rules  ===
1335    
1336    TAMC           = ${TAMC}
1337    TAF            = ${TAF}
1338    
1339    TAF_EXTRA      = ${TAF_EXTRA}
1340    TAMC_EXTRA     = ${TAMC_EXTRA}
1341    
1342    EOF
1343    
1344    ad_vars="AD_TAMC_FLAGS AD_TAF_FLAGS"
1345    ad_vars="$ad_vars FTL_TAMC_FLAGS FTL_TAF_FLAGS"
1346    ad_vars="$ad_vars SVD_TAMC_FLAGS SVD_TAF_FLAGS"
1347    for i in $ad_vars ; do
1348        name=$i
1349        t1="t2=\$"`echo $i`
1350        eval $t1
1351        printf "%-20s = " $name >> $MAKEFILE
1352        echo $t2 >> $MAKEFILE
1353    done
1354    
1355    echo "  Add the source list for AD code generation"
1356    echo >> $MAKEFILE
1357    echo -n "AD_FILES = " >> $MAKEFILE
1358    AD_FILES=`cat ad_files`
1359    for i in $AD_FILES ; do
1360        echo    " \\" >> $MAKEFILE
1361        echo -n " $i" >> $MAKEFILE
1362    done
1363    echo >> $MAKEFILE
1364    rm -f ad_files
1365    
1366    cat >>$MAKEFILE <<EOF
1367    
1368    # ... AD ...
1369    adall: ad_taf
1370    adtaf: ad_taf_output.f
1371    adtamc: ad_tamc_output.f
1372    
1373    ad_input_code.f: \$(AD_FILES) \$(HEADERFILES)
1374            cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
1375            @make \$(F77FILES)
1376            @make \$(AD_FLOW_FILES)
1377            cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f
1378    
1379    ad_taf_output.f: ad_input_code.f
1380            \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.f
1381            cat ad_input_code_ad.f | sed -f adjoint_sed > ad_taf_output.f
1382    
1383    ad_taf: ad_taf_output.o \$(OBJFILES)
1384            \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o \$(LIBS)
1385    
1386    ad_tamc_output.f: ad_input_code.f
1387            \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.f
1388            cat ad_input_code_ad.f | sed -f adjoint_sed > ad_tamc_output.f
1389    
1390    ad_tamc: ad_tamc_output.o \$(OBJFILES)
1391            \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS)
1392    
1393    
1394    # ... FTL ...
1395    ftlall: ftl_taf
1396    ftltaf: ftl_taf_output.f
1397    ftltamc: ftl_tamc_output.f
1398    
1399    ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES)
1400            cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h
1401            @make \$(F77FILES)
1402            @make \$(AD_FLOW_FILES)
1403            cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.f
1404    
1405    ftl_taf_output.f: ftl_input_code.f
1406            \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.f
1407            cat ftl_input_code_ftl.f | sed -f adjoint_sed > ftl_taf_output.f
1408    
1409    ftl_taf: ftl_taf_output.o \$(OBJFILES)
1410            \$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS)
1411    
1412    ftl_tamc_output.f: ftl_input_code.f
1413            \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.f
1414            cat ftl_input_code_ftl.f | sed -f adjoint_sed > ftl_tamc_output.f
1415    
1416    ftl_tamc: ftl_tamc_output.o \$(OBJFILES)
1417            \$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_tamc_output.o \$(LIBS)
1418    
1419    
1420    # ... SVD ...
1421    svd: svd_taf
1422    svd_taf_f: svd_taf_output.f
1423    
1424    svd_input_code.f: \$(SRCFILES)
1425            cmp svd_config.template AD_CONFIG.h || cat svd_config.template > AD_CONFIG.h
1426            @make \$(F77FILES)
1427            @make \$(AD_FLOW_FILES)
1428            cat \$(AD_FLOW_FILES) \$(AD_FILES) > svd_input_code.f
1429    
1430    svd_taf_output.f: svd_input_code.f
1431            \$(TAF) \$(SVD_TAF_FLAGS) \$(TAF_EXTRA) svd_input_code.f
1432            cat svd_input_code_ad.f | sed -f adjoint_sed > svd_taf_output.f
1433    
1434    svd_taf: svd_taf_output.o \$(OBJFILES)
1435            \$(LINK) -o ${EXE_SVD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) svd_taf_output.o \$(LIBS)
1436    
1437    
1438    #=========================================
1439    
1440  EOF  EOF
1441    
1442  if test "x$EXEHOOK" != x ; then  if test "x$EXEHOOK" != x ; then
# Line 1131  printf "\n\n# DO NOT DELETE\n" >> $MAKEF Line 1473  printf "\n\n# DO NOT DELETE\n" >> $MAKEF
1473    
1474  printf "\n===  Done  ===\n"  printf "\n===  Done  ===\n"
1475    
1476    #  Write the "template" files for the adjoint builds
1477    cat >AD_CONFIG.template <<EOF
1478    C  WARNING: This file is automatically generated by genmake2 and
1479    C    used by the Makefile rules.  Please DO NOT EDIT this file
1480    C    unless you are CERTAIN that you know what you are doing.
1481    
1482    #undef ALLOW_ADJOINT_RUN
1483    #undef ALLOW_TANGENTLINEAR_RUN
1484    #undef ALLOW_ECCO_OPTIMIZATION
1485    EOF
1486    cat >ad_config.template <<EOF
1487    C  WARNING: This file is automatically generated by genmake2 and
1488    C    used by the Makefile rules.  Please DO NOT EDIT this file
1489    C    unless you are CERTAIN that you know what you are doing.
1490    
1491    #define ALLOW_ADJOINT_RUN
1492    #undef ALLOW_TANGENTLINEAR_RUN
1493    #undef ALLOW_ECCO_OPTIMIZATION
1494    EOF
1495    cat >ftl_config.template <<EOF
1496    C  WARNING: This file is automatically generated by genmake2 and
1497    C    used by the Makefile rules.  Please DO NOT EDIT this file
1498    C    unless you are CERTAIN that you know what you are doing.
1499    
1500    #undef ALLOW_ADJOINT_RUN
1501    #define ALLOW_TANGENTLINEAR_RUN
1502    #undef ALLOW_ECCO_OPTIMIZATION
1503    EOF
1504    cat >svd_config.template <<EOF
1505    C  WARNING: This file is automatically generated by genmake2 and
1506    C    used by the Makefile rules.  Please DO NOT EDIT this file
1507    C    unless you are CERTAIN that you know what you are doing.
1508    
1509    #undef ALLOW_ADJOINT_RUN
1510    #undef ALLOW_TANGENTLINEAR_RUN
1511    #undef ALLOW_ECCO_OPTIMIZATION
1512    EOF
1513    cp AD_CONFIG.template AD_CONFIG.h
1514    
1515    
1516  #  Write the "state" for future records  #  Write the "state" for future records
1517  if test "x$DUMPSTATE" != xf ; then  if test "x$DUMPSTATE" != xf ; then
1518      echo -n "" > gm_state      echo -n "" > genmake_state
1519      for i in $gm_state ; do      for i in $gm_state ; do
1520          t1="t2=\$$i"          t1="t2=\$$i"
1521          eval $t1          eval $t1
1522          echo "$i='$t2'" >> gm_state          echo "$i='$t2'" >> genmake_state
1523      done      done
1524  fi  fi

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.22