/[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.142 by edhill, Thu Feb 9 20:19:20 2006 UTC revision 1.160 by ce107, Wed Jan 31 21:28:10 2007 UTC
# Line 13  Line 13 
13  test_for_package_in_cpp_options() {  test_for_package_in_cpp_options() {
14      cpp_options=$1      cpp_options=$1
15      pkg=$2      pkg=$2
16      test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_$pkg" || exit 99      test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_$pkg[ ]"
17      test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_$pkg" || exit 99      test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_$pkg[ ]"
18      test_for_string_in_file $cpp_options "^[ ]*#define.*DISABLE_$pkg" || exit 99      test_for_string_in_file $cpp_options "^[ ]*#define.*DISABLE_$pkg[ ]"
19      test_for_string_in_file $cpp_options "^[ ]*#undef.*DISABLE_$pkg" || exit 99      test_for_string_in_file $cpp_options "^[ ]*#undef.*DISABLE_$pkg[ ]"
20        test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_$pkg$"
21        test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_$pkg$"
22        test_for_string_in_file $cpp_options "^[ ]*#define.*DISABLE_$pkg$"
23        test_for_string_in_file $cpp_options "^[ ]*#undef.*DISABLE_$pkg$"
24  }  }
25    
26  # Search for particular CPP #cmds associated with MPI  # Search for particular CPP #cmds associated with MPI
27  # usage: test_for_mpi_in_cpp_eeoptions CPP_file  # usage: test_for_mpi_in_cpp_eeoptions CPP_file
28  test_for_mpi_in_cpp_eeoptions() {  test_for_mpi_in_cpp_eeoptions() {
29      cpp_options=$1      cpp_options=$1
30      test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_USE_MPI" || exit 99      test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_USE_MPI[ ]"
31      test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_USE_MPI" || exit 99      test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_USE_MPI[ ]"
32      test_for_string_in_file $cpp_options "^[ ]*#define.*ALWAYS_USE_MPI" || exit 99      test_for_string_in_file $cpp_options "^[ ]*#define.*ALWAYS_USE_MPI[ ]"
33      test_for_string_in_file $cpp_options "^[ ]*#undef.*ALWAYS_USE_MPI" || exit 99      test_for_string_in_file $cpp_options "^[ ]*#undef.*ALWAYS_USE_MPI[ ]"
34        test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_USE_MPI$"
35        test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_USE_MPI$"
36        test_for_string_in_file $cpp_options "^[ ]*#define.*ALWAYS_USE_MPI$"
37        test_for_string_in_file $cpp_options "^[ ]*#undef.*ALWAYS_USE_MPI$"
38  }  }
39    
40  # Search for particular string in a file. Return 1 if detected, 0 if not  # Search for particular string in a file. Return 1 if detected, 0 if not
# Line 39  test_for_string_in_file() { Line 47  test_for_string_in_file() {
47      if test "x${RETVAL}" = x0 ; then      if test "x${RETVAL}" = x0 ; then
48          printf "Error: In $file there is an illegal line: "          printf "Error: In $file there is an illegal line: "
49          grep -i "$strng" $file          grep -i "$strng" $file
50          return 1          exit 99
51      fi      fi
52      return 0      return 0
53  }  }
# Line 317  find_possible_configs()  { Line 325  find_possible_configs()  {
325    
326      #================================================================      #================================================================
327      #  look for possible C compilers      #  look for possible C compilers
328      tmp="$MITGCM_CC $CC gcc c89 cc c99 mpicc"      tmp="$MITGCM_CC $CC gcc c89 cc c99 mpicc icc"
329      p_CC=      p_CC=
330      for c in $tmp ; do      for c in $tmp ; do
331          rm -f ./genmake_hello.c  ./genmake_hello          rm -f ./genmake_hello.c  ./genmake_hello
# Line 356  EOF Line 364  EOF
364    
365      #================================================================      #================================================================
366      #  look for possible FORTRAN compilers      #  look for possible FORTRAN compilers
367      tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95 gfortran"      tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc ifort f90 f95 mpif77 mpf77 mpxlf95 gfortran g95"
368      p_FC=      p_FC=
369      for c in $tmp ; do      for c in $tmp ; do
370          rm -f ./hello.f ./hello          rm -f ./hello.f ./hello
# Line 570  Usage: "$0" [OPTIONS] Line 578  Usage: "$0" [OPTIONS]
578            *only* works if it is supported by the OPTFILE that            *only* works if it is supported by the OPTFILE that
579            is being used.            is being used.
580    
581        -ignoretime | -ignore_time | --ignoretime | --ignore_time
582              Ignore all the "wall clock" routines entirely.  This will
583              not in any way hurt the model results -- it simply means
584              that the code that checks how long the model spends in
585              various routines will give junk values.
586    
587      -ts | --ts      -ts | --ts
588            Produce timing information per timestep            Produce timing information per timestep
589      -papis | --papis      -papis | --papis
590            Produce summary MFlop/s with PAPI per timestep            Produce summary MFlop/s (and IPC) with PAPI per timestep
591        -pcls | --pcls
592              Produce summary MFlop/s etc. with PCL per timestep
593      -foolad | --foolad      -foolad | --foolad
594            Fool the AD code generator            Fool the AD code generator
595      -papi | --papi      -papi | --papi
596            Performance analysis with PAPI            Performance analysis with PAPI
597        -pcl | --pcl
598              Performance analysis with PCL
599      -hpmt | --hpmt      -hpmt | --hpmt
600            Performance analysis with the HPM Toolkit            Performance analysis with the HPM Toolkit
601    
602      -gsl | --gsl      -gsl | --gsl
603            Use GSL to control floating point rounding and precision            Use GSL to control floating point rounding and precision
604        -devel | --devel
605              Add additional warning and debugging flags for development
606    
607      -mpi | --mpi      -mpi | --mpi
608            Include MPI header files and link to MPI libraries            Include MPI header files and link to MPI libraries
# Line 749  EOF Line 769  EOF
769    
770    
771  check_HAVE_SIGREG()  {  check_HAVE_SIGREG()  {
772        if test ! "x$HAVE_SIGREG" = x ; then
773            return
774        fi
775      get_fortran_c_namemangling      get_fortran_c_namemangling
776      cat <<EOF > genmake_tc_1.c      cat <<EOF > genmake_tc_1.c
777  $FC_NAMEMANGLE  $FC_NAMEMANGLE
# Line 806  EOF Line 829  EOF
829    
830    
831  check_HAVE_SETRLSTK()  {  check_HAVE_SETRLSTK()  {
832        if test "x$HAVE_SETRLSTK" = xt ; then
833            DEFINES="$DEFINES -DHAVE_SETRLSTK"
834            return
835        fi  
836        if test ! "x$HAVE_SETRLSTK" = x ; then
837            return
838        fi
839      get_fortran_c_namemangling      get_fortran_c_namemangling
840      cat <<EOF > genmake_tc_1.c      cat <<EOF > genmake_tc_1.c
841  $FC_NAMEMANGLE  $FC_NAMEMANGLE
# Line 916  EOF Line 946  EOF
946      cat genmake_tnc.F >> genmake_tnc.log      cat genmake_tnc.F >> genmake_tnc.log
947      echo "===  genmake_tnc.F  ===" >> genmake_tnc.log      echo "===  genmake_tnc.F  ===" >> genmake_tnc.log
948      RET_CPP=f      RET_CPP=f
949      COMM="$CPP $DEFINES $INCLUDES genmake_tnc.F"      COMM="cat genmake_tnc.F | $CPP $DEFINES $INCLUDES"
950      echo "$COMM" >> genmake_tnc.log      echo "$COMM" >> genmake_tnc.log
951      $COMM > genmake_tnc.$FS 2>/dev/null  &&  RET_CPP=t      eval $COMM > genmake_tnc.$FS 2>/dev/null  &&  RET_CPP=t
952      if test "x$RET_CPP" = xf ; then      if test "x$RET_CPP" = xf ; then
953          echo "  WARNING: CPP failed to pre-process the netcdf test." \          echo "  WARNING: CPP failed to pre-process the netcdf test." \
954              >> genmake_tnc.log              >> genmake_tnc.log
# Line 926  EOF Line 956  EOF
956              >> genmake_tnc.log              >> genmake_tnc.log
957      fi      fi
958      echo "$FC $FFLAGS $FOPTIM -c genmake_tnc.$FS  \ " >> genmake_tnc.log      echo "$FC $FFLAGS $FOPTIM -c genmake_tnc.$FS  \ " >> genmake_tnc.log
959      echo "  &&  $LINK -o genmake_tnc.o $LIBS" >> genmake_tnc.log      echo "  &&  $LINK $FFLAGS $FOPTIM -o genmake_tnc.o $LIBS" >> genmake_tnc.log
960      $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1  \      $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1  \
961          &&  $LINK -o genmake_tnc genmake_tnc.o $LIBS >> genmake_tnc.log 2>&1          &&  $LINK $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.o $LIBS >> genmake_tnc.log 2>&1
962      RET_COMPILE=$?      RET_COMPILE=$?
963      cat genmake_tnc.log >> genmake_warnings      cat genmake_tnc.log >> genmake_warnings
964    
# Line 944  EOF Line 974  EOF
974      else      else
975          # try again with "-lnetcdf" added to the libs          # try again with "-lnetcdf" added to the libs
976          echo "try again with added '-lnetcdf'" > genmake_tnc.log          echo "try again with added '-lnetcdf'" > genmake_tnc.log
977          echo "$CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS \ " >> genmake_tnc.log          echo "cat genmake_tnc.F | $CPP $DEFINES $INCLUDES > genmake_tnc.$FS \ " >> genmake_tnc.log
978          echo " &&  $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS \ " >> genmake_tnc.log          echo " &&  $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS \ " >> genmake_tnc.log
979          echo " &&  $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf" >> genmake_tnc.log          echo " &&  $LINK $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf" >> genmake_tnc.log
980          $CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS 2>/dev/null  \          cat genmake_tnc.F | $CPP $DEFINES $INCLUDES > genmake_tnc.$FS 2>/dev/null  \
981              &&  $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1  \              &&  $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1  \
982              &&  $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf >> genmake_tnc.log 2>&1              &&  $LINK $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf >> genmake_tnc.log 2>&1
983          RET_COMPILE=$?          RET_COMPILE=$?
984          cat genmake_tnc.log >> genmake_warnings          cat genmake_tnc.log >> genmake_warnings
985          if test "x$RET_COMPILE" = x0 ; then          if test "x$RET_COMPILE" = x0 ; then
986              LIBS="$LIBS -lnetcdf"              LIBS="$LIBS -lnetcdf"
987              HAVE_NETCDF=t              HAVE_NETCDF=t
988            else
989            # try again with "-lnetcdff" added to the libs
990                echo "try again with added '-lnetcdff -lnetcdf'" > genmake_tnc.log
991                echo "cat genmake_tnc.F | $CPP $DEFINES $INCLUDES > genmake_tnc.$FS \ " >> genmake_tnc.log
992                echo " &&  $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS \ " >> genmake_tnc.log
993                echo " &&  $LINK $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf" >> genmake_tnc.log
994                cat genmake_tnc.F | $CPP $DEFINES $INCLUDES > genmake_tnc.$FS 2>/dev/null  \
995                    &&  $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1  \
996                    &&  $LINK $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.o $LIBS -lnetcdff -lnetcdf >> genmake_tnc.log 2>&1
997                RET_COMPILE=$?
998                cat genmake_tnc.log >> genmake_warnings
999                if test "x$RET_COMPILE" = x0 ; then
1000                    LIBS="$LIBS -lnetcdff -lnetcdf"
1001                    HAVE_NETCDF=t
1002                fi
1003          fi          fi
1004      fi      fi
1005      rm -f genmake_tnc*      rm -f genmake_tnc*
# Line 1002  MPI= Line 1047  MPI=
1047  MPIPATH=  MPIPATH=
1048  TS=  TS=
1049  PAPIS=  PAPIS=
1050    PCLS=
1051  FOOLAD=  FOOLAD=
1052  PAPI=  PAPI=
1053    PCL=
1054  HPMT=  HPMT=
1055  GSL=  GSL=
1056    DEVEL=
1057  HAVE_TEST_L=  HAVE_TEST_L=
1058    
1059  # DEFINES checked by test compilation or command-line  # DEFINES checked by test compilation or command-line
# Line 1013  HAVE_SYSTEM= Line 1061  HAVE_SYSTEM=
1061  HAVE_FDATE=  HAVE_FDATE=
1062  FC_NAMEMANGLE=  FC_NAMEMANGLE=
1063  HAVE_CLOC=  HAVE_CLOC=
1064  HAVE_SETRLSTK=  # HAVE_SETRLSTK=
1065  HAVE_STAT=  HAVE_STAT=
1066  HAVE_NETCDF=  HAVE_NETCDF=
1067  HAVE_ETIME=  HAVE_ETIME=
# Line 1064  TAMC_EXTRA= Line 1112  TAMC_EXTRA=
1112    
1113  #  The following state can be set directly by command-line switches  #  The following state can be set directly by command-line switches
1114  gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE"  gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE"
1115  gm_s2="FC CPP IEEE TS PAPIS PAPI HPMT GSL MPI JAM DUMPSTATE STANDARDDIRS"  gm_s2="FC CPP IEEE TS PAPIS PCLS PAPI PCL HPMT GSL DEVEL MPI JAM DUMPSTATE STANDARDDIRS"
1116    
1117  #  The following state is not directly set by command-line switches  #  The following state is not directly set by command-line switches
1118  gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM "  gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM "
# Line 1248  for ac_option in "$@" ; do Line 1296  for ac_option in "$@" ; do
1296              TS=true ;;              TS=true ;;
1297          -papis | --papis)          -papis | --papis)
1298              PAPIS=true ;;              PAPIS=true ;;
1299            -pcls | --pcls)
1300                PCLS=true ;;
1301          -foolad | --foolad)          -foolad | --foolad)
1302              FOOLAD=true ;;              FOOLAD=true ;;
1303          -papi | --papi)          -papi | --papi)
1304              PAPI=true ;;              PAPI=true ;;
1305            -pcl | --pcl)
1306                PCL=true ;;
1307          -hpmt | --hpmt)          -hpmt | --hpmt)
1308              HPMT=true ;;              HPMT=true ;;
1309    
1310          -gsl | --gsl)          -gsl | --gsl)
1311              GSL=true ;;              GSL=true ;;
1312    
1313            -devel | --devel)
1314                DEVEL=true ;;
1315    
1316          -mpi | --mpi)          -mpi | --mpi)
1317              MPI=true ;;              MPI=true ;;
1318          -mpi=* | --mpi=*)          -mpi=* | --mpi=*)
# Line 1318  fi Line 1373  fi
1373  #  Find the MITgcm ${ROOTDIR}  #  Find the MITgcm ${ROOTDIR}
1374  if test "x${ROOTDIR}" = x ; then  if test "x${ROOTDIR}" = x ; then
1375      tmp=`echo $PWD | sed -e 's/\// /g' | $AWK '{print $NR}'`      tmp=`echo $PWD | sed -e 's/\// /g' | $AWK '{print $NR}'`
1376      if test "x$tmp" = "xbin" -a -d ../model -a -d ../eesup -a -d ../pkg ; then      if test "x$tmp" = "xbin" -a -d ../model -a -d ../eesupp -a -d ../pkg ; then
1377          ROOTDIR=".."          ROOTDIR=".."
1378      else      else
1379          for d in . .. ../.. ../../.. ../../../.. ../../../../.. ; do          for d in . .. ../.. ../../.. ../../../.. ../../../../.. ; do
# Line 1520  if test ! "x$PAPIS" = x ; then Line 1575  if test ! "x$PAPIS" = x ; then
1575        INCLUDES="$INCLUDES $PAPIINC"        INCLUDES="$INCLUDES $PAPIINC"
1576        LIBS="$LIBS $PAPILIB"        LIBS="$LIBS $PAPILIB"
1577  fi  fi
1578    if test ! "x$PCLS" = x ; then
1579          echo "  Turning on PCL counter summary per timestep"
1580          echo "  Please make sure PCLINC, PCLLIB are defined"
1581          if test ! "x$FOOLAD" = x ; then
1582                DEFINES="$DEFINES -DUSE_PCL_FLOPS_SFP"
1583          else
1584                DEFINES="$DEFINES -DUSE_PCL_FLOPS"
1585          fi
1586          INCLUDES="$INCLUDES $PCLINC"
1587          LIBS="$LIBS $PCLLIB"
1588    fi
1589  if test ! "x$PAPI" = x ; then  if test ! "x$PAPI" = x ; then
1590        if test ! "x$PAPIS" = x ; then        if test ! "x$PAPIS" = x ; then
1591            echo "  PAPI performance analysis and flop summary per timestep cannot co-exist!"            echo "  PAPI performance analysis and flop summary per timestep cannot co-exist!"
# Line 1532  if test ! "x$PAPI" = x ; then Line 1598  if test ! "x$PAPI" = x ; then
1598            LIBS="$LIBS $PAPILIB"            LIBS="$LIBS $PAPILIB"
1599        fi        fi
1600  fi  fi
1601    if test ! "x$PCL" = x ; then
1602          if test ! "x$PCLS" = x ; then
1603              echo "  PCL performance analysis and flop summary per timestep cannot co-exist!"
1604              echo "  Sticking with PCL flop summary per timestep!"
1605          else
1606              echo "  Turning on performance analysis with PCL"
1607              echo "  Please make sure PCLINC, PCLLIB are defined"
1608              DEFINES="$DEFINES -DUSE_PCL"
1609              INCLUDES="$INCLUDES $PCLINC"
1610              LIBS="$LIBS $PCLLIB"
1611          fi
1612    fi
1613  if test ! "x$HPMT" = x ; then  if test ! "x$HPMT" = x ; then
1614        if test ! "x$PAPI" = x ; then        if test ! "x$PAPI" = x ; then
1615            echo "  PAPI and the HPM Toolkit cannot co-exist!"            echo "  PAPI and the HPM Toolkit cannot co-exist!"
1616            echo "  Sticking with PAPI!"            echo "  Sticking with PAPI!"
1617          else if test ! "x$PCL" = x ; then
1618              echo "  PCL and the HPM Toolkit cannot co-exist!"
1619              echo "  Sticking with PCL!"
1620        else        else
1621            echo "  Turning on performance analysis with the HPM Toolkit"            echo "  Turning on performance analysis with the HPM Toolkit"
1622            echo "  Please make sure HPMTINC, HPMTLIB are defined"            echo "  Please make sure HPMTINC, HPMTLIB are defined"
# Line 1543  if test ! "x$HPMT" = x ; then Line 1624  if test ! "x$HPMT" = x ; then
1624            INCLUDES="$INCLUDES $HPMTINC"            INCLUDES="$INCLUDES $HPMTINC"
1625            LIBS="$LIBS $HPMTLIB"            LIBS="$LIBS $HPMTLIB"
1626        fi        fi
1627          fi
1628  fi  fi
1629  if test ! "x$GSL" = x ; then  if test ! "x$GSL" = x ; then
1630        echo "  Turning on use of GSL to control floating point calculations"        echo "  Turning on use of GSL to control floating point calculations"
# Line 1630  rm -f genmake_t* Line 1712  rm -f genmake_t*
1712    
1713  printf "  Can we unlimit the stack size using $FC...  "  printf "  Can we unlimit the stack size using $FC...  "
1714  check_HAVE_SETRLSTK  check_HAVE_SETRLSTK
1715  if test "x$HAVE_SETRLSTK" != x ; then  if test "x$HAVE_SETRLSTK" = xt ; then
1716      echo "yes"      echo "yes"
1717  else  else
1718      echo "no"      echo "no"
# Line 1639  rm -f genmake_t* Line 1721  rm -f genmake_t*
1721    
1722  printf "  Can we register a signal handler using $FC...  "  printf "  Can we register a signal handler using $FC...  "
1723  check_HAVE_SIGREG  check_HAVE_SIGREG
1724  if test "x$HAVE_SIGREG" != x ; then  if test "x$HAVE_SIGREG" = xt ; then
1725      echo "yes"      echo "yes"
1726  else  else
1727      echo "no"      echo "no"
# Line 1757  if test -r $ROOTDIR"/eesupp/src/Makefile Line 1839  if test -r $ROOTDIR"/eesupp/src/Makefile
1839      fi      fi
1840  fi  fi
1841    
1842  #same for exch2  #same for pkg/exch2 and pkg/regrid
1843  if test -r $ROOTDIR"/pkg/exch2/Makefile" ; then  for pdir in exch2 regrid ; do
1844      echo "  Making source files in exch2 from  templates"      if test -r $ROOTDIR"/pkg/${pdir}/Makefile" ; then
1845      ( cd $ROOTDIR"/pkg/exch2/" && $MAKE ) > make_exch2.errors 2>&1          echo "  Making source files in pkg/${pdir} from templates"
1846      RETVAL=$?          ( cd $ROOTDIR"/pkg/"${pdir} && $MAKE ) > make_${pdir}.errors 2>&1
1847      if test "x${RETVAL}" = x0 ; then          RETVAL=$?
1848          rm -f make_exch2.errors          if test "x${RETVAL}" = x0 ; then
1849      else              rm -f make_${pdir}.errors
1850          echo "Error: problem encountered while building source files in exch2:"          else
1851          cat make_exch2.errors 1>&2              echo "Error: problem encountered while building source files in pkg/${pdir}:"
1852          exit 1              cat make_${pdir}.errors 1>&2
1853                exit 1
1854            fi
1855      fi      fi
1856  fi  done
1857    
1858  printf "\n===  Determining package settings  ===\n"  printf "\n===  Determining package settings  ===\n"
1859  if  test "x${PDEPEND}" = x ; then  if  test "x${PDEPEND}" = x ; then
# Line 2144  if test ! "x$DIVA" = x ; then Line 2228  if test ! "x$DIVA" = x ; then
2228          perl -i -pe 's/MPI_DISPLACEMENT_CURRENT=-1_8/MPI_DISPLACEMENT_CURRENT=-1/g' mpi_headers/mpif.h          perl -i -pe 's/MPI_DISPLACEMENT_CURRENT=-1_8/MPI_DISPLACEMENT_CURRENT=-1/g' mpi_headers/mpif.h
2229      else      else
2230          echo " We cannot create a copy of mpif.h!"          echo " We cannot create a copy of mpif.h!"
2231          exit -1  #       exit -1
2232      fi      fi
2233  fi  fi
2234    
# Line 2395  lib: libmitgcmuv.a Line 2479  lib: libmitgcmuv.a
2479    
2480  libmitgcmuv.a: \$(OBJFILES)  libmitgcmuv.a: \$(OBJFILES)
2481          ar rcv libmitgcmuv.a \$(OBJFILES)          ar rcv libmitgcmuv.a \$(OBJFILES)
2482            ar d   libmitgcmuv.a main.o
2483    
2484  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(SPECIAL_FILES)  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(SPECIAL_FILES)
2485    
# Line 2405  output.txt: \$(EXECUTABLE) Line 2490  output.txt: \$(EXECUTABLE)
2490          @\$(EXECUTABLE) > \$@          @\$(EXECUTABLE) > \$@
2491    
2492  clean:  clean:
2493          -rm -rf *.o *.$FS *.p *.$FS90 *.mod ${RMFILES} work.{pc,pcl} *.template          -rm -rf *.p *.$FS90 *.mod ${RMFILES} work.{pc,pcl} *.template
2494            -rm -rf *.o
2495            -rm -rf *.$FS
2496  Clean:  Clean:
2497          @make clean          @make clean
2498          @make cleanlinks          @make cleanlinks
# Line 2416  CLEAN: Line 2503  CLEAN:
2503          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
2504          -find \$(EXEDIR) -name "*.data" -exec rm {} \;          -find \$(EXEDIR) -name "*.data" -exec rm {} \;
2505          -find \$(EXEDIR) -name "fort.*" -exec rm {} \;          -find \$(EXEDIR) -name "fort.*" -exec rm {} \;
2506          -rm -f \$(EXECUTABLE) output.txt STD*          -rm -f \$(EXECUTABLE) \$(EXE_AD) *.txt STD* *diagnostics.log datetime
2507            -rm -rf mnc_test_*
2508    
2509  #eh3 Makefile: makefile  #eh3 Makefile: makefile
2510  makefile:  makefile:
# Line 2474  cat >>$MAKEFILE <<EOF Line 2562  cat >>$MAKEFILE <<EOF
2562          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@
2563  .$FS.o:  .$FS.o:
2564          \$(FC) \$(FFLAGS) \$(FOPTIM) -c \$<          \$(FC) \$(FFLAGS) \$(FOPTIM) -c \$<
2565  .F90.$FS90:  .F90.o:  
         \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@  
 .$FS90.o:  
