/[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.234 by jmc, Fri Aug 17 17:27:57 2012 UTC revision 1.238 by jmc, Tue Aug 28 21:11:22 2012 UTC
# Line 17  Usage: "$0" [OPTIONS] Line 17  Usage: "$0" [OPTIONS]
17    where [OPTIONS] can be:    where [OPTIONS] can be:
18    
19      -help | --help | -h | --h      -help | --help | -h | --h
20            Print this help message and exit.            Print this help message and exit.
21    
22      -adoptfile NAME | --adoptfile NAME | -adof NAME | --adof NAME      -adoptfile NAME | --adoptfile NAME | -adof NAME | --adof NAME
23        -adoptfile=NAME | --adoptfile=NAME | -adof=NAME | --adof=NAME        -adoptfile=NAME | --adoptfile=NAME | -adof=NAME | --adof=NAME
24            Use "NAME" as the adoptfile.  By default, the file at            Use "NAME" as the adoptfile.  By default, the file at
25            "tools/adjoint_options/adjoint_default" will be used.            "tools/adjoint_options/adjoint_default" will be used.
26    
27      -nooptfile | --nooptfile      -nooptfile | --nooptfile
28        -optfile NAME | --optfile NAME | -of NAME | --of NAME        -optfile NAME | --optfile NAME | -of NAME | --of NAME
29        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME
30            Use "NAME" as the optfile.  By default, an attempt will be            Use "NAME" as the optfile.  By default, an attempt will be
31            made to find an appropriate "standard" optfile in the            made to find an appropriate "standard" optfile in the
32            tools/build_options/ directory.            tools/build_options/ directory.
33    
34      -pdepend NAME | --pdepend NAME      -pdepend NAME | --pdepend NAME
35        -pdepend=NAME | --pdepend=NAME        -pdepend=NAME | --pdepend=NAME
36            Get package dependency information from "NAME".            Get package dependency information from "NAME".
37    
38      -pgroups NAME | --pgroups NAME      -pgroups NAME | --pgroups NAME
39        -pgroups=NAME | --pgroups=NAME        -pgroups=NAME | --pgroups=NAME
40            Get the package groups information from "NAME".            Get the package groups information from "NAME".
41    
42      -bash NAME      -bash NAME
43            Explicitly specify the Bourne or BASH shell to use            Explicitly specify the Bourne or BASH shell to use
44    
45      -make NAME | -m NAME      -make NAME | -m NAME
46        --make=NAME | -m=NAME        --make=NAME | -m=NAME
47            Use "NAME" for the MAKE program. The default is "make" but            Use "NAME" for the MAKE program. The default is "make" but
48            many platforms, "gmake" is the preferred choice.            many platforms, "gmake" is the preferred choice.
49    
50      -makefile NAME | -mf NAME      -makefile NAME | -mf NAME
51        --makefile=NAME | -mf=NAME        --makefile=NAME | -mf=NAME
52            Call the makefile "NAME".  The default is "Makefile".            Call the makefile "NAME".  The default is "Makefile".
53    
54      -makedepend NAME | -md NAME      -makedepend NAME | -md NAME
55        --makedepend=NAME | -md=NAME        --makedepend=NAME | -md=NAME
56            Use "NAME" for the MAKEDEPEND program.            Use "NAME" for the MAKEDEPEND program.
57    
58      -rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME      -rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME
59        -rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME        -rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME
60            Specify the location of the MITgcm ROOTDIR as "NAME".            Specify the location of the MITgcm ROOTDIR as "NAME".
61            By default, genamke will try to find the location by            By default, genamke will try to find the location by
62            looking in parent directories (up to the 5th parent).            looking in parent directories (up to the 5th parent).
63    
64      -mods NAME | --mods NAME | -mo NAME | --mo NAME      -mods NAME | --mods NAME | -mo NAME | --mo NAME
65        -mods=NAME | --mods=NAME | -mo=NAME | --mo=NAME        -mods=NAME | --mods=NAME | -mo=NAME | --mo=NAME
66            Here, "NAME" specifies a list of directories that are            Here, "NAME" specifies a list of directories that are
67            used for additional source code.  Files found in the            used for additional source code.  Files found in the
68            "mods list" are given preference over files of the same            "mods list" are given preference over files of the same
69            name found elsewhere.            name found elsewhere.
70    
71      -disable NAME | --disable NAME      -disable NAME | --disable NAME
72        -disable=NAME | --disable=NAME        -disable=NAME | --disable=NAME
73            Here "NAME" specifies a list of packages that we don't            Here "NAME" specifies a list of packages that we don't
74            want to use.  If this violates package dependencies,            want to use.  If this violates package dependencies,
75            genamke will exit with an error message.            genamke will exit with an error message.
76    
77      -enable NAME | --enable NAME      -enable NAME | --enable NAME
78        -enable=NAME | --enable=NAME        -enable=NAME | --enable=NAME
79            Here "NAME" specifies a list of packages that we wish            Here "NAME" specifies a list of packages that we wish
80            to specifically enable.  If this violates package            to specifically enable.  If this violates package
81            dependencies, genamke will exit with an error message.            dependencies, genamke will exit with an error message.
82    
83      -standarddirs NAME | --standarddirs NAME      -standarddirs NAME | --standarddirs NAME
84        -standarddirs=NAME | --standarddirs=NAME        -standarddirs=NAME | --standarddirs=NAME
85            Here, "NAME" specifies a list of directories to be            Here, "NAME" specifies a list of directories to be
86            used as the "standard" code.            used as the "standard" code.
87    
88      -fortran NAME | --fortran NAME | -fc NAME | --fc NAME      -fortran NAME | --fortran NAME | -fc NAME | --fc NAME
89        -fc=NAME | --fc=NAME        -fc=NAME | --fc=NAME
90            Use "NAME" as the fortran compiler.  By default, genmake            Use "NAME" as the fortran compiler.  By default, genmake
91            will search for a working compiler by trying a list of            will search for a working compiler by trying a list of
92            "usual suspects" such as g77, f77, etc.            "usual suspects" such as g77, f77, etc.
93    
94      -cc NAME | --cc NAME | -cc=NAME | --cc=NAME      -cc NAME | --cc NAME | -cc=NAME | --cc=NAME
95            Use "NAME" as the C compiler.  By default, genmake            Use "NAME" as the C compiler.  By default, genmake
96            will search for a working compiler by trying a list of            will search for a working compiler by trying a list of
97            "usual suspects" such as gcc, c89, cc, etc.            "usual suspects" such as gcc, c89, cc, etc.
98    
99      -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4      -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4
100            Use "real*4" type for _RS variable (#undef REAL4_IS_SLOW)            Use "real*4" type for _RS variable (#undef REAL4_IS_SLOW)
101            *only* works if CPP_EEOPTIONS.h allows this.            *only* works if CPP_EEOPTIONS.h allows this.
102    
103      -ignoretime | -ignore_time | --ignoretime | --ignore_time      -ignoretime | -ignore_time | --ignoretime | --ignore_time
104            Ignore all the "wall clock" routines entirely.  This will            Ignore all the "wall clock" routines entirely.  This will
105            not in any way hurt the model results -- it simply means            not in any way hurt the model results -- it simply means
106            that the code that checks how long the model spends in            that the code that checks how long the model spends in
107            various routines will give junk values.            various routines will give junk values.
108    
109      -ts | --ts      -ts | --ts
110            Produce timing information per timestep            Produce timing information per timestep
111      -papis | --papis      -papis | --papis
112            Produce summary MFlop/s (and IPC) with PAPI per timestep            Produce summary MFlop/s (and IPC) with PAPI per timestep
113      -pcls | --pcls      -pcls | --pcls
114            Produce summary MFlop/s etc. with PCL per timestep            Produce summary MFlop/s etc. with PCL per timestep
115      -foolad | --foolad      -foolad | --foolad
116            Fool the AD code generator            Fool the AD code generator
117      -papi | --papi      -papi | --papi
118            Performance analysis with PAPI            Performance analysis with PAPI
119      -pcl | --pcl      -pcl | --pcl
120            Performance analysis with PCL            Performance analysis with PCL
121      -hpmt | --hpmt      -hpmt | --hpmt
122            Performance analysis with the HPM Toolkit            Performance analysis with the HPM Toolkit
123    
124      -ieee | --ieee      -ieee | --ieee
125            use IEEE numerics.  Note that this option *only* works            use IEEE numerics.  Note that this option *only* works
126            if it is supported by the OPTFILE that is being used.            if it is supported by the OPTFILE that is being used.
127      -devel | --devel      -devel | --devel
128            Add additional warning and debugging flags for development            Add additional warning and debugging flags for development
129            (if supported by the OPTFILE); also switch to IEEE numerics.            (if supported by the OPTFILE); also switch to IEEE numerics.
130      -gsl | --gsl      -gsl | --gsl
131            Use GSL to control floating point rounding and precision            Use GSL to control floating point rounding and precision
132    
133      -mpi | --mpi      -mpi | --mpi
134            Include MPI header files and link to MPI libraries            Include MPI header files and link to MPI libraries
135      -mpi=PATH | --mpi=PATH      -mpi=PATH | --mpi=PATH
136            Include MPI header files and link to MPI libraries using MPI_ROOT            Include MPI header files and link to MPI libraries using MPI_ROOT
137            set to PATH. i.e. Include files from \$PATH/include, link to libraries            set to PATH. i.e. Include files from \$PATH/include, link to libraries
138            from \$PATH/lib and use binaries from \$PATH/bin.            from \$PATH/lib and use binaries from \$PATH/bin.
139    
140      -omp | --omp      -omp | --omp
141            Activate OpenMP code + use Compiler option OMPFLAG            Activate OpenMP code + use Compiler option OMPFLAG
142      -omp=OMPFLAG | --omp=OMPFLAG      -omp=OMPFLAG | --omp=OMPFLAG
143            Activate OpenMP code + use Compiler option OMPFLAG            Activate OpenMP code + use Compiler option OMPFLAG
144    
145      -es | --es | -embed-source | --embed-source      -es | --es | -embed-source | --embed-source
146            Embed a tarball containing the full source code            Embed a tarball containing the full source code
147            (including the Makefile, etc.) used to build the            (including the Makefile, etc.) used to build the
148            executable [off by default]            executable [off by default]
149    
150      -ds | --ds      -ds | --ds
151            Report genmake internal variables status (DUMPSTATE)            Report genmake internal variables status (DUMPSTATE)
152            to file "genmake_state" (for debug purpose)            to file "genmake_state" (for debug purpose)
153    
154    While it is most often a single word, the "NAME" variables specified    While it is most often a single word, the "NAME" variables specified
155    above can in many cases be a space-delimited string such as:    above can in many cases be a space-delimited string such as:
# Line 207  test_for_string_in_file() { Line 207  test_for_string_in_file() {
207      RETVAL=$?      RETVAL=$?
208      if test "x${RETVAL}" = x0 ; then      if test "x${RETVAL}" = x0 ; then
209          printf "Error: In $file there is an illegal line: "          printf "Error: In $file there is an illegal line: "
210          grep -i "$strng" $file          grep -i "$strng" $file
211          exit 99          exit 99
212      fi      fi
213      return 0      return 0
# Line 305  EOF Line 305  EOF
305              FS90='fr9'              FS90='fr9'
306              check_for_broken_Ff              check_for_broken_Ff
307          else          else
308              cat <<EOF 2>&1              echo "ERROR: test: '$MAKE -f $MAKEFILE genmake_hello.$tfs' Failed"
309  ERROR: Your file system cannot distinguish between *.F and *.f files              echo "       see simple makefile: '$MAKEFILE' (left here)"
310    (fails the "make/ln" test) and this program cannot find a suitable              echo "  Please check (1) your '$MAKE' command, (2) your '$LN' command"
311    replacement extension.  Please try a different build environment or              echo "           and (3) the allowed sufix '.F' and '.$tfs' in makefile"
312    contact the <MITgcm-support@mitgcm.org> list for help.              echo "  or contact the <MITgcm-support@mitgcm.org> list for help."
313                echo ""
 EOF  
314              exit -1              exit -1
315              return              return
316          fi          fi
# Line 412  build_cyrus_makedepend()  { Line 411  build_cyrus_makedepend()  {
411      (      (
412          cd $ROOTDIR/tools/cyrus-imapd-makedepend  \          cd $ROOTDIR/tools/cyrus-imapd-makedepend  \
413              &&  ./configure > /dev/null 2>&1  \              &&  ./configure > /dev/null 2>&1  \
414              &&  make > /dev/null 2>&1              &&  $MAKE > /dev/null 2>&1
415          if test -x ./makedepend.exe ; then          if test -x ./makedepend.exe ; then
416              $LN ./makedepend.exe ./makedepend              $LN ./makedepend.exe ./makedepend
417          fi          fi
# Line 436  build_embed_encode() Line 435  build_embed_encode()
435  {  {
436      printf "  building the embed-encode utility...  "      printf "  building the embed-encode utility...  "
437      if test ! -e "$ROOTDIR/tools/embed_encode/encode_files" ; then      if test ! -e "$ROOTDIR/tools/embed_encode/encode_files" ; then
438          if test ! -d "$ROOTDIR/tools/embed_encode" ; then          if test ! -d "$ROOTDIR/tools/embed_encode" ; then
439              echo              echo
440              echo "    Error: can't locate \"$ROOTDIR/tools/embed_encode\""              echo "    Error: can't locate \"$ROOTDIR/tools/embed_encode\""
441              echo              echo
442              EMBED_SRC=f              EMBED_SRC=f
443              return 1              return 1
444          fi          fi
445          clist="cc gcc c89 $CC"          clist="cc gcc c89 $CC"
446          for ic in $clist ; do          for ic in $clist ; do
447              comm="$ic -o encode_files encode_files.c"              comm="$ic -o encode_files encode_files.c"
# Line 578  EOF Line 577  EOF
577      if test "x$OPTFILE" = x ; then      if test "x$OPTFILE" = x ; then
578          OPTFILE=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$FC          OPTFILE=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$FC
579          if test ! -r $OPTFILE ; then          if test ! -r $OPTFILE ; then
580               echo "  I looked for the file "$OPTFILE" but did not find it"               echo "  I looked for the file "$OPTFILE" but did not find it"
581          fi          fi
582      fi      fi
583    
584      if test "x$OPTFILE" = x ; then      if test "x$OPTFILE" = x ; then
# Line 597  Error: No options file was found in:  $R Line 596  Error: No options file was found in:  $R
596  EOF  EOF
597          exit 1          exit 1
598      fi      fi
   
 #     # look for possible MPI libraries  
 #     mpi_libs=  
 #     mpi_fort=`which mpif77 2>/dev/null`  
 #     RETVAL=$?  
 #     if test "x${RETVAL}" = x0 ; then  
 #       cat >>test.f <<EOF  
 #       PROGRAM HELLO  
 #       DO 10, I=1,10  
 #       PRINT *,'Hello World'  
 #    10 CONTINUE  
 #       STOP  
 #       END  
 # EOF  
 #       eval "$mpi_fort -showme test.f > out"  
 #       RETVAL=$?  
 #       if test "x${RETVAL}" = x0 ; then  
 #           a=`cat out`  
 #           for i in $a ; do  
 #               case $i in  
 #                   -*)  
 #                       mpi_libs="$mpi_libs $i" ;;  
 #               esac  
 #           done  
 #           echo "The MPI libs appear to be:"  
 #           echo "  "$mpi_libs  
 #       fi  
 #       rm -f test.f out  
 #     fi  
599  }  }
600    
601  #  Parse the package dependency information  #  Parse the package dependency information
# Line 650  get_fortran_c_namemangling()  { Line 620  get_fortran_c_namemangling()  {
620    
621      #echo "FC_NAMEMANGLE = \"$FC_NAMEMANGLE\""      #echo "FC_NAMEMANGLE = \"$FC_NAMEMANGLE\""
622      if test ! "x$FC_NAMEMANGLE" = x ; then      if test ! "x$FC_NAMEMANGLE" = x ; then
623          return 0          return 0
624      fi      fi
625      echo " running: get_fortran_c_namemangling()" >> $LOGFILE      echo " running: get_fortran_c_namemangling()" >> $LOGFILE
626    
# Line 1037  check_lapack_libs()  { Line 1007  check_lapack_libs()  {
1007      echo "running: check_lapack_libs()" >> $LOGFILE      echo "running: check_lapack_libs()" >> $LOGFILE
1008      cat <<EOF > genmake_tla.F      cat <<EOF > genmake_tla.F
1009        program fgenla        program fgenla
1010        integer info        integer info
1011        integer ipiv( 2 )        integer ipiv( 2 )
1012        double precision ab( 4, 2 ), b( 2 )        double precision ab( 4, 2 ), b( 2 )
1013        data ab / 0., 0., 1., 2., 0., 2., 1., 0. /        data ab / 0., 0., 1., 2., 0., 2., 1., 0. /
# Line 1108  EOF Line 1078  EOF
1078                  LIBS="$LIBS -llapack -lf77blas -lcblas"                  LIBS="$LIBS -llapack -lf77blas -lcblas"
1079                  HAVE_LAPACK=t                  HAVE_LAPACK=t
1080                  echo "check_lapack: successful" >> $LOGFILE                  echo "check_lapack: successful" >> $LOGFILE
1081              else              else
1082              # try again with "-latlas" added to the libs              # try again with "-latlas" added to the libs
1083                  echo "==> try again with added '-llapack -lf77blas -lcblas -latlas'" > genmake_tla.log                  echo "==> try again with added '-llapack -lf77blas -lcblas -latlas'" > genmake_tla.log
1084                  echo "cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS \ " >> genmake_tla.log                  echo "cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS \ " >> genmake_tla.log
1085                  echo " &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS \ " >> genmake_tla.log                  echo " &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS \ " >> genmake_tla.log
1086                  echo " &&  $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas -latlas" >> genmake_tla.log                  echo " &&  $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas -latlas" >> genmake_tla.log
1087                  cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS 2>/dev/null  \                  cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS 2>/dev/null  \
1088                      &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS >> genmake_tla.log 2>&1  \                      &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS >> genmake_tla.log 2>&1  \
1089                      &&  $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas -latlas >> genmake_tla.log 2>&1                      &&  $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas -latlas >> genmake_tla.log 2>&1
1090                  RET_COMPILE=$?                  RET_COMPILE=$?
1091                  echo >> $LOGFILE                  echo >> $LOGFILE
1092                  cat genmake_tla.log >> $LOGFILE                  cat genmake_tla.log >> $LOGFILE
1093                  if test "x$RET_COMPILE" = x0 ; then                  if test "x$RET_COMPILE" = x0 ; then
1094                      LIBS="$LIBS -llapack -lf77blas -lcblas -latlas"                      LIBS="$LIBS -llapack -lf77blas -lcblas -latlas"
1095                      HAVE_LAPACK=t                      HAVE_LAPACK=t
1096                      echo "check_lapack: successful" >> $LOGFILE                      echo "check_lapack: successful" >> $LOGFILE
1097                  fi                  fi
1098              fi              fi
1099          fi          fi
1100      fi      fi
# Line 1207  SOURCEDIRS= Line 1177  SOURCEDIRS=
1177  INCLUDEDIRS=  INCLUDEDIRS=
1178  STANDARDDIRS="USE_THE_DEFAULT"  STANDARDDIRS="USE_THE_DEFAULT"
1179    
1180    #- local config file
1181    gm_local="genmake_local"
1182    
1183  G2ARGS=  G2ARGS=
1184  BASH=  BASH=
1185  PWD=`pwd`  PWD=`pwd`
# Line 1243  SVD_TAMC_FLAGS= Line 1216  SVD_TAMC_FLAGS=
1216  TAMC_EXTRA=  TAMC_EXTRA=
1217    
1218  #  The following state can be set directly by command-line switches  #  The following state can be set directly by command-line switches
1219  gm_s1="OPTFILE PKG_DEPEND PKG_GROUPS DISABLE ENABLE MAKEFILE MAKEDEPEND PLATFORM"  gm_s1="ROOTDIR STANDARDDIRS MODS PKG_DEPEND PKG_GROUPS DISABLE ENABLE"
1220  gm_s2="FC CC MPI OMP USE_R4 TS PAPIS PCLS PAPI PCL HPMT IEEE DEVEL GSL FEXTRAFLAGS"  gm_s2="PLATFORM OPTFILE MAKE MAKEFILE MAKEDEPEND FC CC MPI OMP USE_R4"
1221  gm_s3="ROOTDIR STANDARDDIRS MODS DUMPSTATE"  gm_s3="FEXTRAFLAGS IEEE DEVEL GSL TS PAPIS PCLS PAPI PCL HPMT DUMPSTATE"
1222    
1223  #  The following state is not directly set by command-line switches  #  The following state is not directly set by command-line switches
1224  gm_s4="LN S64 LINK MAKE PACKAGES INCLUDES FFLAGS FOPTIM"  gm_s4="LN S64 LINK PACKAGES INCLUDES FFLAGS FOPTIM"
1225  gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS"  gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS"
1226  gm_s6="TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK"  gm_s6="TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK"
1227  gm_s7="PWD THISHOST THISUSER THISDATE THISVER MACHINE"  gm_s7="PWD THISHOST THISUSER THISDATE THISVER MACHINE"
# Line 1278  LOGFILE="genmake.log" Line 1251  LOGFILE="genmake.log"
1251  rm -f genmake_state genmake_*optfile $LOGFILE  rm -f genmake_state genmake_*optfile $LOGFILE
1252    
1253  echo "===  Processing options files and arguments  ==="  echo "===  Processing options files and arguments  ==="
 gm_local="genmake_local"  
 printf "  getting local config information:  "  
 if test -f $gm_local ; then  
     echo "using $gm_local"  
     . $gm_local  
     # echo "DISABLE=$DISABLE"  
     # echo "ENABLE=$ENABLE"  
 else  
     echo "none found"  
 fi  
1254    
1255  #echo "$0::$1:$2:$3:$4:$5:$6:$7:"  #echo "$0::$1:$2:$3:$4:$5:$6:$7:"
1256  #parse_options  #parse_options
# Line 1306  for ac_option in "$@" ; do Line 1269  for ac_option in "$@" ; do
1269      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
1270    
1271      case $ac_option in      case $ac_option in
1272            
1273          -help | --help | -h | --h)          -help | --help | -h | --h)
1274              usage ;;              usage ;;
1275            
1276          -nooptfile | --nooptfile)          -nooptfile | --nooptfile)
1277              OPTFILE="NONE" ;;              OPTFILE="NONE" ;;
1278          -optfile | --optfile | -of | --of)          -optfile | --optfile | -of | --of)
1279              ac_prev=OPTFILE ;;              ac_prev=OPTFILE ;;
1280          -optfile=* | --optfile=* | -of=* | --of=*)          -optfile=* | --optfile=* | -of=* | --of=*)
1281              OPTFILE=$ac_optarg ;;              OPTFILE=$ac_optarg ;;
1282            
1283          -adoptfile | --adoptfile | -adof | --adof)          -adoptfile | --adoptfile | -adof | --adof)
1284              ac_prev=AD_OPTFILE ;;              ac_prev=AD_OPTFILE ;;
1285          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)
1286              AD_OPTFILE=$ac_optarg ;;              AD_OPTFILE=$ac_optarg ;;
1287            
1288          -pdepend | --pdepend)          -pdepend | --pdepend)
1289              ac_prev=PKG_DEPEND ;;              ac_prev=PKG_DEPEND ;;
1290          -pdepend=* | --pdepend=*)          -pdepend=* | --pdepend=*)
1291              PKG_DEPEND=$ac_optarg ;;              PKG_DEPEND=$ac_optarg ;;
1292            
1293          -pgroups | --pgroups)          -pgroups | --pgroups)
1294              ac_prev=PKG_GROUPS ;;              ac_prev=PKG_GROUPS ;;
1295          -pgroups=* | --pgroups=*)          -pgroups=* | --pgroups=*)
1296              PKG_GROUPS=$ac_optarg ;;              PKG_GROUPS=$ac_optarg ;;
1297            
1298          -make | --make | -m | --m)          -make | --make | -m | --m)
1299              ac_prev=MAKE ;;              ac_prev=MAKE ;;
1300          -make=* | --make=* | -m=* | --m=*)          -make=* | --make=* | -m=* | --m=*)
1301              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
1302            
1303          -bash | --bash)          -bash | --bash)
1304              ac_prev=BASH ;;              ac_prev=BASH ;;
1305          -bash=* | --bash=*)          -bash=* | --bash=*)
1306              BASH=$ac_optarg ;;              BASH=$ac_optarg ;;
1307            
1308          -makedepend | --makedepend | -md | --md)          -makedepend | --makedepend | -md | --md)
1309              ac_prev=MAKEDEPEND ;;              ac_prev=MAKEDEPEND ;;
1310          -makedepend=* | --makedepend=* | -md=* | --md=*)          -makedepend=* | --makedepend=* | -md=* | --md=*)
1311              MAKEDEPEND=$ac_optarg ;;              MAKEDEPEND=$ac_optarg ;;
1312            
1313          -makefile | --makefile | -ma | --ma)          -makefile | --makefile | -mf | --mf)
1314              ac_prev=MAKEFILE ;;              ac_prev=MAKEFILE ;;
1315          -makefile=* | --makefile=* | -ma=* | --ma=*)          -makefile=* | --makefile=* | -mf=* | --mf=*)
1316              MAKEFILE=$ac_optarg ;;              MAKEFILE=$ac_optarg ;;
1317            
1318          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)
1319              echo "ERROR: The platform option has been removed.  Please specify"              echo "ERROR: The platform option has been removed.  Please specify"
1320              echo "  the build options using the \"optfile\" mechanism."              echo "  the build options using the \"optfile\" mechanism."
1321              echo              echo
1322              usage              usage
1323              ;;              ;;
1324            
1325          -rootdir | --rootdir | -rd | --rd)          -rootdir | --rootdir | -rd | --rd)
1326              ac_prev=ROOTDIR ;;              ac_prev=ROOTDIR ;;
1327          -rootdir=* | --rootdir=* | -rd=* | --rd=*)          -rootdir=* | --rootdir=* | -rd=* | --rd=*)
1328              ROOTDIR=$ac_optarg ;;              ROOTDIR=$ac_optarg ;;
1329            
1330          -mods | --mods | -mo | --mo)          -mods | --mods | -mo | --mo)
1331              ac_prev=MODS ;;              ac_prev=MODS ;;
1332          -mods=* | --mods=* | -mo=* | --mo=*)          -mods=* | --mods=* | -mo=* | --mo=*)
1333              MODS=$ac_optarg ;;              MODS=$ac_optarg ;;
1334            
1335          -disable | --disable)          -disable | --disable)
1336              ac_prev=DISABLE ;;              ac_prev=DISABLE ;;
1337          -disable=* | --disable=*)          -disable=* | --disable=*)
1338              DISABLE=$ac_optarg ;;              DISABLE=$ac_optarg ;;
1339            
1340          -enable | --enable)          -enable | --enable)
1341              ac_prev=ENABLE ;;              ac_prev=ENABLE ;;
1342          -enable=* | --enable=*)          -enable=* | --enable=*)
1343              ENABLE=$ac_optarg ;;              ENABLE=$ac_optarg ;;
1344            
1345          -standarddirs | --standarddirs)          -standarddirs | --standarddirs)
1346              ac_prev=STANDARDDIRS ;;              ac_prev=STANDARDDIRS ;;
1347          -standarddirs=* | --standarddirs=*)          -standarddirs=* | --standarddirs=*)
# Line 1388  for ac_option in "$@" ; do Line 1351  for ac_option in "$@" ; do
1351  #               ac_prev=cpp ;;  #               ac_prev=cpp ;;
1352  #           -cpp=* | --cpp=*)  #           -cpp=* | --cpp=*)
1353  #               CPP=$ac_optarg ;;  #               CPP=$ac_optarg ;;
1354            
1355          -cc | --cc)          -cc | --cc)
1356              ac_prev=CC ;;              ac_prev=CC ;;
1357          -cc=* | --cc=*)          -cc=* | --cc=*)
1358              CC=$ac_optarg ;;              CC=$ac_optarg ;;
1359            
1360          -fortran | --fortran | -fc | --fc)          -fortran | --fortran | -fc | --fc)
1361              ac_prev=FC ;;              ac_prev=FC ;;
1362          -fc=* | --fc=*)          -fc=* | --fc=*)
1363              FC=$ac_optarg ;;              FC=$ac_optarg ;;
1364            
1365          -fs | --fs)          -fs | --fs)
1366              ac_prev=FS ;;              ac_prev=FS ;;
1367          -fs=* | --fs=*)          -fs=* | --fs=*)
1368              FS=$ac_optarg ;;              FS=$ac_optarg ;;
1369            
1370          -fs90 | --fs90)          -fs90 | --fs90)
1371              ac_prev=FS90 ;;              ac_prev=FS90 ;;
1372          -fs90=* | --fs90=*)          -fs90=* | --fs90=*)
1373              FS90=$ac_optarg ;;              FS90=$ac_optarg ;;
1374            
1375          -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 )          -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 )
1376              USE_R4=true ;;              USE_R4=true ;;
1377    
# Line 1416  for ac_option in "$@" ; do Line 1379  for ac_option in "$@" ; do
1379              IEEE=true ;;              IEEE=true ;;
1380          -noieee | --noieee)          -noieee | --noieee)
1381              echo "Warning: ignore option '$ac_option' (default is already without '-ieee')" ;;              echo "Warning: ignore option '$ac_option' (default is already without '-ieee')" ;;
1382          -devel | --devel)          -devel | --devel)
1383              IEEE=true ; DEVEL=true ;;              IEEE=true ; DEVEL=true ;;
1384          -gsl | --gsl)          -gsl | --gsl)
1385              GSL=true ;;              GSL=true ;;
1386    
1387          -ts | --ts)          -ts | --ts)
# Line 1441  for ac_option in "$@" ; do Line 1404  for ac_option in "$@" ; do
1404          -mpi=* | --mpi=*)          -mpi=* | --mpi=*)
1405              MPIPATH=$ac_optarg              MPIPATH=$ac_optarg
1406              MPI=true ;;              MPI=true ;;
1407            
1408          -omp | --omp)          -omp | --omp)
1409              OMP=true ;;              OMP=true ;;
1410          -omp=* | --omp=*)          -omp=* | --omp=*)
1411              OMPFLAG=$ac_optarg              OMPFLAG=$ac_optarg
1412              OMP=true ;;              OMP=true ;;
1413            
1414          -ds | --ds)          -ds | --ds)
1415              DUMPSTATE=t ;;              DUMPSTATE=t ;;
1416            
1417          -extra_flag | --extra_flag)          -extra_flag | --extra_flag)
1418              ac_prev=FEXTRAFLAGS ;;              ac_prev=FEXTRAFLAGS ;;
1419          -extra_flag=* | --extra_flag=*)          -extra_flag=* | --extra_flag=*)
1420              FEXTRAFLAGS=$ac_optarg ;;              FEXTRAFLAGS=$ac_optarg ;;
1421            
1422          -taf_extra | --taf_extra)          -taf_extra | --taf_extra)
1423              ac_prev=TAF_EXTRA ;;              ac_prev=TAF_EXTRA ;;
1424          -taf_extra=* | --taf_extra=*)          -taf_extra=* | --taf_extra=*)
# Line 1465  for ac_option in "$@" ; do Line 1428  for ac_option in "$@" ; do
1428              ac_prev=TAMC_EXTRA ;;              ac_prev=TAMC_EXTRA ;;
1429          -tamc_extra=* | --tamc_extra=*)          -tamc_extra=* | --tamc_extra=*)
1430              TAMC_EXTRA=$ac_optarg ;;              TAMC_EXTRA=$ac_optarg ;;
1431            
1432          -ignoretime | -ignore_time | --ignoretime | --ignore_time)          -ignoretime | -ignore_time | --ignoretime | --ignore_time)
1433              IGNORE_TIME="-DIGNORE_TIME" ;;              IGNORE_TIME="-DIGNORE_TIME" ;;
1434    
# Line 1476  for ac_option in "$@" ; do Line 1439  for ac_option in "$@" ; do
1439              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
1440              usage              usage
1441              ;;              ;;
1442            
1443          *)          *)
1444              echo "Error: unrecognized argument: "$ac_option              echo "Error: unrecognized argument: "$ac_option
1445              usage              usage
1446              ;;              ;;
1447            
1448      esac      esac
1449    
1450  done  done
1451    
1452    printf "  getting local config information:  "
1453    if test -f $gm_local ; then
1454        echo "using $gm_local"
1455        . $gm_local
1456    else
1457        echo "none found"
1458    fi
1459    
1460  if test -f ./.genmakerc ; then  if test -f ./.genmakerc ; then
1461      echo      echo
1462      echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\""      echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\""
# Line 1714  fi Line 1685  fi
1685  if test ! "x$TS" = x ; then  if test ! "x$TS" = x ; then
1686        echo "  Turning on timing per timestep"        echo "  Turning on timing per timestep"
1687        if test ! "x$FOOLAD" = x ; then        if test ! "x$FOOLAD" = x ; then
1688              DEFINES="$DEFINES -DTIME_PER_TIMESTEP_SFP"              DEFINES="$DEFINES -DTIME_PER_TIMESTEP_SFP"
1689        else        else
1690              DEFINES="$DEFINES -DTIME_PER_TIMESTEP"              DEFINES="$DEFINES -DTIME_PER_TIMESTEP"
1691        fi        fi
# Line 1750  if test ! "x$PAPI" = x ; then Line 1721  if test ! "x$PAPI" = x ; then
1721            echo "  Sticking with PAPI flop summary per timestep!"            echo "  Sticking with PAPI flop summary per timestep!"
1722        else        else
1723            echo "  Turning on performance analysis with PAPI"            echo "  Turning on performance analysis with PAPI"
1724            echo "  Please make sure PAPIINC, PAPILIB are defined"            echo "  Please make sure PAPIINC, PAPILIB are defined"
1725            DEFINES="$DEFINES -DUSE_PAPI"            DEFINES="$DEFINES -DUSE_PAPI"
1726            INCLUDES="$INCLUDES $PAPIINC"            INCLUDES="$INCLUDES $PAPIINC"
1727            LIBS="$LIBS $PAPILIB"            LIBS="$LIBS $PAPILIB"
# Line 1762  if test ! "x$PCL" = x ; then Line 1733  if test ! "x$PCL" = x ; then
1733            echo "  Sticking with PCL flop summary per timestep!"            echo "  Sticking with PCL flop summary per timestep!"
1734        else        else
1735            echo "  Turning on performance analysis with PCL"            echo "  Turning on performance analysis with PCL"
1736            echo "  Please make sure PCLINC, PCLLIB are defined"            echo "  Please make sure PCLINC, PCLLIB are defined"
1737            DEFINES="$DEFINES -DUSE_PCL"            DEFINES="$DEFINES -DUSE_PCL"
1738            INCLUDES="$INCLUDES $PCLINC"            INCLUDES="$INCLUDES $PCLINC"
1739            LIBS="$LIBS $PCLLIB"            LIBS="$LIBS $PCLLIB"
# Line 1772  if test ! "x$HPMT" = x ; then Line 1743  if test ! "x$HPMT" = x ; then
1743        if test ! "x$PAPI" = x ; then        if test ! "x$PAPI" = x ; then
1744            echo "  PAPI and the HPM Toolkit cannot co-exist!"            echo "  PAPI and the HPM Toolkit cannot co-exist!"
1745            echo "  Sticking with PAPI!"            echo "  Sticking with PAPI!"
1746        else if test ! "x$PCL" = x ; then        else
1747            if test ! "x$PCL" = x ; then
1748            echo "  PCL and the HPM Toolkit cannot co-exist!"            echo "  PCL and the HPM Toolkit cannot co-exist!"
1749            echo "  Sticking with PCL!"            echo "  Sticking with PCL!"
1750        else          else
1751            echo "  Turning on performance analysis with the HPM Toolkit"            echo "  Turning on performance analysis with the HPM Toolkit"
1752            echo "  Please make sure HPMTINC, HPMTLIB are defined"            echo "  Please make sure HPMTINC, HPMTLIB are defined"
1753            DEFINES="$DEFINES -DUSE_LIBHPM"            DEFINES="$DEFINES -DUSE_LIBHPM"
1754            INCLUDES="$INCLUDES $HPMTINC"            INCLUDES="$INCLUDES $HPMTINC"
1755            LIBS="$LIBS $HPMTLIB"            LIBS="$LIBS $HPMTLIB"
1756        fi          fi
1757        fi        fi
1758  fi  fi
1759  if test ! "x$GSL" = x ; then  if test ! "x$GSL" = x ; then
# Line 2106  else Line 2078  else
2078          exit 1          exit 1
2079      else      else
2080          echo "    using PKG_LIST=\"$PKG_LIST\""          echo "    using PKG_LIST=\"$PKG_LIST\""
2081          #  Strip the comments and add all the names          #  Strip the comments and add all the names
2082          pkg_list=`cat $PKG_LIST | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`          pkg_list=`cat $PKG_LIST | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`
2083          RETVAL=$?          RETVAL=$?
2084          if test "x${RETVAL}" != x0 ; then          if test "x${RETVAL}" != x0 ; then
# Line 2156  for i in $PACKAGES ; do Line 2128  for i in $PACKAGES ; do
2128      j=`echo $i | sed 's/[-+]//'`      j=`echo $i | sed 's/[-+]//'`
2129      if test ! -d "$ROOTDIR/pkg/$j" ; then      if test ! -d "$ROOTDIR/pkg/$j" ; then
2130          echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'"          echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'"
2131          exit 1          exit 1
2132      fi      fi
2133      echo $i >> ./.tmp_pack      echo $i >> ./.tmp_pack
2134  done  done
# Line 2201  else Line 2173  else
2173          echo "Error: problem encountered while building source files in pkg/mnc:"          echo "Error: problem encountered while building source files in pkg/mnc:"
2174          cat make_mnc.errors 1>&2          cat make_mnc.errors 1>&2
2175          if test "x$mnc_in" = x0 ; then          if test "x$mnc_in" = x0 ; then
2176              exit 1              exit 1
2177          else          else
2178              DISABLE="$DISABLE mnc"              DISABLE="$DISABLE mnc"
2179          fi          fi
# Line 2300  if  test "x${PKG_DEPEND}" != x ; then Line 2272  if  test "x${PKG_DEPEND}" != x ; then
2272    
2273          #  Do we need to add $dname according to the dependency rules?          #  Do we need to add $dname according to the dependency rules?
2274          if test "x$pin" = xt -a "x$plus" = "x+" -a "x$din" = xf ; then          if test "x$pin" = xt -a "x$plus" = "x+" -a "x$din" = xf ; then
2275              #echo "   " $pname ": need to add :" $dname              #echo "   " $pname ": need to add :" $dname
2276              in_dis="f"              in_dis="f"
2277              for dis in $DISABLE ; do              for dis in $DISABLE ; do
2278                  if test "x$dis" = "x$dname" ; then                  if test "x$dis" = "x$dname" ; then
# Line 2325  if  test "x${PKG_DEPEND}" != x ; then Line 2297  if  test "x${PKG_DEPEND}" != x ; then
2297              echo "  the dependency rules for \"$dname\""              echo "  the dependency rules for \"$dname\""
2298              exit 1              exit 1
2299          fi          fi
2300          i=`echo "$i + 1" | bc -l`          i=`echo "$i + 1" | bc -l`
2301          #i=$(( $i + 1 ))          #i=$(( $i + 1 ))
2302      done      done
2303      ck=$ck"t"      ck=$ck"t"
# Line 2366  for n in $names ; do Line 2338  for n in $names ; do
2338          done          done
2339          if test "x$has_pack" = xf ; then          if test "x$has_pack" = xf ; then
2340              undef=`echo "ALLOW_$n" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`              undef=`echo "ALLOW_$n" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2341              DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"              DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"
2342          fi          fi
2343      fi      fi
2344  done  done
# Line 2379  for i in $PACKAGES ; do Line 2351  for i in $PACKAGES ; do
2351  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!
2352      case $i in      case $i in
2353          aim_v23)          aim_v23)
2354              ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM"              ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM"
2355              echo "Warning: ALLOW_AIM is set to enable aim_v23."              echo "Warning: ALLOW_AIM is set to enable aim_v23."
2356              ;;              ;;
2357      esac      esac
# Line 2421  for i in $spaths ; do Line 2393  for i in $spaths ; do
2393      if test -f $try -a -r $try -a "x$CPP_OPTIONS" = x ; then      if test -f $try -a -r $try -a "x$CPP_OPTIONS" = x ; then
2394          echo "    found CPP_OPTIONS=\"$try\""          echo "    found CPP_OPTIONS=\"$try\""
2395          CPP_OPTIONS="$try"          CPP_OPTIONS="$try"
2396          # New safety test: make sure packages are not mentioned in CPP_OPTIONS.h          # New safety test: make sure packages are not mentioned in CPP_OPTIONS.h
2397          for n in $names ; do          for n in $names ; do
2398              test_for_package_in_cpp_options $CPP_OPTIONS $n              test_for_package_in_cpp_options $CPP_OPTIONS $n
2399          done          done
2400      fi      fi
2401      try="$i/CPP_EEOPTIONS.h"      try="$i/CPP_EEOPTIONS.h"
2402      if test -f $try -a -r $try -a "x$CPP_EEOPTIONS" = x ; then      if test -f $try -a -r $try -a "x$CPP_EEOPTIONS" = x ; then
2403          echo "    found CPP_EEOPTIONS=\"$try\""          echo "    found CPP_EEOPTIONS=\"$try\""
2404          # New safety test: make sure MPI is not determined by CPP_EEOPTIONS.h          # New safety test: make sure MPI is not determined by CPP_EEOPTIONS.h
2405  #**** not yet enabled ****  #**** not yet enabled ****
2406  #        test_for_mpi_in_cpp_eeoptions $try  #        test_for_mpi_in_cpp_eeoptions $try
2407  #**** not yet enabled ****  #**** not yet enabled ****
# Line 2575  for d in $alldirs ; do Line 2547  for d in $alldirs ; do
2547          if test ! -r ".links.tmp/$sf" ; then          if test ! -r ".links.tmp/$sf" ; then
2548              if test -f "$d/$sf" ; then              if test -f "$d/$sf" ; then
2549                  ignore_f=f                  ignore_f=f
2550                  case $d/$sf in                  case $d/$sf in
2551                    ./$PACKAGES_DOT_H)                    ./$PACKAGES_DOT_H)
2552                          ignore_f=t                          ignore_f=t
2553                          ;;                          ;;
2554                    ./AD_CONFIG.h)                    ./AD_CONFIG.h)
2555                          ignore_f=t                          ignore_f=t
2556                          ;;                          ;;
2557                    ./FC_NAMEMANGLE.h)                    ./FC_NAMEMANGLE.h)
2558                          ignore_f=t                          ignore_f=t
2559                          ;;                          ;;
2560                    ./BUILD_INFO.h)                    ./BUILD_INFO.h)
2561                          ignore_f=t                          ignore_f=t
2562                          ;;                          ;;
2563                    ./EMBEDDED_FILES.h)                    ./EMBEDDED_FILES.h)
2564                          ignore_f=t                          ignore_f=t
2565                          ;;                          ;;
2566                    *)                    *)
2567                          #  For the local directory *ONLY*,                          #  For the local directory *ONLY*,
2568                          #  ignore all soft-links                          #  ignore all soft-links
2569                          if test "x$HAVE_TEST_L" = xt -a "x$d" = x. -a -L $sf ; then                          if test "x$HAVE_TEST_L" = xt -a "x$d" = x. -a -L $sf ; then
# Line 2601  for d in $alldirs ; do Line 2573  for d in $alldirs ; do
2573                              deplist="$deplist $sf"                              deplist="$deplist $sf"
2574                          fi                          fi
2575                          ;;                          ;;
2576                  esac                  esac
2577                  if test "x$ignore_f" = xf ; then                  if test "x$ignore_f" = xf ; then
2578                      extn=`echo $sf | $AWK -F. '{print $NF}'`                      extn=`echo $sf | $AWK -F. '{print $NF}'`
2579                      case $extn in                      case $extn in
# Line 2648  for d in $alldirs ; do Line 2620  for d in $alldirs ; do
2620                          echo    " \\"  >> hsrclist.tmp                          echo    " \\"  >> hsrclist.tmp
2621                          printf " $sf" >> hsrclist.tmp                          printf " $sf" >> hsrclist.tmp
2622                          ;;                          ;;
2623                      flow)                      flow)
2624                          echo    " \\"  >> ad_flow_files.tmp                          echo    " \\"  >> ad_flow_files.tmp
2625                          printf " $sf" >> ad_flow_files.tmp                          printf " $sf" >> ad_flow_files.tmp
2626                          ;;                          ;;
# Line 2659  for d in $alldirs ; do Line 2631  for d in $alldirs ; do
2631      done      done
2632      if test "x$deplist" != x ; then      if test "x$deplist" != x ; then
2633        if test "$d" != "." ; then        if test "$d" != "." ; then
2634          echo "" >> srclinks.tmp          echo "" >> srclinks.tmp
2635          echo "#  These files are linked from $d" >> srclinks.tmp          echo "#  These files are linked from $d" >> srclinks.tmp
2636          echo "$deplist :" >> srclinks.tmp          echo "$deplist :" >> srclinks.tmp
2637  # We need to make sure that the link isn't already there.  # We need to make sure that the link isn't already there.
# Line 2680  echo "" >> ad_flow_files.tmp Line 2652  echo "" >> ad_flow_files.tmp
2652  CMDLINE=$0  CMDLINE=$0
2653  for xx in "$@" ; do nw=`echo $xx | wc -w`  for xx in "$@" ; do nw=`echo $xx | wc -w`
2654      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"
2655                          else CMDLINE="$CMDLINE '$xx'" ; fi                          else CMDLINE="$CMDLINE '$xx'" ; fi
2656  done  done
2657    
2658  if test -f $MAKEFILE ; then  if test -f $MAKEFILE ; then
# Line 2714  cat >>$MAKEFILE <<EOF Line 2686  cat >>$MAKEFILE <<EOF
2686  # INCLUDES     : Directories searched for header files  # INCLUDES     : Directories searched for header files
2687  # DEFINES      : Macro definitions for CPP  # DEFINES      : Macro definitions for CPP
2688  # MAKEDEPEND   : Dependency generator  # MAKEDEPEND   : Dependency generator
 # KPP          : Special preprocessor command (specific to platform)  
 # KFLAGS       : Flags for KPP  
2689  # FC           : Fortran compiler command  # FC           : Fortran compiler command
2690  # FFLAGS       : Configuration/debugging options for FC  # FFLAGS       : Configuration/debugging options for FC
2691  # FOPTIM       : Optimization options for FC  # FOPTIM       : Optimization options for FC
# Line 2789  NOOPTFLAGS = ${NOOPTFLAGS} Line 2759  NOOPTFLAGS = ${NOOPTFLAGS}
2759  # Flags and libraries needed for linking  # Flags and libraries needed for linking
2760  LIBS = ${LIBS}  LIBS = ${LIBS}
2761  # Name of the makefile  # Name of the makefile
2762  MAKEFILE=${MAKEFILE}  MAKEFILE = ${MAKEFILE}
2763    # Name of the make program
2764    MAKE = ${MAKE}
2765    
2766  EOF  EOF
2767    
# Line 2813  echo >> $MAKEFILE Line 2785  echo >> $MAKEFILE
2785  echo 'F77_PP_SRC_FILES = $(F77_SRC_FILES:.F=.'$FS')'      >> $MAKEFILE  echo 'F77_PP_SRC_FILES = $(F77_SRC_FILES:.F=.'$FS')'      >> $MAKEFILE
2786  echo 'F90_PP_SRC_FILES = $(F90_SRC_FILES:.F90=.'$FS90')' >> $MAKEFILE  echo 'F90_PP_SRC_FILES = $(F90_SRC_FILES:.F90=.'$FS90')' >> $MAKEFILE
2787  echo 'OBJFILES= $(F77_SRC_FILES:.F=.o) $(C_SRC_FILES:.c=.o) $(F90_SRC_FILES:.F90=.o)' >> $MAKEFILE  echo 'OBJFILES= $(F77_SRC_FILES:.F=.o) $(C_SRC_FILES:.c=.o) $(F90_SRC_FILES:.F90=.o)' >> $MAKEFILE
2788  echo 'FLOFILES =  $(AD_FLOW_FILES:.flow=.flowdir)' >> $MAKEFILE  echo 'FLOWFILES =  $(AD_FLOW_FILES:.flow=.flowdir)' >> $MAKEFILE
2789  echo >> $MAKEFILE  echo >> $MAKEFILE
2790  echo '.SUFFIXES:' >> $MAKEFILE  echo '.SUFFIXES:' >> $MAKEFILE
2791  echo '.SUFFIXES: .o .'$FS' .p .F .c .f'$FS90' .'$FS90' .FF90 .F90 .flowdir .flow' >> $MAKEFILE  echo '.SUFFIXES: .o .'$FS' .p .F .c .f'$FS90' .'$FS90' .FF90 .F90 .flowdir .flow' >> $MAKEFILE
2792    
2793  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
2794    
2795  all: \$(EXECUTABLE)  all: fwd_exe_target
2796    fwd_exe_target:
2797            @echo Update AD_CONFIG.h and make \$(EXECUTABLE)
2798            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Forward version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
2799            @cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
2800            @-rm -f ad_config.template
2801            \$(MAKE) -f \$(MAKEFILE) \$(EXECUTABLE)
2802    
2803  \$(EXECUTABLE): \$(SPECIAL_FILES) \$(F77_SRC_FILES) \$(C_SRC_FILES) \$(H_SRC_FILES) \$(F90_SRC_FILES) \$(OBJFILES) \$(EMBEDDED_FILES)  \$(EXECUTABLE): \$(SPECIAL_FILES) \$(F77_SRC_FILES) \$(C_SRC_FILES) \$(H_SRC_FILES) \$(F90_SRC_FILES) \$(OBJFILES) \$(EMBEDDED_FILES)
2804          @echo Creating \$@ ...          @echo Creating \$@ ...
2805          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)
2806    
2807  depend:  depend:
2808          @make -f \$(MAKEFILE) links          @\$(MAKE) -f \$(MAKEFILE) links
2809          \$(MAKEDEPEND) -f \$(MAKEFILE) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES)          \$(MAKEDEPEND) -f \$(MAKEFILE) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES)
2810          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)
2811          -rm -f makedepend.out          -rm -f makedepend.out
# Line 2856  clean: Line 2835  clean:
2835    
2836  # remove most of the files that "make" and "make depend" generate  # remove most of the files that "make" and "make depend" generate
2837  Clean:  Clean:
2838          @make -f \$(MAKEFILE) clean          @\$(MAKE) -f \$(MAKEFILE) clean
2839          @make -f \$(MAKEFILE) cleanlinks          @\$(MAKE) -f \$(MAKEFILE) cleanlinks
2840          -rm -f \$(SPECIAL_FILES) f90mkdepend.log $MAKEFILE.old          -rm -f \$(SPECIAL_FILES) f90mkdepend.log $MAKEFILE.old
2841          -rm -f taf_command taf_output taf_ad.log taf_ad_flow.log taf_ftl.log          -rm -f taf_command taf_output taf_ad.log taf_ad_flow.log taf_ftl.log
2842          -rm -f genmake_warnings genmake_errors make.log          -rm -f genmake_warnings genmake_errors make.log
# Line 2865  Clean: Line 2844  Clean:
2844  # remove also the executable, files that "genmake2" generates (except Makefile)  # remove also the executable, files that "genmake2" generates (except Makefile)
2845  #         and output from a run (plus log files from testreport)  #         and output from a run (plus log files from testreport)
2846  CLEAN:  CLEAN:
2847          @make -f \$(MAKEFILE) Clean          @\$(MAKE) -f \$(MAKEFILE) Clean
2848          -rm -f \$(EXECUTABLE) \$(EXE_AD) \$(EXE_FTL) *.bak          -rm -f \$(EXECUTABLE) \$(EXE_AD) \$(EXE_FTL) *.bak
2849          -rm -f $LOGFILE genmake_state genmake_*optfile          -rm -f $LOGFILE genmake_state genmake_*optfile
2850          -rm -f SIZE.h.mpi genmake.tr_log make.tr_log          -rm -f SIZE.h.mpi genmake.tr_log make.tr_log
# Line 2884  cleanlinks: Line 2863  cleanlinks:
2863  # Special targets (SPECIAL_FILES) which are created by make  # Special targets (SPECIAL_FILES) which are created by make
2864  ${PACKAGES_DOT_H}:  ${PACKAGES_DOT_H}:
2865          @echo Creating \$@ ...          @echo Creating \$@ ...
2866          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@
2867  AD_CONFIG.h:  AD_CONFIG.h:
2868          @echo Creating \$@ ...          @echo Creating \$@ ...
2869          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > \$@          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Default version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > \$@
2870  FC_NAMEMANGLE.h:  FC_NAMEMANGLE.h:
2871          @echo Creating \$@ ...          @echo Creating \$@ ...
2872          echo "$FC_NAMEMANGLE" > \$@          echo "$FC_NAMEMANGLE" > \$@
# Line 2996  rm -f adSrcFiles.tmp Line 2975  rm -f adSrcFiles.tmp
2975  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
2976    
2977  # ... AD ...  # ... AD ...
2978  adall: \$(EXE_AD)  adall: ad_exe_target
2979  adtaf: ad_taf_output.$FS  adtaf: ad_taf_output.$FS
2980  adtamc: ad_tamc_output.$FS  adtamc: ad_tamc_output.$FS
2981    
2982    ad_exe_target:
2983            @echo Update AD_CONFIG.h and make \$(EXE_AD)
2984            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Adjoint version" -bAD_CONFIG_H -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
2985            @cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
2986            @-rm -f ad_config.template
2987            \$(MAKE) -f \$(MAKEFILE) \$(EXE_AD)
2988    
2989  ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES) \$(AD_FLOW_FILES)  ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES) \$(AD_FLOW_FILES)
2990          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Adjoint version" -bAD_CONFIG_H -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
2991          cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h          cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
2992          -rm -f ad_config.template          @-rm -f ad_config.template
2993          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
2994          @make -f \$(MAKEFILE) \$(FLOFILES)          @\$(MAKE) -f \$(MAKEFILE) \$(FLOWFILES)
2995          cat \$(FLOFILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ad_input_code.$FS          cat \$(FLOWFILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ad_input_code.$FS
2996    
2997  ad_taf_output.$FS: ad_input_code.$FS  ad_taf_output.$FS: ad_input_code.$FS
2998          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS
# Line 3037  adtrick: Line 3023  adtrick:
3023  adobj: ad_taf_output.o \$(OBJFILES)  adobj: ad_taf_output.o \$(OBJFILES)
3024    
3025  # ... FTL ...  # ... FTL ...
3026  ftlall: \$(EXE_FTL)  ftlall: ftl_exe_target
3027  ftltaf: ftl_taf_output.$FS  ftltaf: ftl_taf_output.$FS
3028  ftltamc: ftl_tamc_output.$FS  ftltamc: ftl_tamc_output.$FS
3029    
3030    ftl_exe_target:
3031            @echo Update AD_CONFIG.h and make \$(EXE_FTL)
3032            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "TangLin version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ad_config.template
3033            @cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3034            @-rm -f ad_config.template
3035            \$(MAKE) -f \$(MAKEFILE) \$(EXE_FTL)
3036    
3037  ftl_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES)  ftl_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES)
3038          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ftl_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "TangLin version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ad_config.template
3039          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h          cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3040          -rm -f ftl_config.template          @-rm -f ad_config.template
3041          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3042          @make -f \$(MAKEFILE) \$(AD_FLOW_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(AD_FLOW_FILES)
3043          cat \$(AD_FLOW_FILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ftl_input_code.$FS          cat \$(AD_FLOW_FILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ftl_input_code.$FS
3044    
3045  ftl_taf_output.$FS: ftl_input_code.$FS  ftl_taf_output.$FS: ftl_input_code.$FS
# Line 3089  svd_touch: Line 3082  svd_touch:
3082          touch ad_taf_output.$FS ftl_taf_output.$FS          touch ad_taf_output.$FS ftl_taf_output.$FS
3083          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ad_taf_output.$FS          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ad_taf_output.$FS
3084          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ftl_taf_output.$FS          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ftl_taf_output.$FS
3085          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ftl_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "SVD version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ad_config.template
3086          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h          cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3087          -rm -f ftl_config.template          @-rm -f ad_config.template
3088    
3089  EOF  EOF
3090    
# Line 3191  f95_test.out: f95_test_mods.f90 f95_test Line 3184  f95_test.out: f95_test_mods.f90 f95_test
3184          f95 -fixed -w=unused -maxcontin=132 -c f95_test_mods.f90 > \$@ 2>&1          f95 -fixed -w=unused -maxcontin=132 -c f95_test_mods.f90 > \$@ 2>&1
3185          f95 -fixed -w=unused -maxcontin=132 -c -fixed f95_test.f90 >> \$@ 2>&1          f95 -fixed -w=unused -maxcontin=132 -c -fixed f95_test.f90 >> \$@ 2>&1
3186    
3187  # the file included below is created by the  CB2M_AD_FILES=\$(AD_FILES:.f=_cb2m.f$FS90)
 # postProcessor and its inclusion sets the  
 # variable POSTPROCESSEDFILES  
 # used below. Because the file is made during  
 # make it won't be read until the second (recursive)  
 # invocation in the rule below  
 -include postProcess.make  
3188    
3189  AD_OBJ_FILES_S1=\$(OPENAD_SUPPORT_F90_SRC_FILES:.F90=.o) \$(OPENAD_SUPPORT_C_SRC_FILES:.c=.o) \$(POSTPROCESSEDFILES:.f$FS90=.o)  AD_OBJ_FILES_S1=\$(OPENAD_SUPPORT_F90_SRC_FILES:.F90=.o) \$(OPENAD_SUPPORT_C_SRC_FILES:.c=.o)  OAD_intrinsics_oad.o \$(CB2M_AD_FILES:.f$FS90=_oad.o)
3190    
3191  AD_OBJ_FILES_S2=\$(AD_OBJ_FILES_S1) \$(NON_AD_F77_SRC_FILES:.F=_cb2m.o) \$(C_SRC_FILES:.c=.o) \$(F90_SRC_FILES:.F90=.o)  AD_OBJ_FILES_S2=\$(AD_OBJ_FILES_S1) \$(NON_AD_F77_SRC_FILES:.F=_cb2m.o) \$(C_SRC_FILES:.c=.o) \$(F90_SRC_FILES:.F90=.o)
3192    
3193  postProcess.comp: \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) postProcess.tag \$(AD_OBJ_FILES_S1)  \$(EXE_AD): \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) postProcess.tag \$(AD_OBJ_FILES_S2)
 ifeq (\$(MAKELEVEL),0)  
         \$(MAKE) adAll  
 else  
         touch \$@  
 endif  
   
 \$(EXE_AD): \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) postProcess.comp \$(AD_OBJ_FILES_S2)  
 ifeq (\$(MAKELEVEL),1)  
3194          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(AD_OBJ_FILES_S2) \$(LIBS)          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(AD_OBJ_FILES_S2) \$(LIBS)
 else  
         touch \$@  
 endif  
   
 # makefile debug rule  
 openad: ad_input_code.w2f.pre.xb.x2w.w2f.td.pp.f$FS90  
 .PHONY: openad  
3195    
3196  # create the module files  # create sources files modules from header files containing common blocks
3197  %_mod.FF90 : %.h ../OAD_support/cb2mGetModules.csh ../OAD_support/cb2mGetModules.awk  %_mod.FF90 : %.h ../OAD_support/cb2mGetModules.csh ../OAD_support/cb2mGetModules.awk
3198          ../OAD_support/cb2mGetModules.csh $< ../OAD_support/cb2mGetModules.awk          ../OAD_support/cb2mGetModules.csh $< ../OAD_support/cb2mGetModules.awk
3199    
3200  # create the header files  # create new header files with USE statements for the new modules made above
3201  %_mod.h : %.h ../OAD_support/cb2mGetHeaders.csh ../OAD_support/cb2mGetHeaders.awk  %_mod.h : %.h ../OAD_support/cb2mGetHeaders.csh ../OAD_support/cb2mGetHeaders.awk
3202          ../OAD_support/cb2mGetHeaders.csh $< ../OAD_support/cb2mGetHeaders.awk \$(CB2M_F90_SRC_NAMES)          ../OAD_support/cb2mGetHeaders.csh $< ../OAD_support/cb2mGetHeaders.awk \$(CB2M_F90_SRC_NAMES)
3203    
3204  # change everybody else to use the new module files:  # change the include directives of everybody to refer to  the new header files with the USE statements
3205  %_cb2m.FF90 : %.F ../OAD_support/cb2mUseModules.bash  %_cb2m.FF90 : %.F ../OAD_support/cb2mUseModules.bash
3206          ../OAD_support/cb2mUseModules.bash $< ${MPI}          ../OAD_support/cb2mUseModules.bash $< ${MPI}
3207    
# Line 3244  ad_output.txt: \$(EXE_AD) Line 3216  ad_output.txt: \$(EXE_AD)
3216          @printf 'running ... '          @printf 'running ... '
3217          @./\$(EXE_AD) > \$@          @./\$(EXE_AD) > \$@
3218    
 CB2M_AD_FILES=\$(AD_FILES:.f=_cb2m.f$FS90)  
3219  ad_input_code.f$FS90:  \$(CB2M_AD_FILES)  ad_input_code.f$FS90:  \$(CB2M_AD_FILES)
3220          cat \$^ > \$@          cat \$^ > \$@
3221    
 # strip all comments and blanks to reduce  
 # the file size in order to reduce perl's memory requirements  
 ad_input_code_sf.f$FS90 : ad_input_code.f$FS90  
         cat \$^ | sed -f ../OAD_support/strip.sed | sed -f ../OAD_support/stop2print.sed > \$@  
   
 # mfef90 preprocessing  
 # expand statement functions  
 # expose mfef90 specific substring handling  
 # add the w2f__types module  
 ad_input_code_sf.w2f.f$FS90: ad_input_code_sf.f$FS90 mfef90 whirl2f whirl2f_be w2f__types.f90  
         ./mfef90 -r8 -z -F -N132 \$<  
         mv \$<.B \$(basename \$<).B  
         ./whirl2f -openad \$(basename \$<).B  
         cat w2f__types.f90 \$(basename \$<).w2f.f > \$@  
   
3222  # canonicalizer  # canonicalizer
3223  ad_input_code_sf.w2f.pre.f$FS90: ad_input_code_sf.w2f.f$FS90 preProcess.py  ad_input_code_sf.pre.f90 : \$(CB2M_AD_FILES)
3224          ./preProcess.py --timing --r8 -H -S \$< -o \$@          \${OPENADFORTTK_BASE}/tools/SourceProcessing/preProcess.py --timing --r8 -H -S  -o \$@ \$^
3225    
3226    # replace stop statements (to avoid the implied unstructured control flow)  with print statements
3227    ad_input_code_sf.pre.s2p.f90 : ad_input_code_sf.pre.f90
3228            cat \$< | sed -f ../OAD_support/stop2print.sed > ad_input_code_sf.pre.s2p.f90
3229    
3230  # F -> WHIRL  # F -> WHIRL
3231  # note that the canonicalized version cuts off at col 72  ad_input_code_sf.pre.s2p.B: ad_input_code_sf.pre.s2p.f90
3232  # doing this also for string constants which is ok as long          \${OPEN64ROOT}/crayf90/sgi/mfef90 -r8 -z -F ad_input_code_sf.pre.s2p.f90
 # as we are in fixed mode and cut of exactly there.  
 # Otherwise mfef90 patches in spaces to fill up to 72 (or 132)  
 # characters respectively.  
 ad_input_code_sf.w2f.pre.B: ad_input_code_sf.w2f.pre.f$FS90 mfef90  
         ./mfef90 -r8 -z -F \$<  
         mv \$<.B \$@  
3233    
3234  # WHIRL -> XAIF  # WHIRL -> XAIF
3235  ad_input_code_sf.w2f.pre.xaif : ad_input_code_sf.w2f.pre.B whirl2xaif  ad_input_code_sf.pre.s2p.xaif : ad_input_code_sf.pre.s2p.B
3236          ./whirl2xaif -s -n --debug 1 -o \$@ \$<          \${OPENADFORTTK}/bin/whirl2xaif -s -n --debug 1 -o \$@ \$<
3237    
3238  # XAIF -> XAIF'  # XAIF -> XAIF'
3239  ad_input_code_sf.w2f.pre.xb.xaif : ad_input_code_sf.w2f.pre.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd oadDriver  ad_input_code_sf.pre.s2p.xb.xaif : ad_input_code_sf.pre.s2p.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd
3240          ./oadDriver -f -t forward_step -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r          \${XAIFBOOSTERROOT}/xaifBooster/algorithms/BasicBlockPreaccumulationReverse/driver/oadDriver -f -t forward_step -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r
3241    
3242  # XAIF' -> WHIRL'  # XAIF' -> WHIRL'
3243  ad_input_code_sf.w2f.pre.xb.x2w.B : ad_input_code_sf.w2f.pre.xb.xaif xaif2whirl  ad_input_code_sf.pre.s2p.xb.x2w.B : ad_input_code_sf.pre.s2p.xb.xaif
3244          ./xaif2whirl --debug 1 ad_input_code_sf.w2f.pre.B \$<          \${OPENADFORTTK}/bin/xaif2whirl --debug 1 ad_input_code_sf.pre.s2p.B \$<
3245    
3246  # WHIRL' -> F'  # WHIRL' -> F'
3247  ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.B whirl2f whirl2f_be  ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS90: ad_input_code_sf.pre.s2p.xb.x2w.B
3248          ./whirl2f -FLIST:ftn_file=\$@ -openad \$<          \${OPEN64ROOT}/whirl2f/whirl2f -FLIST:ftn_file=\$@ -openad \$<
3249    
3250  # insert template directives  # insert template directives
3251  ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90 ../OAD_support/insertTemplateDir.bash  ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS90 ../OAD_support/insertTemplateDir.bash
3252          ../OAD_support/insertTemplateDir.bash \$< \$@          ../OAD_support/insertTemplateDir.bash \$< \$@
3253    
3254  PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F  PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F
3255  # postprocess F'  # postprocess F'
3256  postProcess.tag: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90 postProcess.py \$(PPEXTRAS:.F=.f)  postProcess.tag: ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90 \$(PPEXTRAS:.F=.f) | w2f__types.f90
3257          # the target is a placeholder to signal execution of the rule          \${OPENADFORTTK_BASE}/tools/SourceProcessing/postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed --separateOutput --pathSuffix "" --filenameSuffix "_oad" -m r -i ../OAD_support/ad_inline.f \$<
3258            # the target is a placeholder to trigger a single execution of the rule
3259          touch \$@          touch \$@
3260          # this step also creates the file postProcess.make but we cannot  # put this so make knows about the postprocessing output
3261          # name it as the target or else make will try to remake it for  OAD_intrinsics_oad.f \$(CB2M_AD_FILES:.f$FS90=_oad.f): postProcess.tag
         # the include directive above for any rule, e.g. make clean  
         ./postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed -m r -i ../OAD_support/ad_inline.f --width 4 \$<  
3262    
3263  # setup some links  # link the XAIF schema files
3264  %.xsd:  %.xsd:
3265          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .
3266    
 mfef90:  
         \$(LN) \${OPEN64ROOT}/crayf90/sgi/mfef90 .  
   
3267  # link the support files:  # link the support files:
3268  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES):  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES):
3269          \$(LN) ../OAD_support/\$@ .          \$(LN) ../OAD_support/\$@ .
3270    
3271  whirl2xaif xaif2whirl:  AD_CLEAN += *_mod.h *_mod.F90 *.FF90 *.mod-whirl temp.sed oad_cp.* postProcess.tag \$(PPEXTRAS:.F=.f)
         \$(LN) \${OPENADFORTTK}/bin/\$@ .  
   
 preProcess.py postProcess.py:  
         \$(LN) \${OPENADFORTTK_BASE}/tools/SourceProcessing/\$@ .  
   
 whirl2f whirl2f_be:  
         \$(LN) \${OPEN64ROOT}/whirl2f/\$@ .  
   
 oadDriver:  
         \$(LN) \${XAIFBOOSTERROOT}/xaifBooster/algorithms/BasicBlockPreaccumulationReverse/driver/oadDriver \$@  
   
 AD_CLEAN += *_mod.h *_mod.F90 *.FF90 *.mod-whirl temp.sed oad_cp.* postProcess.make postProcess.tag postProcess.comp \$(PPEXTRAS:.F=.f)  
3272    
3273  # ============ end OpenAD specific section ==============  # ============ end OpenAD specific section ==============
3274    
# Line 3375  printf "\n\n# DO NOT DELETE\n" >> $MAKEF Line 3313  printf "\n\n# DO NOT DELETE\n" >> $MAKEF
3313  printf "\n===  Done  ===\n"  printf "\n===  Done  ===\n"
3314    
3315  # Create special header files  # Create special header files
3316  $BASH $TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" $DISABLED_PACKAGES " " "Enabled packages:" $ENABLED_PACKAGES > $PACKAGES_DOT_H".tmp"  $BASH $TOOLSDIR/convert_cpp_cmd2defines -bPACKAGES_CONFIG_H "Disabled packages:" $DISABLED_PACKAGES " " "Enabled packages:" $ENABLED_PACKAGES > $PACKAGES_DOT_H".tmp"
3317  if test ! -f $PACKAGES_DOT_H ; then  if test ! -f $PACKAGES_DOT_H ; then
3318      mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H      mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H
3319  else  else
# Line 3389  else Line 3327  else
3327      fi      fi
3328  fi  fi
3329  if test ! -f AD_CONFIG.h ; then  if test ! -f AD_CONFIG.h ; then
3330      $BASH $TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > AD_CONFIG.h      $BASH $TOOLSDIR/convert_cpp_cmd2defines "Default version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > AD_CONFIG.h
3331  fi  fi
3332    
3333  #  Write the "state" for future records  #  Write the "state" for future records

Legend:
Removed from v.1.234  
changed lines
  Added in v.1.238

  ViewVC Help
Powered by ViewVC 1.1.22