/[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.228 by jmc, Tue Jan 17 22:55:39 2012 UTC revision 1.236 by jmc, Fri Aug 24 23:07:27 2012 UTC
# 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 384  EOF Line 383  EOF
383        stop        stop
384        end        end
385  EOF  EOF
386          makedepend genmake_tc.f > /dev/null 2>&1          makedepend -f $MAKEFILE genmake_tc.f > /dev/null 2>&1
387          RV1=$?          RV1=$?
388          test -f $MAKEFILE  &&  rm -f $MAKEFILE          test -f $MAKEFILE  &&  rm -f $MAKEFILE
389          test -f $MAKEFILE".tst"  &&  mv -f $MAKEFILE".tst" $MAKEFILE          test -f $MAKEFILE".tst"  &&  mv -f $MAKEFILE".tst" $MAKEFILE
# Line 450  build_embed_encode() Line 449  build_embed_encode()
449              RETVAL=$?              RETVAL=$?
450              if test "x$RETVAL" = x0 ; then              if test "x$RETVAL" = x0 ; then
451                  echo "OK"                  echo "OK"
                 DEFINES="$DEFINES -DHAVE_EMBED_SRC"  
452                  return 0                  return 0
453              fi              fi
454          done          done
# Line 462  build_embed_encode() Line 460  build_embed_encode()
460          return 1          return 1
461      fi      fi
462      echo "OK"      echo "OK"
     DEFINES="$DEFINES -DHAVE_EMBED_SRC"  
463  }  }
464    
465  #  look for possible C compilers  #  look for possible C compilers
# Line 580  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 652  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 784  EOF Line 781  EOF
781      RETVAL=$?      RETVAL=$?
782      if test "x$RETVAL" = x0 ; then      if test "x$RETVAL" = x0 ; then
783          HAVE_CLOC=t          HAVE_CLOC=t
         DEFINES="$DEFINES -DHAVE_CLOC"  
784      fi      fi
785      rm -f genmake_tc*      rm -f genmake_tc*
786      echo " --> set HAVE_CLOC='$HAVE_CLOC'" >> $LOGFILE      echo " --> set HAVE_CLOC='$HAVE_CLOC'" >> $LOGFILE
# Line 846  EOF Line 842  EOF
842      RETVAL=$?      RETVAL=$?
843      if test "x$RETVAL" = x0 ; then      if test "x$RETVAL" = x0 ; then
844          HAVE_SIGREG=t          HAVE_SIGREG=t
         DEFINES="$DEFINES -DHAVE_SIGREG"  