2566          \$(F90C) \$(F90FLAGS) \$(F90OPTIM) -c \$<          \$(F90C) \$(F90FLAGS) \$(F90OPTIM) -c \$<
2567  .c.o:  .c.o:
2568          \$(CC) \$(CFLAGS) \$(DEFINES) \$(INCLUDES) -c \$<          \$(CC) \$(CFLAGS) \$(DEFINES) \$(INCLUDES) -c \$<
# Line 2503  ad_vars="$ad_vars FTL_TAMC_FLAGS FTL_TAF Line 2589  ad_vars="$ad_vars FTL_TAMC_FLAGS FTL_TAF
2589  ad_vars="$ad_vars SVD_TAMC_FLAGS SVD_TAF_FLAGS"  ad_vars="$ad_vars SVD_TAMC_FLAGS SVD_TAF_FLAGS"
2590  for i in $ad_vars ; do  for i in $ad_vars ; do
2591      name=$i      name=$i
2592      t1="t2=\$"`echo $i`      t1="t2=\$"`echo "$i"`
2593      eval $t1      eval $t1
2594      printf "%-20s = " $name >> $MAKEFILE      printf "%-20s = " $name >> $MAKEFILE
2595      echo $t2 >> $MAKEFILE      echo "$t2" | sed -e 's| \+| |g' >> $MAKEFILE
2596  done  done
2597    
2598  echo "  Add the source list for AD code generation"  echo "  Add the source list for AD code generation"
# Line 2523  rm -f ad_files Line 2609  rm -f ad_files
2609  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
2610    
2611  # ... AD ...  # ... AD ...
2612  adall: ad_taf  adall: \$(EXE_AD)
2613  adtaf: ad_taf_output.$FS  adtaf: ad_taf_output.$FS
2614  adtamc: ad_tamc_output.$FS  adtamc: ad_tamc_output.$FS
2615    
# Line 2543  adtafonly: Line 2629  adtafonly:
2629          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS
2630          cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS          cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS
2631    
2632  ad_taf: ad_taf_output.o \$(OBJFILES)  \${EXE_AD}: ad_taf_output.o \$(OBJFILES)
2633          \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o \$(LIBS)          \$(LINK) -o \${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o \$(LIBS)
2634    
2635  ad_tamc_output.$FS: ad_input_code.$FS  ad_tamc_output.$FS: ad_input_code.$FS
2636          \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS          \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS

Legend:
Removed from v.1.142  
changed lines
  Added in v.1.160

  ViewVC Help
Powered by ViewVC 1.1.22