/[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.232 by jahn, Fri Aug 10 17:59:13 2012 UTC revision 1.237 by jmc, Fri Aug 24 23:41:17 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 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 650  get_fortran_c_namemangling()  { Line 649  get_fortran_c_namemangling()  {
649    
650      #echo "FC_NAMEMANGLE = \"$FC_NAMEMANGLE\""      #echo "FC_NAMEMANGLE = \"$FC_NAMEMANGLE\""
651      if test ! "x$FC_NAMEMANGLE" = x ; then      if test ! "x$FC_NAMEMANGLE" = x ; then
652          return 0          return 0
653      fi      fi
654      echo " running: get_fortran_c_namemangling()" >> $LOGFILE      echo " running: get_fortran_c_namemangling()" >> $LOGFILE
655    
# Line 1037  check_lapack_libs()  { Line 1036  check_lapack_libs()  {
1036      echo "running: check_lapack_libs()" >> $LOGFILE      echo "running: check_lapack_libs()" >> $LOGFILE
1037      cat <<EOF > genmake_tla.F      cat <<EOF > genmake_tla.F
1038        program fgenla        program fgenla
1039        integer info        integer info
1040        integer ipiv( 2 )        integer ipiv( 2 )
1041        double precision ab( 4, 2 ), b( 2 )        double precision ab( 4, 2 ), b( 2 )
1042        data ab / 0., 0., 1., 2., 0., 2., 1., 0. /        data ab / 0., 0., 1., 2., 0., 2., 1., 0. /
# Line 1108  EOF Line 1107  EOF
1107                  LIBS="$LIBS -llapack -lf77blas -lcblas"                  LIBS="$LIBS -llapack -lf77blas -lcblas"
1108                  HAVE_LAPACK=t                  HAVE_LAPACK=t
1109                  echo "check_lapack: successful" >> $LOGFILE                  echo "check_lapack: successful" >> $LOGFILE
1110              else              else
1111              # try again with "-latlas" added to the libs              # try again with "-latlas" added to the libs
1112                  echo "==> try again with added '-llapack -lf77blas -lcblas -latlas'" > genmake_tla.log                  echo "==> try again with added '-llapack -lf77blas -lcblas -latlas'" > genmake_tla.log
1113                  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
1114                  echo " &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS \ " >> genmake_tla.log                  echo " &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS \ " >> genmake_tla.log
1115                  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
1116                  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  \
1117                      &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS >> genmake_tla.log 2>&1  \                      &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS >> genmake_tla.log 2>&1  \
1118                      &&  $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
1119                  RET_COMPILE=$?                  RET_COMPILE=$?
1120                  echo >> $LOGFILE                  echo >> $LOGFILE
1121                  cat genmake_tla.log >> $LOGFILE                  cat genmake_tla.log >> $LOGFILE
1122                  if test "x$RET_COMPILE" = x0 ; then                  if test "x$RET_COMPILE" = x0 ; then
1123                      LIBS="$LIBS -llapack -lf77blas -lcblas -latlas"                      LIBS="$LIBS -llapack -lf77blas -lcblas -latlas"
1124                      HAVE_LAPACK=t                      HAVE_LAPACK=t
1125                      echo "check_lapack: successful" >> $LOGFILE                      echo "check_lapack: successful" >> $LOGFILE
1126                  fi                  fi
1127              fi              fi
1128          fi          fi
1129      fi      fi
# Line 1207  SOURCEDIRS= Line 1206  SOURCEDIRS=
1206  INCLUDEDIRS=  INCLUDEDIRS=
1207  STANDARDDIRS="USE_THE_DEFAULT"  STANDARDDIRS="USE_THE_DEFAULT"
1208    
1209    #- local config file
1210    gm_local="genmake_local"
1211    
1212  G2ARGS=  G2ARGS=
1213  BASH=  BASH=
1214  PWD=`pwd`  PWD=`pwd`
# Line 1278  LOGFILE="genmake.log" Line 1280  LOGFILE="genmake.log"
1280  rm -f genmake_state genmake_*optfile $LOGFILE  rm -f genmake_state genmake_*optfile $LOGFILE
1281    
1282  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  
1283    
1284  #echo "$0::$1:$2:$3:$4:$5:$6:$7:"  #echo "$0::$1:$2:$3:$4:$5:$6:$7:"
1285  #parse_options  #parse_options
# Line 1306  for ac_option in "$@" ; do Line 1298  for ac_option in "$@" ; do
1298      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
1299    
1300      case $ac_option in      case $ac_option in
1301            
1302          -help | --help | -h | --h)          -help | --help | -h | --h)
1303              usage ;;              usage ;;
1304            
1305          -nooptfile | --nooptfile)          -nooptfile | --nooptfile)
1306              OPTFILE="NONE" ;;              OPTFILE="NONE" ;;
1307          -optfile | --optfile | -of | --of)          -optfile | --optfile | -of | --of)
1308              ac_prev=OPTFILE ;;              ac_prev=OPTFILE ;;
1309          -optfile=* | --optfile=* | -of=* | --of=*)          -optfile=* | --optfile=* | -of=* | --of=*)
1310              OPTFILE=$ac_optarg ;;              OPTFILE=$ac_optarg ;;
1311            
1312          -adoptfile | --adoptfile | -adof | --adof)          -adoptfile | --adoptfile | -adof | --adof)
1313              ac_prev=AD_OPTFILE ;;              ac_prev=AD_OPTFILE ;;
1314          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)
1315              AD_OPTFILE=$ac_optarg ;;              AD_OPTFILE=$ac_optarg ;;
1316            
1317          -pdepend | --pdepend)          -pdepend | --pdepend)
1318              ac_prev=PKG_DEPEND ;;              ac_prev=PKG_DEPEND ;;
1319          -pdepend=* | --pdepend=*)          -pdepend=* | --pdepend=*)
1320              PKG_DEPEND=$ac_optarg ;;              PKG_DEPEND=$ac_optarg ;;
1321            
1322          -pgroups | --pgroups)          -pgroups | --pgroups)
1323              ac_prev=PKG_GROUPS ;;              ac_prev=PKG_GROUPS ;;
1324          -pgroups=* | --pgroups=*)          -pgroups=* | --pgroups=*)
1325              PKG_GROUPS=$ac_optarg ;;              PKG_GROUPS=$ac_optarg ;;
1326            
1327          -make | --make | -m | --m)          -make | --make | -m | --m)
1328              ac_prev=MAKE ;;              ac_prev=MAKE ;;
1329          -make=* | --make=* | -m=* | --m=*)          -make=* | --make=* | -m=* | --m=*)
1330              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
1331            
1332          -bash | --bash)          -bash | --bash)
1333              ac_prev=BASH ;;              ac_prev=BASH ;;
1334          -bash=* | --bash=*)          -bash=* | --bash=*)
1335              BASH=$ac_optarg ;;              BASH=$ac_optarg ;;
1336            
1337          -makedepend | --makedepend | -md | --md)          -makedepend | --makedepend | -md | --md)
1338              ac_prev=MAKEDEPEND ;;              ac_prev=MAKEDEPEND ;;
1339          -makedepend=* | --makedepend=* | -md=* | --md=*)          -makedepend=* | --makedepend=* | -md=* | --md=*)
1340              MAKEDEPEND=$ac_optarg ;;              MAKEDEPEND=$ac_optarg ;;
1341            
1342          -makefile | --makefile | -ma | --ma)          -makefile | --makefile | -mf | --mf)
1343              ac_prev=MAKEFILE ;;              ac_prev=MAKEFILE ;;
1344          -makefile=* | --makefile=* | -ma=* | --ma=*)          -makefile=* | --makefile=* | -mf=* | --mf=*)
1345              MAKEFILE=$ac_optarg ;;              MAKEFILE=$ac_optarg ;;
1346            
1347          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)
1348              echo "ERROR: The platform option has been removed.  Please specify"              echo "ERROR: The platform option has been removed.  Please specify"
1349              echo "  the build options using the \"optfile\" mechanism."              echo "  the build options using the \"optfile\" mechanism."
1350              echo              echo
1351              usage              usage
1352              ;;              ;;
1353            
1354          -rootdir | --rootdir | -rd | --rd)          -rootdir | --rootdir | -rd | --rd)
1355              ac_prev=ROOTDIR ;;              ac_prev=ROOTDIR ;;
1356          -rootdir=* | --rootdir=* | -rd=* | --rd=*)          -rootdir=* | --rootdir=* | -rd=* | --rd=*)
1357              ROOTDIR=$ac_optarg ;;              ROOTDIR=$ac_optarg ;;
1358            
1359          -mods | --mods | -mo | --mo)          -mods | --mods | -mo | --mo)
1360              ac_prev=MODS ;;              ac_prev=MODS ;;
1361          -mods=* | --mods=* | -mo=* | --mo=*)          -mods=* | --mods=* | -mo=* | --mo=*)
1362              MODS=$ac_optarg ;;              MODS=$ac_optarg ;;
1363            
1364          -disable | --disable)          -disable | --disable)
1365              ac_prev=DISABLE ;;              ac_prev=DISABLE ;;
1366          -disable=* | --disable=*)          -disable=* | --disable=*)
1367              DISABLE=$ac_optarg ;;              DISABLE=$ac_optarg ;;
1368            
1369          -enable | --enable)          -enable | --enable)
1370              ac_prev=ENABLE ;;              ac_prev=ENABLE ;;
1371          -enable=* | --enable=*)          -enable=* | --enable=*)
1372              ENABLE=$ac_optarg ;;              ENABLE=$ac_optarg ;;
1373            
1374          -standarddirs | --standarddirs)          -standarddirs | --standarddirs)
1375              ac_prev=STANDARDDIRS ;;              ac_prev=STANDARDDIRS ;;
1376          -standarddirs=* | --standarddirs=*)          -standarddirs=* | --standarddirs=*)
# Line 1388  for ac_option in "$@" ; do Line 1380  for ac_option in "$@" ; do
1380  #               ac_prev=cpp ;;  #               ac_prev=cpp ;;
1381  #           -cpp=* | --cpp=*)  #           -cpp=* | --cpp=*)
1382  #               CPP=$ac_optarg ;;  #               CPP=$ac_optarg ;;
1383            
1384          -cc | --cc)          -cc | --cc)
1385              ac_prev=CC ;;              ac_prev=CC ;;
1386          -cc=* | --cc=*)          -cc=* | --cc=*)
1387              CC=$ac_optarg ;;              CC=$ac_optarg ;;
1388            
1389          -fortran | --fortran | -fc | --fc)          -fortran | --fortran | -fc | --fc)
1390              ac_prev=FC ;;              ac_prev=FC ;;
1391          -fc=* | --fc=*)          -fc=* | --fc=*)
1392              FC=$ac_optarg ;;              FC=$ac_optarg ;;
1393            
1394          -fs | --fs)          -fs | --fs)
1395              ac_prev=FS ;;              ac_prev=FS ;;
1396          -fs=* | --fs=*)          -fs=* | --fs=*)
1397              FS=$ac_optarg ;;              FS=$ac_optarg ;;
1398            
1399          -fs90 | --fs90)          -fs90 | --fs90)
1400              ac_prev=FS90 ;;              ac_prev=FS90 ;;
1401          -fs90=* | --fs90=*)          -fs90=* | --fs90=*)
1402              FS90=$ac_optarg ;;              FS90=$ac_optarg ;;
1403            
1404          -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 )          -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 )
1405              USE_R4=true ;;              USE_R4=true ;;
1406    
# Line 1416  for ac_option in "$@" ; do Line 1408  for ac_option in "$@" ; do
1408              IEEE=true ;;              IEEE=true ;;
1409          -noieee | --noieee)          -noieee | --noieee)
1410              echo "Warning: ignore option '$ac_option' (default is already without '-ieee')" ;;              echo "Warning: ignore option '$ac_option' (default is already without '-ieee')" ;;
1411          -devel | --devel)          -devel | --devel)
1412              IEEE=true ; DEVEL=true ;;              IEEE=true ; DEVEL=true ;;
1413          -gsl | --gsl)          -gsl | --gsl)
1414              GSL=true ;;              GSL=true ;;
1415    
1416          -ts | --ts)          -ts | --ts)
# Line 1441  for ac_option in "$@" ; do Line 1433  for ac_option in "$@" ; do
1433          -mpi=* | --mpi=*)          -mpi=* | --mpi=*)
1434              MPIPATH=$ac_optarg              MPIPATH=$ac_optarg
1435              MPI=true ;;              MPI=true ;;
1436            
1437          -omp | --omp)          -omp | --omp)
1438              OMP=true ;;              OMP=true ;;
1439          -omp=* | --omp=*)          -omp=* | --omp=*)
1440              OMPFLAG=$ac_optarg              OMPFLAG=$ac_optarg
1441              OMP=true ;;              OMP=true ;;
1442            
1443          -ds | --ds)          -ds | --ds)
1444              DUMPSTATE=t ;;              DUMPSTATE=t ;;
1445            
1446          -extra_flag | --extra_flag)          -extra_flag | --extra_flag)
1447              ac_prev=FEXTRAFLAGS ;;              ac_prev=FEXTRAFLAGS ;;
1448          -extra_flag=* | --extra_flag=*)          -extra_flag=* | --extra_flag=*)
1449              FEXTRAFLAGS=$ac_optarg ;;              FEXTRAFLAGS=$ac_optarg ;;
1450            
1451          -taf_extra | --taf_extra)          -taf_extra | --taf_extra)
1452              ac_prev=TAF_EXTRA ;;              ac_prev=TAF_EXTRA ;;
1453          -taf_extra=* | --taf_extra=*)          -taf_extra=* | --taf_extra=*)
# Line 1465  for ac_option in "$@" ; do Line 1457  for ac_option in "$@" ; do
1457              ac_prev=TAMC_EXTRA ;;              ac_prev=TAMC_EXTRA ;;
1458          -tamc_extra=* | --tamc_extra=*)          -tamc_extra=* | --tamc_extra=*)
1459              TAMC_EXTRA=$ac_optarg ;;              TAMC_EXTRA=$ac_optarg ;;
1460            
1461          -ignoretime | -ignore_time | --ignoretime | --ignore_time)          -ignoretime | -ignore_time | --ignoretime | --ignore_time)
1462              IGNORE_TIME="-DIGNORE_TIME" ;;              IGNORE_TIME="-DIGNORE_TIME" ;;
1463    
# Line 1476  for ac_option in "$@" ; do Line 1468  for ac_option in "$@" ; do
1468              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
1469              usage              usage
1470              ;;              ;;
1471            
1472          *)          *)
1473              echo "Error: unrecognized argument: "$ac_option              echo "Error: unrecognized argument: "$ac_option
1474              usage              usage
1475              ;;              ;;
1476            
1477      esac      esac
1478    
1479  done  done
1480    
1481    printf "  getting local config information:  "
1482    if test -f $gm_local ; then
1483        echo "using $gm_local"
1484        . $gm_local
1485    else
1486        echo "none found"
1487    fi
1488    
1489  if test -f ./.genmakerc ; then  if test -f ./.genmakerc ; then
1490      echo      echo
1491      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 1714  fi
1714  if test ! "x$TS" = x ; then  if test ! "x$TS" = x ; then
1715        echo "  Turning on timing per timestep"        echo "  Turning on timing per timestep"
1716        if test ! "x$FOOLAD" = x ; then        if test ! "x$FOOLAD" = x ; then
1717              DEFINES="$DEFINES -DTIME_PER_TIMESTEP_SFP"              DEFINES="$DEFINES -DTIME_PER_TIMESTEP_SFP"
1718        else        else
1719              DEFINES="$DEFINES -DTIME_PER_TIMESTEP"              DEFINES="$DEFINES -DTIME_PER_TIMESTEP"
1720        fi        fi
# Line 1750  if test ! "x$PAPI" = x ; then Line 1750  if test ! "x$PAPI" = x ; then
1750            echo "  Sticking with PAPI flop summary per timestep!"            echo "  Sticking with PAPI flop summary per timestep!"
1751        else        else
1752            echo "  Turning on performance analysis with PAPI"            echo "  Turning on performance analysis with PAPI"
1753            echo "  Please make sure PAPIINC, PAPILIB are defined"            echo "  Please make sure PAPIINC, PAPILIB are defined"
1754            DEFINES="$DEFINES -DUSE_PAPI"            DEFINES="$DEFINES -DUSE_PAPI"
1755            INCLUDES="$INCLUDES $PAPIINC"            INCLUDES="$INCLUDES $PAPIINC"
1756            LIBS="$LIBS $PAPILIB"            LIBS="$LIBS $PAPILIB"
# Line 1762  if test ! "x$PCL" = x ; then Line 1762  if test ! "x$PCL" = x ; then
1762            echo "  Sticking with PCL flop summary per timestep!"            echo "  Sticking with PCL flop summary per timestep!"
1763        else        else
1764            echo "  Turning on performance analysis with PCL"            echo "  Turning on performance analysis with PCL"
1765            echo "  Please make sure PCLINC, PCLLIB are defined"            echo "  Please make sure PCLINC, PCLLIB are defined"
1766            DEFINES="$DEFINES -DUSE_PCL"            DEFINES="$DEFINES -DUSE_PCL"
1767            INCLUDES="$INCLUDES $PCLINC"            INCLUDES="$INCLUDES $PCLINC"
1768            LIBS="$LIBS $PCLLIB"            LIBS="$LIBS $PCLLIB"
# Line 1772  if test ! "x$HPMT" = x ; then Line 1772  if test ! "x$HPMT" = x ; then
1772        if test ! "x$PAPI" = x ; then        if test ! "x$PAPI" = x ; then
1773            echo "  PAPI and the HPM Toolkit cannot co-exist!"            echo "  PAPI and the HPM Toolkit cannot co-exist!"
1774            echo "  Sticking with PAPI!"            echo "  Sticking with PAPI!"
1775        else if test ! "x$PCL" = x ; then        else
1776            if test ! "x$PCL" = x ; then
1777            echo "  PCL and the HPM Toolkit cannot co-exist!"            echo "  PCL and the HPM Toolkit cannot co-exist!"
1778            echo "  Sticking with PCL!"            echo "  Sticking with PCL!"
1779        else          else
1780            echo "  Turning on performance analysis with the HPM Toolkit"            echo "  Turning on performance analysis with the HPM Toolkit"
1781            echo "  Please make sure HPMTINC, HPMTLIB are defined"            echo "  Please make sure HPMTINC, HPMTLIB are defined"
1782            DEFINES="$DEFINES -DUSE_LIBHPM"            DEFINES="$DEFINES -DUSE_LIBHPM"
1783            INCLUDES="$INCLUDES $HPMTINC"            INCLUDES="$INCLUDES $HPMTINC"
1784            LIBS="$LIBS $HPMTLIB"            LIBS="$LIBS $HPMTLIB"
1785        fi          fi
1786        fi        fi
1787  fi  fi
1788  if test ! "x$GSL" = x ; then  if test ! "x$GSL" = x ; then
# Line 2106  else Line 2107  else
2107          exit 1          exit 1
2108      else      else
2109          echo "    using PKG_LIST=\"$PKG_LIST\""          echo "    using PKG_LIST=\"$PKG_LIST\""
2110          #  Strip the comments and add all the names          #  Strip the comments and add all the names
2111          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}'`
2112          RETVAL=$?          RETVAL=$?
2113          if test "x${RETVAL}" != x0 ; then          if test "x${RETVAL}" != x0 ; then
# Line 2156  for i in $PACKAGES ; do Line 2157  for i in $PACKAGES ; do
2157      j=`echo $i | sed 's/[-+]//'`      j=`echo $i | sed 's/[-+]//'`
2158      if test ! -d "$ROOTDIR/pkg/$j" ; then      if test ! -d "$ROOTDIR/pkg/$j" ; then
2159          echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'"          echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'"
2160          exit 1          exit 1
2161      fi      fi
2162      echo $i >> ./.tmp_pack      echo $i >> ./.tmp_pack
2163  done  done
# Line 2201  else Line 2202  else
2202          echo "Error: problem encountered while building source files in pkg/mnc:"          echo "Error: problem encountered while building source files in pkg/mnc:"
2203          cat make_mnc.errors 1>&2          cat make_mnc.errors 1>&2
2204          if test "x$mnc_in" = x0 ; then          if test "x$mnc_in" = x0 ; then
2205              exit 1              exit 1
2206          else          else
2207              DISABLE="$DISABLE mnc"              DISABLE="$DISABLE mnc"
2208          fi          fi
# Line 2300  if  test "x${PKG_DEPEND}" != x ; then Line 2301  if  test "x${PKG_DEPEND}" != x ; then
2301    
2302          #  Do we need to add $dname according to the dependency rules?          #  Do we need to add $dname according to the dependency rules?
2303          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
2304              #echo "   " $pname ": need to add :" $dname              #echo "   " $pname ": need to add :" $dname
2305              in_dis="f"              in_dis="f"
2306              for dis in $DISABLE ; do              for dis in $DISABLE ; do
2307                  if test "x$dis" = "x$dname" ; then                  if test "x$dis" = "x$dname" ; then
# Line 2325  if  test "x${PKG_DEPEND}" != x ; then Line 2326  if  test "x${PKG_DEPEND}" != x ; then
2326              echo "  the dependency rules for \"$dname\""              echo "  the dependency rules for \"$dname\""
2327              exit 1              exit 1
2328          fi          fi
2329          i=`echo "$i + 1" | bc -l`          i=`echo "$i + 1" | bc -l`
2330          #i=$(( $i + 1 ))          #i=$(( $i + 1 ))
2331      done      done
2332      ck=$ck"t"      ck=$ck"t"
# Line 2366  for n in $names ; do Line 2367  for n in $names ; do
2367          done          done
2368          if test "x$has_pack" = xf ; then          if test "x$has_pack" = xf ; then
2369              undef=`echo "ALLOW_$n" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`              undef=`echo "ALLOW_$n" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2370              DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"              DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"
2371          fi          fi
2372      fi      fi
2373  done  done
# Line 2379  for i in $PACKAGES ; do Line 2380  for i in $PACKAGES ; do
2380  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!
2381      case $i in      case $i in
2382          aim_v23)          aim_v23)
2383              ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM"              ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM"
2384              echo "Warning: ALLOW_AIM is set to enable aim_v23."              echo "Warning: ALLOW_AIM is set to enable aim_v23."
2385              ;;              ;;
2386      esac      esac
# Line 2421  for i in $spaths ; do Line 2422  for i in $spaths ; do
2422      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
2423          echo "    found CPP_OPTIONS=\"$try\""          echo "    found CPP_OPTIONS=\"$try\""
2424          CPP_OPTIONS="$try"          CPP_OPTIONS="$try"
2425          # 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
2426          for n in $names ; do          for n in $names ; do
2427              test_for_package_in_cpp_options $CPP_OPTIONS $n              test_for_package_in_cpp_options $CPP_OPTIONS $n
2428          done          done
2429      fi      fi
2430      try="$i/CPP_EEOPTIONS.h"      try="$i/CPP_EEOPTIONS.h"
2431      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
2432          echo "    found CPP_EEOPTIONS=\"$try\""          echo "    found CPP_EEOPTIONS=\"$try\""
2433          # 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
2434  #**** not yet enabled ****  #**** not yet enabled ****
2435  #        test_for_mpi_in_cpp_eeoptions $try  #        test_for_mpi_in_cpp_eeoptions $try
2436  #**** not yet enabled ****  #**** not yet enabled ****
# Line 2575  for d in $alldirs ; do Line 2576  for d in $alldirs ; do
2576          if test ! -r ".links.tmp/$sf" ; then          if test ! -r ".links.tmp/$sf" ; then
2577              if test -f "$d/$sf" ; then              if test -f "$d/$sf" ; then
2578                  ignore_f=f                  ignore_f=f
2579                  case $d/$sf in                  case $d/$sf in
2580                    ./$PACKAGES_DOT_H)                    ./$PACKAGES_DOT_H)
2581                          ignore_f=t                          ignore_f=t
2582                          ;;                          ;;
2583                    ./AD_CONFIG.h)                    ./AD_CONFIG.h)
2584                          ignore_f=t                          ignore_f=t
2585                          ;;                          ;;
2586                    ./FC_NAMEMANGLE.h)                    ./FC_NAMEMANGLE.h)
2587                          ignore_f=t                          ignore_f=t
2588                          ;;                          ;;
2589                    ./BUILD_INFO.h)                    ./BUILD_INFO.h)
2590                          ignore_f=t                          ignore_f=t
2591                          ;;                          ;;
2592                    ./EMBEDDED_FILES.h)                    ./EMBEDDED_FILES.h)
2593                          ignore_f=t                          ignore_f=t
2594                          ;;                          ;;
2595                    *)                    *)
2596                          #  For the local directory *ONLY*,                          #  For the local directory *ONLY*,
2597                          #  ignore all soft-links                          #  ignore all soft-links
2598                          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 2602  for d in $alldirs ; do
2602                              deplist="$deplist $sf"                              deplist="$deplist $sf"
2603                          fi                          fi
2604                          ;;                          ;;
2605                  esac                  esac
2606                  if test "x$ignore_f" = xf ; then                  if test "x$ignore_f" = xf ; then
2607                      extn=`echo $sf | $AWK -F. '{print $NF}'`                      extn=`echo $sf | $AWK -F. '{print $NF}'`
2608                      case $extn in                      case $extn in
# Line 2648  for d in $alldirs ; do Line 2649  for d in $alldirs ; do
2649                          echo    " \\"  >> hsrclist.tmp                          echo    " \\"  >> hsrclist.tmp
2650                          printf " $sf" >> hsrclist.tmp                          printf " $sf" >> hsrclist.tmp
2651                          ;;                          ;;
2652                      flow)                      flow)
2653                          echo    " \\"  >> ad_flow_files.tmp                          echo    " \\"  >> ad_flow_files.tmp
2654                          printf " $sf" >> ad_flow_files.tmp                          printf " $sf" >> ad_flow_files.tmp
2655                          ;;                          ;;
# Line 2659  for d in $alldirs ; do Line 2660  for d in $alldirs ; do
2660      done      done
2661      if test "x$deplist" != x ; then      if test "x$deplist" != x ; then
2662        if test "$d" != "." ; then        if test "$d" != "." ; then
2663          echo "" >> srclinks.tmp          echo "" >> srclinks.tmp
2664          echo "#  These files are linked from $d" >> srclinks.tmp          echo "#  These files are linked from $d" >> srclinks.tmp
2665          echo "$deplist :" >> srclinks.tmp          echo "$deplist :" >> srclinks.tmp
2666  # 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 2681  echo "" >> ad_flow_files.tmp
2681  CMDLINE=$0  CMDLINE=$0
2682  for xx in "$@" ; do nw=`echo $xx | wc -w`  for xx in "$@" ; do nw=`echo $xx | wc -w`
2683      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"
2684                          else CMDLINE="$CMDLINE '$xx'" ; fi                          else CMDLINE="$CMDLINE '$xx'" ; fi
2685  done  done
2686    
2687  if test -f $MAKEFILE ; then  if test -f $MAKEFILE ; then
# Line 2813  echo >> $MAKEFILE Line 2814  echo >> $MAKEFILE
2814  echo 'F77_PP_SRC_FILES = $(F77_SRC_FILES:.F=.'$FS')'      >> $MAKEFILE  echo 'F77_PP_SRC_FILES = $(F77_SRC_FILES:.F=.'$FS')'      >> $MAKEFILE
2815  echo 'F90_PP_SRC_FILES = $(F90_SRC_FILES:.F90=.'$FS90')' >> $MAKEFILE  echo 'F90_PP_SRC_FILES = $(F90_SRC_FILES:.F90=.'$FS90')' >> $MAKEFILE
2816  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
2817  echo 'FLOFILES =  $(AD_FLOW_FILES:.flow=.flowdir)' >> $MAKEFILE  echo 'FLOWFILES =  $(AD_FLOW_FILES:.flow=.flowdir)' >> $MAKEFILE
2818  echo >> $MAKEFILE  echo >> $MAKEFILE
2819  echo '.SUFFIXES:' >> $MAKEFILE  echo '.SUFFIXES:' >> $MAKEFILE
2820  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
# Line 2859  Clean: Line 2860  Clean:
2860          @make -f \$(MAKEFILE) clean          @make -f \$(MAKEFILE) clean
2861          @make -f \$(MAKEFILE) cleanlinks          @make -f \$(MAKEFILE) cleanlinks
2862          -rm -f \$(SPECIAL_FILES) f90mkdepend.log $MAKEFILE.old          -rm -f \$(SPECIAL_FILES) f90mkdepend.log $MAKEFILE.old
2863          -rm -f taf_command taf_output taf_ad.log taf_ad_flow.log          -rm -f taf_command taf_output taf_ad.log taf_ad_flow.log taf_ftl.log
2864          -rm -f genmake_warnings genmake_errors make.log          -rm -f genmake_warnings genmake_errors make.log
2865    
2866  # remove also the executable, files that "genmake2" generates (except Makefile)  # remove also the executable, files that "genmake2" generates (except Makefile)
2867  #         and output from a run (plus log files from testreport)  #         and output from a run (plus log files from testreport)
2868  CLEAN:  CLEAN:
2869          @make -f \$(MAKEFILE) Clean          @make -f \$(MAKEFILE) Clean
2870          -rm -f \$(EXECUTABLE) \$(EXE_AD) *.bak          -rm -f \$(EXECUTABLE) \$(EXE_AD) \$(EXE_FTL) *.bak
2871          -rm -f $LOGFILE genmake_state genmake_*optfile          -rm -f $LOGFILE genmake_state genmake_*optfile
2872          -rm -f SIZE.h.mpi genmake.tr_log make.tr_log          -rm -f SIZE.h.mpi genmake.tr_log make.tr_log
2873          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
# Line 3005  ad_input_code.$FS: \$(AD_FILES) \$(H_SRC Line 3006  ad_input_code.$FS: \$(AD_FILES) \$(H_SRC
3006          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
3007          -rm -f ad_config.template          -rm -f ad_config.template
3008          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3009          @make -f \$(MAKEFILE) \$(FLOFILES)          @make -f \$(MAKEFILE) \$(FLOWFILES)
3010          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
3011    
3012  ad_taf_output.$FS: ad_input_code.$FS  ad_taf_output.$FS: ad_input_code.$FS
3013          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS
# Line 3037  adtrick: Line 3038  adtrick:
3038  adobj: ad_taf_output.o \$(OBJFILES)  adobj: ad_taf_output.o \$(OBJFILES)
3039    
3040  # ... FTL ...  # ... FTL ...
3041  ftlall: ftl_taf  ftlall: \$(EXE_FTL)
3042  ftltaf: ftl_taf_output.$FS  ftltaf: ftl_taf_output.$FS
3043  ftltamc: ftl_tamc_output.$FS  ftltamc: ftl_tamc_output.$FS
3044    
# Line 3047  ftl_input_code.$FS: \$(AD_FILES) \$(H_SR Line 3048  ftl_input_code.$FS: \$(AD_FILES) \$(H_SR
3048          -rm -f ftl_config.template          -rm -f ftl_config.template
3049          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3050          @make -f \$(MAKEFILE) \$(AD_FLOW_FILES)          @make -f \$(MAKEFILE) \$(AD_FLOW_FILES)
3051          cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.$FS          cat \$(AD_FLOW_FILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ftl_input_code.$FS
3052    
3053  ftl_taf_output.$FS: ftl_input_code.$FS  ftl_taf_output.$FS: ftl_input_code.$FS
3054          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS
# Line 3059  ftltafonly: Line 3060  ftltafonly:
3060          ls -l ftl_input_code_ftl.$FS          ls -l ftl_input_code_ftl.$FS
3061          cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS          cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS
3062    
3063  ftl_taf: ftl_taf_output.o \$(OBJFILES)  \${EXE_FTL}: ftl_taf_output.o \$(OBJFILES)
3064          \$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS)          \$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS)
3065    
3066  ftl_tamc_output.$FS: ftl_input_code.$FS  ftl_tamc_output.$FS: ftl_input_code.$FS
3067          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS
# Line 3191  f95_test.out: f95_test_mods.f90 f95_test Line 3192  f95_test.out: f95_test_mods.f90 f95_test
3192          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
3193          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
3194    
3195  # 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  
3196    
3197  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)
3198    
3199  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)
3200    
3201  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)  
3202          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(AD_OBJ_FILES_S2) \$(LIBS)          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(AD_OBJ_FILES_S2) \$(LIBS)
 else  
         touch \$@  
 endif  
3203    
3204  # makefile debug rule  # create sources files modules from header files containing common blocks
 openad: ad_input_code.w2f.pre.xb.x2w.w2f.td.pp.f$FS90  
 .PHONY: openad  
   
 # create the module files  
3205  %_mod.FF90 : %.h ../OAD_support/cb2mGetModules.csh ../OAD_support/cb2mGetModules.awk  %_mod.FF90 : %.h ../OAD_support/cb2mGetModules.csh ../OAD_support/cb2mGetModules.awk
3206          ../OAD_support/cb2mGetModules.csh $< ../OAD_support/cb2mGetModules.awk          ../OAD_support/cb2mGetModules.csh $< ../OAD_support/cb2mGetModules.awk
3207    
3208  # create the header files  # create new header files with USE statements for the new modules made above
3209  %_mod.h : %.h ../OAD_support/cb2mGetHeaders.csh ../OAD_support/cb2mGetHeaders.awk  %_mod.h : %.h ../OAD_support/cb2mGetHeaders.csh ../OAD_support/cb2mGetHeaders.awk
3210          ../OAD_support/cb2mGetHeaders.csh $< ../OAD_support/cb2mGetHeaders.awk \$(CB2M_F90_SRC_NAMES)          ../OAD_support/cb2mGetHeaders.csh $< ../OAD_support/cb2mGetHeaders.awk \$(CB2M_F90_SRC_NAMES)
3211    
3212  # 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
3213  %_cb2m.FF90 : %.F ../OAD_support/cb2mUseModules.bash  %_cb2m.FF90 : %.F ../OAD_support/cb2mUseModules.bash
3214          ../OAD_support/cb2mUseModules.bash $< ${MPI}          ../OAD_support/cb2mUseModules.bash $< ${MPI}
3215    
# Line 3244  ad_output.txt: \$(EXE_AD) Line 3224  ad_output.txt: \$(EXE_AD)
3224          @printf 'running ... '          @printf 'running ... '
3225          @./\$(EXE_AD) > \$@          @./\$(EXE_AD) > \$@
3226    
 CB2M_AD_FILES=\$(AD_FILES:.f=_cb2m.f$FS90)  
3227  ad_input_code.f$FS90:  \$(CB2M_AD_FILES)  ad_input_code.f$FS90:  \$(CB2M_AD_FILES)
3228          cat \$^ > \$@          cat \$^ > \$@
3229    
 # 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 > \$@  
   
3230  # canonicalizer  # canonicalizer
3231  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)
3232          ./preProcess.py --timing --r8 -H -S \$< -o \$@          \${OPENADFORTTK_BASE}/tools/SourceProcessing/preProcess.py --timing --r8 -H -S  -o \$@ \$^
3233    
3234    # replace stop statements (to avoid the implied unstructured control flow)  with print statements
3235    ad_input_code_sf.pre.s2p.f90 : ad_input_code_sf.pre.f90
3236            cat \$< | sed -f ../OAD_support/stop2print.sed > ad_input_code_sf.pre.s2p.f90
3237    
3238  # F -> WHIRL  # F -> WHIRL
3239  # note that the canonicalized version cuts off at col 72  ad_input_code_sf.pre.s2p.B: ad_input_code_sf.pre.s2p.f90
3240  # 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 \$@  
3241    
3242  # WHIRL -> XAIF  # WHIRL -> XAIF
3243  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
3244          ./whirl2xaif -s -n --debug 1 -o \$@ \$<          \${OPENADFORTTK}/bin/whirl2xaif -s -n --debug 1 -o \$@ \$<
3245    
3246  # XAIF -> XAIF'  # XAIF -> XAIF'
3247  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
3248          ./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
3249    
3250  # XAIF' -> WHIRL'  # XAIF' -> WHIRL'
3251  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
3252          ./xaif2whirl --debug 1 ad_input_code_sf.w2f.pre.B \$<          \${OPENADFORTTK}/bin/xaif2whirl --debug 1 ad_input_code_sf.pre.s2p.B \$<
3253    
3254  # WHIRL' -> F'  # WHIRL' -> F'
3255  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
3256          ./whirl2f -FLIST:ftn_file=\$@ -openad \$<          \${OPEN64ROOT}/whirl2f/whirl2f -FLIST:ftn_file=\$@ -openad \$<
3257    
3258  # insert template directives  # insert template directives
3259  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
3260          ../OAD_support/insertTemplateDir.bash \$< \$@          ../OAD_support/insertTemplateDir.bash \$< \$@
3261    
3262  PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F  PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F
3263  # postprocess F'  # postprocess F'
3264  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
3265          # 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 \$<
3266            # the target is a placeholder to trigger a single execution of the rule
3267          touch \$@          touch \$@
3268          # this step also creates the file postProcess.make but we cannot  # put this so make knows about the postprocessing output
3269          # 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 \$<  
3270    
3271  # setup some links  # link the XAIF schema files
3272  %.xsd:  %.xsd:
3273          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .
3274    
 mfef90:  
         \$(LN) \${OPEN64ROOT}/crayf90/sgi/mfef90 .  
   
3275  # link the support files:  # link the support files:
3276  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES):  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES):
3277          \$(LN) ../OAD_support/\$@ .          \$(LN) ../OAD_support/\$@ .
3278    
3279  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)  
3280    
3281  # ============ end OpenAD specific section ==============  # ============ end OpenAD specific section ==============
3282    

Legend:
Removed from v.1.232  
changed lines
  Added in v.1.237

  ViewVC Help
Powered by ViewVC 1.1.22