845      fi      fi
846      rm -f genmake_tc*      rm -f genmake_tc*
847      echo " --> set HAVE_SIGREG='$HAVE_SIGREG'" >> $LOGFILE      echo " --> set HAVE_SIGREG='$HAVE_SIGREG'" >> $LOGFILE
848  }  }
849    
850  check_HAVE_SETRLSTK()  {  check_HAVE_SETRLSTK()  {
     if test "x$HAVE_SETRLSTK" = xt ; then  
         DEFINES="$DEFINES -DHAVE_SETRLSTK"  
         return  
     fi    
851      if test ! "x$HAVE_SETRLSTK" = x ; then      if test ! "x$HAVE_SETRLSTK" = x ; then
852          return          return
853      fi      fi
# Line 894  EOF Line 885  EOF
885      RETVAL=$?      RETVAL=$?
886      if test "x$RETVAL" = x0 ; then      if test "x$RETVAL" = x0 ; then
887          HAVE_SETRLSTK=t          HAVE_SETRLSTK=t
         DEFINES="$DEFINES -DHAVE_SETRLSTK"  
888      fi      fi
889      rm -f genmake_tc*      rm -f genmake_tc*
890      echo " --> set HAVE_SETRLSTK='$HAVE_SETRLSTK'" >> $LOGFILE      echo " --> set HAVE_SETRLSTK='$HAVE_SETRLSTK'" >> $LOGFILE
# Line 941  EOF Line 931  EOF
931      RETVAL=$?      RETVAL=$?
932      if test "x$RETVAL" = x0 ; then      if test "x$RETVAL" = x0 ; then
933          HAVE_STAT=t          HAVE_STAT=t
         DEFINES="$DEFINES -DHAVE_STAT"  
934      fi      fi
935      rm -f genmake_tc*      rm -f genmake_tc*
936      echo " --> set HAVE_STAT='$HAVE_STAT'" >> $LOGFILE      echo " --> set HAVE_STAT='$HAVE_STAT'" >> $LOGFILE
# Line 1039  EOF Line 1028  EOF
1028      echo " --> set HAVE_NETCDF='$HAVE_NETCDF'" >> $LOGFILE      echo " --> set HAVE_NETCDF='$HAVE_NETCDF'" >> $LOGFILE
1029  }  }
1030    
1031    check_lapack_libs()  {
1032        if test ! "x$SKIP_LAPACK_CHECK" = x ; then
1033            return
1034        fi
1035        echo >> $LOGFILE
1036        echo "running: check_lapack_libs()" >> $LOGFILE
1037        cat <<EOF > genmake_tla.F
1038          program fgenla
1039          integer info
1040          integer ipiv( 2 )
1041          double precision ab( 4, 2 ), b( 2 )
1042          data ab / 0., 0., 1., 2., 0., 2., 1., 0. /
1043          data b / 1., 1. /
1044          call dgbsv( 2, 1, 1, 1, ab, 4, ipiv, b, 2, info )
1045          IF (info .NE. 0) write(*,*) 'Error:', info
1046          write(*,*) b
1047          end
1048    EOF
1049        echo "===  genmake_tla.F  >>>" > genmake_tla.log
1050        cat genmake_tla.F >> genmake_tla.log
1051        echo "<<<  genmake_tla.F  ===" >> genmake_tla.log
1052        RET_CPP=f
1053        COMM="cat genmake_tla.F | $CPP $DEFINES $INCLUDES"
1054        echo "$COMM" >> genmake_tla.log
1055        eval $COMM > genmake_tla.$FS 2>/dev/null  &&  RET_CPP=t
1056        if test "x$RET_CPP" = xf ; then
1057            echo "  WARNING: CPP failed to pre-process the lapack test." \
1058                >> genmake_tla.log
1059            echo "    Please check that \$INCLUDES is properly set." \
1060                >> genmake_tla.log
1061        fi
1062        echo "$FC $FFLAGS $FOPTIM -c genmake_tla.$FS  \ " >> genmake_tla.log
1063        echo "  &&  $LINK $FFLAGS $FOPTIM -o genmake_tla.o $LIBS" >> genmake_tla.log
1064        $FC $FFLAGS $FOPTIM -c genmake_tla.$FS >> genmake_tla.log 2>&1  \
1065            &&  $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS >> genmake_tla.log 2>&1
1066        RET_COMPILE=$?
1067        cat genmake_tla.log >> $LOGFILE
1068    
1069        # test program execution not always possible (see check_netcdf_libs)
1070        #
1071        #test -x ./genmake_tla  &&  ./genmake_tla >> genmake_tla.log 2>&1
1072        #RETVAL=$?
1073        #if test "x$RET_COMPILE" = x0 -a "x$RETVAL" = x0 ; then
1074    
1075        if test "x$RET_COMPILE" = x0 ; then
1076            HAVE_LAPACK=t
1077            echo "check_lapack: successful" >> $LOGFILE
1078        else
1079            # try again with "-llapack" added to the libs
1080            echo "==> try again with added '-llapack'" > genmake_tla.log
1081            echo "cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS \ " >> genmake_tla.log
1082            echo " &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS \ " >> genmake_tla.log
1083            echo " &&  $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack" >> genmake_tla.log
1084            cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS 2>/dev/null  \
1085                &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS >> genmake_tla.log 2>&1  \
1086                &&  $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack >> genmake_tla.log 2>&1
1087            RET_COMPILE=$?
1088            echo >> $LOGFILE
1089            cat genmake_tla.log >> $LOGFILE
1090            if test "x$RET_COMPILE" = x0 ; then
1091                LIBS="$LIBS -llapack"
1092                HAVE_LAPACK=t
1093                echo "check_lapack: successful" >> $LOGFILE
1094            else
1095            # try again with "-lf77blas -lcblas" added to the libs
1096                echo "==> try again with added '-llapack -lf77blas -lcblas'" > genmake_tla.log
1097                echo "cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS \ " >> genmake_tla.log
1098                echo " &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS \ " >> genmake_tla.log
1099                echo " &&  $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas" >> genmake_tla.log
1100                cat genmake_tla.F | $CPP $DEFINES $INCLUDES > genmake_tla.$FS 2>/dev/null  \
1101                    &&  $FC $FFLAGS $FOPTIM -c genmake_tla.$FS >> genmake_tla.log 2>&1  \
1102                    &&  $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas >> genmake_tla.log 2>&1
1103                RET_COMPILE=$?
1104                echo >> $LOGFILE
1105                cat genmake_tla.log >> $LOGFILE
1106                if test "x$RET_COMPILE" = x0 ; then
1107                    LIBS="$LIBS -llapack -lf77blas -lcblas"
1108                    HAVE_LAPACK=t
1109                    echo "check_lapack: successful" >> $LOGFILE
1110                else
1111                # try again with "-latlas" added to the libs
1112                    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
1114                    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
1116                    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  \
1118                        &&  $LINK $FFLAGS $FOPTIM -o genmake_tla genmake_tla.o $LIBS -llapack -lf77blas -lcblas -latlas >> genmake_tla.log 2>&1
1119                    RET_COMPILE=$?
1120                    echo >> $LOGFILE
1121                    cat genmake_tla.log >> $LOGFILE
1122                    if test "x$RET_COMPILE" = x0 ; then
1123                        LIBS="$LIBS -llapack -lf77blas -lcblas -latlas"
1124                        HAVE_LAPACK=t
1125                        echo "check_lapack: successful" >> $LOGFILE
1126                    fi
1127                fi
1128            fi
1129        fi
1130        rm -f genmake_tla*
1131        echo " --> set HAVE_LAPACK='$HAVE_LAPACK'" >> $LOGFILE
1132    }
1133    
1134    
1135  ###############################################################################  ###############################################################################
1136  #   Sequential part of script starts here  #   Sequential part of script starts here
# Line 1106  HAVE_STAT= Line 1198  HAVE_STAT=
1198  HAVE_NETCDF=  HAVE_NETCDF=
1199  HAVE_ETIME=  HAVE_ETIME=
1200  IGNORE_TIME=  IGNORE_TIME=
1201    HAVE_LAPACK=
1202    
1203  MODS=  MODS=
1204  TOOLSDIR=  TOOLSDIR=
# Line 1158  gm_s4="LN S64 LINK MAKE PACKAGES INCLUDE Line 1251  gm_s4="LN S64 LINK MAKE PACKAGES INCLUDE
1251  gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS"  gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS"
1252  gm_s6="TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK"  gm_s6="TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK"
1253  gm_s7="PWD THISHOST THISUSER THISDATE THISVER MACHINE"  gm_s7="PWD THISHOST THISUSER THISDATE THISVER MACHINE"
1254  gm_s8="FC_NAMEMANGLE HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME"  gm_s8="FC_NAMEMANGLE HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME HAVE_LAPACK"
1255    
1256  #  The following are all related to adjoint/tangent-linear stuff  #  The following are all related to adjoint/tangent-linear stuff
1257  gm_s10="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS"  gm_s10="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS"
# Line 1212  for ac_option in "$@" ; do Line 1305  for ac_option in "$@" ; do
1305      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
1306    
1307      case $ac_option in      case $ac_option in
1308            
1309          -help | --help | -h | --h)          -help | --help | -h | --h)
1310              usage ;;              usage ;;
1311            
1312          -nooptfile | --nooptfile)          -nooptfile | --nooptfile)
1313              OPTFILE="NONE" ;;              OPTFILE="NONE" ;;
1314          -optfile | --optfile | -of | --of)          -optfile | --optfile | -of | --of)
1315              ac_prev=OPTFILE ;;              ac_prev=OPTFILE ;;
1316          -optfile=* | --optfile=* | -of=* | --of=*)          -optfile=* | --optfile=* | -of=* | --of=*)
1317              OPTFILE=$ac_optarg ;;              OPTFILE=$ac_optarg ;;
1318            
1319          -adoptfile | --adoptfile | -adof | --adof)          -adoptfile | --adoptfile | -adof | --adof)
1320              ac_prev=AD_OPTFILE ;;              ac_prev=AD_OPTFILE ;;
1321          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)
1322              AD_OPTFILE=$ac_optarg ;;              AD_OPTFILE=$ac_optarg ;;
1323            
1324          -pdepend | --pdepend)          -pdepend | --pdepend)
1325              ac_prev=PKG_DEPEND ;;              ac_prev=PKG_DEPEND ;;
1326          -pdepend=* | --pdepend=*)          -pdepend=* | --pdepend=*)
1327              PKG_DEPEND=$ac_optarg ;;              PKG_DEPEND=$ac_optarg ;;
1328            
1329          -pgroups | --pgroups)          -pgroups | --pgroups)
1330              ac_prev=PKG_GROUPS ;;              ac_prev=PKG_GROUPS ;;
1331          -pgroups=* | --pgroups=*)          -pgroups=* | --pgroups=*)
1332              PKG_GROUPS=$ac_optarg ;;              PKG_GROUPS=$ac_optarg ;;
1333            
1334          -make | --make | -m | --m)          -make | --make | -m | --m)
1335              ac_prev=MAKE ;;              ac_prev=MAKE ;;
1336          -make=* | --make=* | -m=* | --m=*)          -make=* | --make=* | -m=* | --m=*)
1337              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
1338            
1339          -bash | --bash)          -bash | --bash)
1340              ac_prev=BASH ;;              ac_prev=BASH ;;
1341          -bash=* | --bash=*)          -bash=* | --bash=*)
1342              BASH=$ac_optarg ;;              BASH=$ac_optarg ;;
1343            
1344          -makedepend | --makedepend | -md | --md)          -makedepend | --makedepend | -md | --md)
1345              ac_prev=MAKEDEPEND ;;              ac_prev=MAKEDEPEND ;;
1346          -makedepend=* | --makedepend=* | -md=* | --md=*)          -makedepend=* | --makedepend=* | -md=* | --md=*)
1347              MAKEDEPEND=$ac_optarg ;;              MAKEDEPEND=$ac_optarg ;;
1348            
1349          -makefile | --makefile | -ma | --ma)          -makefile | --makefile | -ma | --ma)
1350              ac_prev=MAKEFILE ;;              ac_prev=MAKEFILE ;;
1351          -makefile=* | --makefile=* | -ma=* | --ma=*)          -makefile=* | --makefile=* | -ma=* | --ma=*)
1352              MAKEFILE=$ac_optarg ;;              MAKEFILE=$ac_optarg ;;
1353            
1354          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)
1355              echo "ERROR: The platform option has been removed.  Please specify"              echo "ERROR: The platform option has been removed.  Please specify"
1356              echo "  the build options using the \"optfile\" mechanism."              echo "  the build options using the \"optfile\" mechanism."
1357              echo              echo
1358              usage              usage
1359              ;;              ;;
1360            
1361          -rootdir | --rootdir | -rd | --rd)          -rootdir | --rootdir | -rd | --rd)
1362              ac_prev=ROOTDIR ;;              ac_prev=ROOTDIR ;;
1363          -rootdir=* | --rootdir=* | -rd=* | --rd=*)          -rootdir=* | --rootdir=* | -rd=* | --rd=*)
1364              ROOTDIR=$ac_optarg ;;              ROOTDIR=$ac_optarg ;;
1365            
1366          -mods | --mods | -mo | --mo)          -mods | --mods | -mo | --mo)
1367              ac_prev=MODS ;;              ac_prev=MODS ;;
1368          -mods=* | --mods=* | -mo=* | --mo=*)          -mods=* | --mods=* | -mo=* | --mo=*)
1369              MODS=$ac_optarg ;;              MODS=$ac_optarg ;;
1370            
1371          -disable | --disable)          -disable | --disable)
1372              ac_prev=DISABLE ;;              ac_prev=DISABLE ;;
1373          -disable=* | --disable=*)          -disable=* | --disable=*)
1374              DISABLE=$ac_optarg ;;              DISABLE=$ac_optarg ;;
1375            
1376          -enable | --enable)          -enable | --enable)
1377              ac_prev=ENABLE ;;              ac_prev=ENABLE ;;
1378          -enable=* | --enable=*)          -enable=* | --enable=*)
1379              ENABLE=$ac_optarg ;;              ENABLE=$ac_optarg ;;
1380            
1381          -standarddirs | --standarddirs)          -standarddirs | --standarddirs)
1382              ac_prev=STANDARDDIRS ;;              ac_prev=STANDARDDIRS ;;
1383          -standarddirs=* | --standarddirs=*)          -standarddirs=* | --standarddirs=*)
# Line 1294  for ac_option in "$@" ; do Line 1387  for ac_option in "$@" ; do
1387  #               ac_prev=cpp ;;  #               ac_prev=cpp ;;
1388  #           -cpp=* | --cpp=*)  #           -cpp=* | --cpp=*)
1389  #               CPP=$ac_optarg ;;  #               CPP=$ac_optarg ;;
1390            
1391          -cc | --cc)          -cc | --cc)
1392              ac_prev=CC ;;              ac_prev=CC ;;
1393          -cc=* | --cc=*)          -cc=* | --cc=*)
1394              CC=$ac_optarg ;;              CC=$ac_optarg ;;
1395            
1396          -fortran | --fortran | -fc | --fc)          -fortran | --fortran | -fc | --fc)
1397              ac_prev=FC ;;              ac_prev=FC ;;
1398          -fc=* | --fc=*)          -fc=* | --fc=*)
1399              FC=$ac_optarg ;;              FC=$ac_optarg ;;
1400            
1401          -fs | --fs)          -fs | --fs)
1402              ac_prev=FS ;;              ac_prev=FS ;;
1403          -fs=* | --fs=*)          -fs=* | --fs=*)
1404              FS=$ac_optarg ;;              FS=$ac_optarg ;;
1405            
1406          -fs90 | --fs90)          -fs90 | --fs90)
1407              ac_prev=FS90 ;;              ac_prev=FS90 ;;
1408          -fs90=* | --fs90=*)          -fs90=* | --fs90=*)
1409              FS90=$ac_optarg ;;              FS90=$ac_optarg ;;
1410            
1411          -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 )          -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4 )
1412              USE_R4=true ;;              USE_R4=true ;;
1413    
# Line 1347  for ac_option in "$@" ; do Line 1440  for ac_option in "$@" ; do
1440          -mpi=* | --mpi=*)          -mpi=* | --mpi=*)
1441              MPIPATH=$ac_optarg              MPIPATH=$ac_optarg
1442              MPI=true ;;              MPI=true ;;
1443            
1444          -omp | --omp)          -omp | --omp)
1445              OMP=true ;;              OMP=true ;;
1446          -omp=* | --omp=*)          -omp=* | --omp=*)
1447              OMPFLAG=$ac_optarg              OMPFLAG=$ac_optarg
1448              OMP=true ;;              OMP=true ;;
1449            
1450          -ds | --ds)          -ds | --ds)
1451              DUMPSTATE=t ;;              DUMPSTATE=t ;;
1452            
1453          -extra_flag | --extra_flag)          -extra_flag | --extra_flag)
1454              ac_prev=FEXTRAFLAGS ;;              ac_prev=FEXTRAFLAGS ;;
1455          -extra_flag=* | --extra_flag=*)          -extra_flag=* | --extra_flag=*)
1456              FEXTRAFLAGS=$ac_optarg ;;              FEXTRAFLAGS=$ac_optarg ;;
1457            
1458          -taf_extra | --taf_extra)          -taf_extra | --taf_extra)
1459              ac_prev=TAF_EXTRA ;;              ac_prev=TAF_EXTRA ;;
1460          -taf_extra=* | --taf_extra=*)          -taf_extra=* | --taf_extra=*)
# Line 1371  for ac_option in "$@" ; do Line 1464  for ac_option in "$@" ; do
1464              ac_prev=TAMC_EXTRA ;;              ac_prev=TAMC_EXTRA ;;
1465          -tamc_extra=* | --tamc_extra=*)          -tamc_extra=* | --tamc_extra=*)
1466              TAMC_EXTRA=$ac_optarg ;;              TAMC_EXTRA=$ac_optarg ;;
1467            
1468          -ignoretime | -ignore_time | --ignoretime | --ignore_time)          -ignoretime | -ignore_time | --ignoretime | --ignore_time)
1469              IGNORE_TIME="-DIGNORE_TIME" ;;              IGNORE_TIME="-DIGNORE_TIME" ;;
1470    
# Line 1382  for ac_option in "$@" ; do Line 1475  for ac_option in "$@" ; do
1475              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
1476              usage              usage
1477              ;;              ;;
1478            
1479          *)          *)
1480              echo "Error: unrecognized argument: "$ac_option              echo "Error: unrecognized argument: "$ac_option
1481              usage              usage
1482              ;;              ;;
1483            
1484      esac      esac
1485    
1486  done  done
# Line 1620  fi Line 1713  fi
1713  if test ! "x$TS" = x ; then  if test ! "x$TS" = x ; then
1714        echo "  Turning on timing per timestep"        echo "  Turning on timing per timestep"
1715        if test ! "x$FOOLAD" = x ; then        if test ! "x$FOOLAD" = x ; then
1716              DEFINES="$DEFINES -DTIME_PER_TIMESTEP_SFP"              DEFINES="$DEFINES -DTIME_PER_TIMESTEP_SFP"
1717        else        else
1718              DEFINES="$DEFINES -DTIME_PER_TIMESTEP"              DEFINES="$DEFINES -DTIME_PER_TIMESTEP"
1719        fi        fi
# Line 1656  if test ! "x$PAPI" = x ; then Line 1749  if test ! "x$PAPI" = x ; then
1749            echo "  Sticking with PAPI flop summary per timestep!"            echo "  Sticking with PAPI flop summary per timestep!"
1750        else        else
1751            echo "  Turning on performance analysis with PAPI"            echo "  Turning on performance analysis with PAPI"
1752            echo "  Please make sure PAPIINC, PAPILIB are defined"            echo "  Please make sure PAPIINC, PAPILIB are defined"
1753            DEFINES="$DEFINES -DUSE_PAPI"            DEFINES="$DEFINES -DUSE_PAPI"
1754            INCLUDES="$INCLUDES $PAPIINC"            INCLUDES="$INCLUDES $PAPIINC"
1755            LIBS="$LIBS $PAPILIB"            LIBS="$LIBS $PAPILIB"
# Line 1668  if test ! "x$PCL" = x ; then Line 1761  if test ! "x$PCL" = x ; then
1761            echo "  Sticking with PCL flop summary per timestep!"            echo "  Sticking with PCL flop summary per timestep!"
1762        else        else
1763            echo "  Turning on performance analysis with PCL"            echo "  Turning on performance analysis with PCL"
1764            echo "  Please make sure PCLINC, PCLLIB are defined"            echo "  Please make sure PCLINC, PCLLIB are defined"
1765            DEFINES="$DEFINES -DUSE_PCL"            DEFINES="$DEFINES -DUSE_PCL"
1766            INCLUDES="$INCLUDES $PCLINC"            INCLUDES="$INCLUDES $PCLINC"
1767            LIBS="$LIBS $PCLLIB"            LIBS="$LIBS $PCLLIB"
# Line 1683  if test ! "x$HPMT" = x ; then Line 1776  if test ! "x$HPMT" = x ; then
1776            echo "  Sticking with PCL!"            echo "  Sticking with PCL!"
1777        else        else
1778            echo "  Turning on performance analysis with the HPM Toolkit"            echo "  Turning on performance analysis with the HPM Toolkit"
1779            echo "  Please make sure HPMTINC, HPMTLIB are defined"            echo "  Please make sure HPMTINC, HPMTLIB are defined"
1780            DEFINES="$DEFINES -DUSE_LIBHPM"            DEFINES="$DEFINES -DUSE_LIBHPM"
1781            INCLUDES="$INCLUDES $HPMTINC"            INCLUDES="$INCLUDES $HPMTINC"
1782            LIBS="$LIBS $HPMTLIB"            LIBS="$LIBS $HPMTLIB"
1783        fi        fi
1784        fi        fi
# Line 1768  rm -f genmake_tcomp* Line 1861  rm -f genmake_tcomp*
1861  printf "  Can we call simple C routines (here, \"cloc()\") using $FC...  "  printf "  Can we call simple C routines (here, \"cloc()\") using $FC...  "
1862  check_HAVE_CLOC  check_HAVE_CLOC
1863  if test "x$HAVE_CLOC" != x ; then  if test "x$HAVE_CLOC" != x ; then
1864        DEFINES="$DEFINES -DHAVE_CLOC"
1865      echo "yes"      echo "yes"
1866  else  else
1867      echo "no"      echo "no"
# Line 1782  rm -f genmake_t* Line 1876  rm -f genmake_t*
1876  printf "  Can we unlimit the stack size using $FC...  "  printf "  Can we unlimit the stack size using $FC...  "
1877  check_HAVE_SETRLSTK  check_HAVE_SETRLSTK
1878  if test "x$HAVE_SETRLSTK" = xt ; then  if test "x$HAVE_SETRLSTK" = xt ; then
1879        DEFINES="$DEFINES -DHAVE_SETRLSTK"
1880      echo "yes"      echo "yes"
1881  else  else
1882      echo "no"      echo "no"
# Line 1791  rm -f genmake_t* Line 1886  rm -f genmake_t*
1886  printf "  Can we register a signal handler using $FC...  "  printf "  Can we register a signal handler using $FC...  "
1887  check_HAVE_SIGREG  check_HAVE_SIGREG
1888  if test "x$HAVE_SIGREG" = xt ; then  if test "x$HAVE_SIGREG" = xt ; then
1889        DEFINES="$DEFINES -DHAVE_SIGREG"
1890      echo "yes"      echo "yes"
1891  else  else
1892      echo "no"      echo "no"
# Line 1800  rm -f genmake_t* Line 1896  rm -f genmake_t*
1896  printf "  Can we use stat() through C calls...  "  printf "  Can we use stat() through C calls...  "
1897  check_HAVE_STAT  check_HAVE_STAT
1898  if test "x$HAVE_STAT" != x ; then  if test "x$HAVE_STAT" != x ; then
1899        DEFINES="$DEFINES -DHAVE_STAT"
1900      echo "yes"      echo "yes"
1901  else  else
1902      echo "no"      echo "no"
# Line 1809  rm -f genmake_t* Line 1906  rm -f genmake_t*
1906  printf "  Can we create NetCDF-enabled binaries...  "  printf "  Can we create NetCDF-enabled binaries...  "
1907  check_netcdf_libs  check_netcdf_libs
1908  if test "x$HAVE_NETCDF" != x ; then  if test "x$HAVE_NETCDF" != x ; then
1909        DEFINES="$DEFINES -DHAVE_NETCDF"
1910        echo "yes"
1911    else
1912        echo "no"
1913    fi
1914    
1915    printf "  Can we create LAPACK-enabled binaries...  "
1916    check_lapack_libs
1917    if test "x$HAVE_LAPACK" != x ; then
1918        DEFINES="$DEFINES -DHAVE_LAPACK"
1919      echo "yes"      echo "yes"
1920  else  else
1921      echo "no"      echo "no"
# Line 1820  if test "x$EMBED_SRC" = xt ; then Line 1927  if test "x$EMBED_SRC" = xt ; then
1927  fi  fi
1928  if test "x$EMBED_SRC" = xt ; then  if test "x$EMBED_SRC" = xt ; then
1929      ENABLE="$ENABLE embed_files"      ENABLE="$ENABLE embed_files"
1930    #   DEFINES="$DEFINES -DHAVE_EMBED_SRC"
1931  fi  fi
1932    
1933  printf "\n===  Setting defaults  ===\n"  printf "\n===  Setting defaults  ===\n"
# Line 2047  for i in $PACKAGES ; do Line 2155  for i in $PACKAGES ; do
2155      j=`echo $i | sed 's/[-+]//'`      j=`echo $i | sed 's/[-+]//'`
2156      if test ! -d "$ROOTDIR/pkg/$j" ; then      if test ! -d "$ROOTDIR/pkg/$j" ; then
2157          echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'"          echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'"
2158          exit 1          exit 1
2159      fi      fi
2160      echo $i >> ./.tmp_pack      echo $i >> ./.tmp_pack
2161  done  done
# Line 2125  EOF Line 2233  EOF
2233      fi      fi
2234  fi  fi
2235    
2236    #  Check for package RADTRANS: if LAPACK is not available,
2237    #  then issue a warning that the direct radtrans solver is not available.
2238    if test "x$HAVE_LAPACK" != xt ; then
2239        echo " $PACKAGES " | grep ' radtrans ' > /dev/null 2>&1
2240        RETVAL=$?
2241        if test "x$RETVAL" = x0 ; then
2242            cat <<EOF
2243    *********************************************************************
2244    WARNING: the "radtrans" package was enabled but tests failed to
2245      compile LAPACK applications.  This means that the direct radtrans
2246      solver is not available and compilation will fail if it is enabled.
2247      If you want to use the direct solver, please check that:
2248    
2249      1) LAPACK is correctly installed for this compiler and
2250      2) the LIBS variable (within the "optfile") specifies the correct
2251         LAPACK library to link against.
2252    *********************************************************************
2253    EOF
2254        fi
2255    fi
2256    
2257  if  test "x${PKG_DEPEND}" != x ; then  if  test "x${PKG_DEPEND}" != x ; then
2258    echo "  applying package dependency rules"    echo "  applying package dependency rules"
2259    ck=    ck=
# Line 2170  if  test "x${PKG_DEPEND}" != x ; then Line 2299  if  test "x${PKG_DEPEND}" != x ; then
2299    
2300          #  Do we need to add $dname according to the dependency rules?          #  Do we need to add $dname according to the dependency rules?
2301          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
2302              #echo "   " $pname ": need to add :" $dname              #echo "   " $pname ": need to add :" $dname
2303              in_dis="f"              in_dis="f"
2304              for dis in $DISABLE ; do              for dis in $DISABLE ; do
2305                  if test "x$dis" = "x$dname" ; then                  if test "x$dis" = "x$dname" ; then
# Line 2195  if  test "x${PKG_DEPEND}" != x ; then Line 2324  if  test "x${PKG_DEPEND}" != x ; then
2324              echo "  the dependency rules for \"$dname\""              echo "  the dependency rules for \"$dname\""
2325              exit 1              exit 1
2326          fi          fi
2327          i=`echo "$i + 1" | bc -l`          i=`echo "$i + 1" | bc -l`
2328          #i=$(( $i + 1 ))          #i=$(( $i + 1 ))
2329      done      done
2330      ck=$ck"t"      ck=$ck"t"
# Line 2236  for n in $names ; do Line 2365  for n in $names ; do
2365          done          done
2366          if test "x$has_pack" = xf ; then          if test "x$has_pack" = xf ; then
2367              undef=`echo "ALLOW_$n" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`              undef=`echo "ALLOW_$n" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2368              DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"              DISABLED_PACKAGES="$DISABLED_PACKAGES -U$undef"
2369          fi          fi
2370      fi      fi
2371  done  done
# Line 2249  for i in $PACKAGES ; do Line 2378  for i in $PACKAGES ; do
2378  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!
2379      case $i in      case $i in
2380          aim_v23)          aim_v23)
2381              ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM"              ENABLED_PACKAGES="$ENABLED_PACKAGES -DALLOW_AIM"
2382              echo "Warning: ALLOW_AIM is set to enable aim_v23."              echo "Warning: ALLOW_AIM is set to enable aim_v23."
2383              ;;              ;;
2384      esac      esac
# Line 2291  for i in $spaths ; do Line 2420  for i in $spaths ; do
2420      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
2421          echo "    found CPP_OPTIONS=\"$try\""          echo "    found CPP_OPTIONS=\"$try\""
2422          CPP_OPTIONS="$try"          CPP_OPTIONS="$try"
2423          # 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
2424          for n in $names ; do          for n in $names ; do
2425              test_for_package_in_cpp_options $CPP_OPTIONS $n              test_for_package_in_cpp_options $CPP_OPTIONS $n
2426          done          done
2427      fi      fi
2428      try="$i/CPP_EEOPTIONS.h"      try="$i/CPP_EEOPTIONS.h"
2429      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
2430          echo "    found CPP_EEOPTIONS=\"$try\""          echo "    found CPP_EEOPTIONS=\"$try\""
2431          # 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
2432  #**** not yet enabled ****  #**** not yet enabled ****
2433  #        test_for_mpi_in_cpp_eeoptions $try  #        test_for_mpi_in_cpp_eeoptions $try
2434  #**** not yet enabled ****  #**** not yet enabled ****
# Line 2445  for d in $alldirs ; do Line 2574  for d in $alldirs ; do
2574          if test ! -r ".links.tmp/$sf" ; then          if test ! -r ".links.tmp/$sf" ; then
2575              if test -f "$d/$sf" ; then              if test -f "$d/$sf" ; then
2576                  ignore_f=f                  ignore_f=f
2577                  case $d/$sf in                  case $d/$sf in
2578                    ./$PACKAGES_DOT_H)                    ./$PACKAGES_DOT_H)
2579                          ignore_f=t                          ignore_f=t
2580                          ;;                          ;;
2581                    ./AD_CONFIG.h)                    ./AD_CONFIG.h)
2582                          ignore_f=t                          ignore_f=t
2583                          ;;                          ;;
2584                    ./FC_NAMEMANGLE.h)                    ./FC_NAMEMANGLE.h)
2585                          ignore_f=t                          ignore_f=t
2586                          ;;                          ;;
2587                    ./BUILD_INFO.h)                    ./BUILD_INFO.h)
2588                          ignore_f=t                          ignore_f=t
2589                          ;;                          ;;
2590                    ./EMBEDDED_FILES.h)                    ./EMBEDDED_FILES.h)
2591                          ignore_f=t                          ignore_f=t
2592                          ;;                          ;;
2593                    *)                    *)
2594                          #  For the local directory *ONLY*,                          #  For the local directory *ONLY*,
2595                          #  ignore all soft-links                          #  ignore all soft-links
2596                          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 2471  for d in $alldirs ; do Line 2600  for d in $alldirs ; do
2600                              deplist="$deplist $sf"                              deplist="$deplist $sf"
2601                          fi                          fi
2602                          ;;                          ;;
2603                  esac                  esac
2604                  if test "x$ignore_f" = xf ; then                  if test "x$ignore_f" = xf ; then
2605                      extn=`echo $sf | $AWK -F. '{print $NF}'`                      extn=`echo $sf | $AWK -F. '{print $NF}'`
2606                      case $extn in                      case $extn in
# Line 2518  for d in $alldirs ; do Line 2647  for d in $alldirs ; do
2647                          echo    " \\"  >> hsrclist.tmp                          echo    " \\"  >> hsrclist.tmp
2648                          printf " $sf" >> hsrclist.tmp                          printf " $sf" >> hsrclist.tmp
2649                          ;;                          ;;
2650                      flow)                      flow)
2651                          echo    " \\"  >> ad_flow_files.tmp                          echo    " \\"  >> ad_flow_files.tmp
2652                          printf " $sf" >> ad_flow_files.tmp                          printf " $sf" >> ad_flow_files.tmp
2653                          ;;                          ;;
# Line 2529  for d in $alldirs ; do Line 2658  for d in $alldirs ; do
2658      done      done
2659      if test "x$deplist" != x ; then      if test "x$deplist" != x ; then
2660        if test "$d" != "." ; then        if test "$d" != "." ; then
2661          echo "" >> srclinks.tmp          echo "" >> srclinks.tmp
2662          echo "#  These files are linked from $d" >> srclinks.tmp          echo "#  These files are linked from $d" >> srclinks.tmp
2663          echo "$deplist :" >> srclinks.tmp          echo "$deplist :" >> srclinks.tmp
2664  # 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 2683  echo >> $MAKEFILE Line 2812  echo >> $MAKEFILE
2812  echo 'F77_PP_SRC_FILES = $(F77_SRC_FILES:.F=.'$FS')'      >> $MAKEFILE  echo 'F77_PP_SRC_FILES = $(F77_SRC_FILES:.F=.'$FS')'      >> $MAKEFILE
2813  echo 'F90_PP_SRC_FILES = $(F90_SRC_FILES:.F90=.'$FS90')' >> $MAKEFILE  echo 'F90_PP_SRC_FILES = $(F90_SRC_FILES:.F90=.'$FS90')' >> $MAKEFILE
2814  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
2815  echo 'FLOFILES =  $(AD_FLOW_FILES:.flow=.flowdir)' >> $MAKEFILE  echo 'FLOWFILES =  $(AD_FLOW_FILES:.flow=.flowdir)' >> $MAKEFILE
2816  echo >> $MAKEFILE  echo >> $MAKEFILE
2817  echo '.SUFFIXES:' >> $MAKEFILE  echo '.SUFFIXES:' >> $MAKEFILE
2818  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 2697  all: \$(EXECUTABLE) Line 2826  all: \$(EXECUTABLE)
2826    
2827  depend:  depend:
2828          @make -f \$(MAKEFILE) links          @make -f \$(MAKEFILE) links
2829          \$(MAKEDEPEND) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES)          \$(MAKEDEPEND) -f \$(MAKEFILE) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES)
2830          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)
2831          -rm -f makedepend.out          -rm -f makedepend.out
2832    
# Line 2729  Clean: Line 2858  Clean:
2858          @make -f \$(MAKEFILE) clean          @make -f \$(MAKEFILE) clean
2859          @make -f \$(MAKEFILE) cleanlinks          @make -f \$(MAKEFILE) cleanlinks
2860          -rm -f \$(SPECIAL_FILES) f90mkdepend.log $MAKEFILE.old          -rm -f \$(SPECIAL_FILES) f90mkdepend.log $MAKEFILE.old
2861          -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
2862          -rm -f genmake_warnings genmake_errors make.log          -rm -f genmake_warnings genmake_errors make.log
2863    
2864  # remove also the executable, files that "genmake2" generates (except Makefile)  # remove also the executable, files that "genmake2" generates (except Makefile)
2865  #         and output from a run (plus log files from testreport)  #         and output from a run (plus log files from testreport)
2866  CLEAN:  CLEAN:
2867          @make -f \$(MAKEFILE) Clean          @make -f \$(MAKEFILE) Clean
2868          -rm -f \$(EXECUTABLE) \$(EXE_AD) *.bak          -rm -f \$(EXECUTABLE) \$(EXE_AD) \$(EXE_FTL) *.bak
2869          -rm -f $LOGFILE genmake_state genmake_*optfile          -rm -f $LOGFILE genmake_state genmake_*optfile
2870          -rm -f SIZE.h.mpi genmake.tr_log make.tr_log          -rm -f SIZE.h.mpi genmake.tr_log make.tr_log
2871          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
# Line 2757  ${PACKAGES_DOT_H}: Line 2886  ${PACKAGES_DOT_H}:
2886          @$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 "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@
2887  AD_CONFIG.h:  AD_CONFIG.h:
2888          @echo Creating \$@ ...          @echo Creating \$@ ...
2889          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > \$@          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > \$@
2890  FC_NAMEMANGLE.h:  FC_NAMEMANGLE.h:
2891          @echo Creating \$@ ...          @echo Creating \$@ ...
2892          echo "$FC_NAMEMANGLE" > \$@          echo "$FC_NAMEMANGLE" > \$@
# Line 2871  adtaf: ad_taf_output.$FS Line 3000  adtaf: ad_taf_output.$FS
3000  adtamc: ad_tamc_output.$FS  adtamc: ad_tamc_output.$FS
3001    
3002  ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES) \$(AD_FLOW_FILES)  ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES) \$(AD_FLOW_FILES)
3003          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
3004          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
3005          -rm -f ad_config.template          -rm -f ad_config.template
3006          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3007          @make -f \$(MAKEFILE) \$(FLOFILES)          @make -f \$(MAKEFILE) \$(FLOWFILES)
3008          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
3009    
3010  ad_taf_output.$FS: ad_input_code.$FS  ad_taf_output.$FS: ad_input_code.$FS
3011          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS
# Line 2907  adtrick: Line 3036  adtrick:
3036  adobj: ad_taf_output.o \$(OBJFILES)  adobj: ad_taf_output.o \$(OBJFILES)
3037    
3038  # ... FTL ...  # ... FTL ...
3039  ftlall: ftl_taf  ftlall: \$(EXE_FTL)
3040  ftltaf: ftl_taf_output.$FS  ftltaf: ftl_taf_output.$FS
3041  ftltamc: ftl_tamc_output.$FS  ftltamc: ftl_tamc_output.$FS
3042    
3043  ftl_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES)  ftl_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES)
3044          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ftl_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ftl_config.template
3045          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h
3046          -rm -f ftl_config.template          -rm -f ftl_config.template
3047          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3048          @make -f \$(MAKEFILE) \$(AD_FLOW_FILES)          @make -f \$(MAKEFILE) \$(AD_FLOW_FILES)
3049          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
3050    
3051  ftl_taf_output.$FS: ftl_input_code.$FS  ftl_taf_output.$FS: ftl_input_code.$FS
3052          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS
# Line 2929  ftltafonly: Line 3058  ftltafonly:
3058          ls -l ftl_input_code_ftl.$FS          ls -l ftl_input_code_ftl.$FS
3059          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
3060    
3061  ftl_taf: ftl_taf_output.o \$(OBJFILES)  \${EXE_FTL}: ftl_taf_output.o \$(OBJFILES)
3062          \$(LINK) -o ${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS)          \$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS)
3063    
3064  ftl_tamc_output.$FS: ftl_input_code.$FS  ftl_tamc_output.$FS: ftl_input_code.$FS
3065          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS
# Line 2959  svd_touch: Line 3088  svd_touch:
3088          touch ad_taf_output.$FS ftl_taf_output.$FS          touch ad_taf_output.$FS ftl_taf_output.$FS
3089          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ad_taf_output.$FS          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ad_taf_output.$FS
3090          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ftl_taf_output.$FS          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ftl_taf_output.$FS
3091          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ftl_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ftl_config.template
3092          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h
3093          -rm -f ftl_config.template          -rm -f ftl_config.template
3094    
# Line 3036  CB2M_F90_PP_SRC_FILES=\$(addsuffix _mod. Line 3165  CB2M_F90_PP_SRC_FILES=\$(addsuffix _mod.
3165    
3166  .PHONY: adDepend  .PHONY: adDepend
3167  adDepend: \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) \$(addsuffix _mod.FF90, \$(CB2M_F90_SRC_NAMES)) \$(F77_SRC_FILES:.F=_cb2m.FF90)  adDepend: \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) \$(addsuffix _mod.FF90, \$(CB2M_F90_SRC_NAMES)) \$(F77_SRC_FILES:.F=_cb2m.FF90)
3168          \$(MAKEDEPEND) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES)          \$(MAKEDEPEND) -f \$(MAKEFILE) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES)
3169          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)
3170          -rm -f makedepend.out          -rm -f makedepend.out
3171    
# Line 3061  f95_test.out: f95_test_mods.f90 f95_test Line 3190  f95_test.out: f95_test_mods.f90 f95_test
3190          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
3191          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
3192    
3193  # 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  
3194    
3195  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)
3196    
3197  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)
3198    
3199  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)  
3200          \$(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  
3201    
3202  # create the module files  # create sources files modules from header files containing common blocks
3203  %_mod.FF90 : %.h ../OAD_support/cb2mGetModules.csh ../OAD_support/cb2mGetModules.awk  %_mod.FF90 : %.h ../OAD_support/cb2mGetModules.csh ../OAD_support/cb2mGetModules.awk
3204          ../OAD_support/cb2mGetModules.csh $< ../OAD_support/cb2mGetModules.awk          ../OAD_support/cb2mGetModules.csh $< ../OAD_support/cb2mGetModules.awk
3205    
3206  # create the header files  # create new header files with USE statements for the new modules made above
3207  %_mod.h : %.h ../OAD_support/cb2mGetHeaders.csh ../OAD_support/cb2mGetHeaders.awk  %_mod.h : %.h ../OAD_support/cb2mGetHeaders.csh ../OAD_support/cb2mGetHeaders.awk
3208          ../OAD_support/cb2mGetHeaders.csh $< ../OAD_support/cb2mGetHeaders.awk \$(CB2M_F90_SRC_NAMES)          ../OAD_support/cb2mGetHeaders.csh $< ../OAD_support/cb2mGetHeaders.awk \$(CB2M_F90_SRC_NAMES)
3209    
3210  # 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
3211  %_cb2m.FF90 : %.F ../OAD_support/cb2mUseModules.bash  %_cb2m.FF90 : %.F ../OAD_support/cb2mUseModules.bash
3212          ../OAD_support/cb2mUseModules.bash $< ${MPI}          ../OAD_support/cb2mUseModules.bash $< ${MPI}
3213    
# Line 3114  ad_output.txt: \$(EXE_AD) Line 3222  ad_output.txt: \$(EXE_AD)
3222          @printf 'running ... '          @printf 'running ... '
3223          @./\$(EXE_AD) > \$@          @./\$(EXE_AD) > \$@
3224    
 CB2M_AD_FILES=\$(AD_FILES:.f=_cb2m.f$FS90)  
3225  ad_input_code.f$FS90:  \$(CB2M_AD_FILES)  ad_input_code.f$FS90:  \$(CB2M_AD_FILES)
3226          cat \$^ > \$@          cat \$^ > \$@
3227    
 # 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 > \$@  
   
3228  # canonicalizer  # canonicalizer
3229  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)
3230          ./preProcess.py --timing --r8 -H -S \$< -o \$@          \${OPENADFORTTK_BASE}/tools/SourceProcessing/preProcess.py --timing --r8 -H -S  -o \$@ \$^
3231    
3232    # replace stop statements (to avoid the implied unstructured control flow)  with print statements
3233    ad_input_code_sf.pre.s2p.f90 : ad_input_code_sf.pre.f90
3234            cat \$< | sed -f ../OAD_support/stop2print.sed > ad_input_code_sf.pre.s2p.f90
3235    
3236  # F -> WHIRL  # F -> WHIRL
3237  # note that the canonicalized version cuts off at col 72  ad_input_code_sf.pre.s2p.B: ad_input_code_sf.pre.s2p.f90
3238  # 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 \$@  
3239    
3240  # WHIRL -> XAIF  # WHIRL -> XAIF
3241  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
3242          ./whirl2xaif -s -n --debug 1 -o \$@ \$<          \${OPENADFORTTK}/bin/whirl2xaif -s -n --debug 1 -o \$@ \$<
3243    
3244  # XAIF -> XAIF'  # XAIF -> XAIF'
3245  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
3246          ./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
3247    
3248  # XAIF' -> WHIRL'  # XAIF' -> WHIRL'
3249  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
3250          ./xaif2whirl --debug 1 ad_input_code_sf.w2f.pre.B \$<          \${OPENADFORTTK}/bin/xaif2whirl --debug 1 ad_input_code_sf.pre.s2p.B \$<
3251    
3252  # WHIRL' -> F'  # WHIRL' -> F'
3253  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
3254          ./whirl2f -FLIST:ftn_file=\$@ -openad \$<          \${OPEN64ROOT}/whirl2f/whirl2f -FLIST:ftn_file=\$@ -openad \$<
3255    
3256  # insert template directives  # insert template directives
3257  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
3258          ../OAD_support/insertTemplateDir.bash \$< \$@          ../OAD_support/insertTemplateDir.bash \$< \$@
3259    
3260  PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F  PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F
3261  # postprocess F'  # postprocess F'
3262  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
3263          # 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 \$<
3264            # the target is a placeholder to trigger a single execution of the rule
3265          touch \$@          touch \$@
3266          # this step also creates the file postProcess.make but we cannot  # put this so make knows about the postprocessing output
3267          # 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 \$<  
3268    
3269  # setup some links  # link the XAIF schema files
3270  %.xsd:  %.xsd:
3271          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .
3272    
 mfef90:  
         \$(LN) \${OPEN64ROOT}/crayf90/sgi/mfef90 .  
   
3273  # link the support files:  # link the support files:
3274  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES):  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES):
3275          \$(LN) ../OAD_support/\$@ .          \$(LN) ../OAD_support/\$@ .
3276    
3277  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)  
3278    
3279  # ============ end OpenAD specific section ==============  # ============ end OpenAD specific section ==============
3280    
# Line 3259  else Line 3333  else
3333      fi      fi
3334  fi  fi
3335  if test ! -f AD_CONFIG.h ; then  if test ! -f AD_CONFIG.h ; then
3336      $BASH $TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > AD_CONFIG.h      $BASH $TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > AD_CONFIG.h
3337  fi  fi
3338    
3339  #  Write the "state" for future records  #  Write the "state" for future records

Legend:
Removed from v.1.228  
changed lines
  Added in v.1.236

  ViewVC Help
Powered by ViewVC 1.1.22