/[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.265 by jmc, Fri Apr 4 21:34:01 2014 UTC revision 1.278 by jmc, Fri Jan 15 22:08:17 2016 UTC
# Line 22  Usage: "$0" [OPTIONS] Line 22  Usage: "$0" [OPTIONS]
22      -oad | --oad      -oad | --oad
23            Generate a Makefile for an OpenAD built            Generate a Makefile for an OpenAD built
24    
25        -nocat4ad | -dog4ad | -ncad | -dad
26              do not concatenate (cat) source code sent to TAF
27              resulting in compilation of multiple files
28    
29      -adoptfile NAME | --adoptfile NAME | -adof NAME | --adof NAME      -adoptfile NAME | --adoptfile NAME | -adof NAME | --adof NAME
30        -adoptfile=NAME | --adoptfile=NAME | -adof=NAME | --adof=NAME        -adoptfile=NAME | --adoptfile=NAME | -adof=NAME | --adof=NAME
31            Use "NAME" as the adoptfile.  By default, the file at            Use "NAME" as the adoptfile.  By default, the file at
32            "tools/adjoint_options/adjoint_oad" (for OpenAD built) or            "tools/adjoint_options/adjoint_oad" (for OpenAD built) or
33            "tools/adjoint_options/adjoint_default" will be used.            "tools/adjoint_options/adjoint_default" will be used.
34    
35      -nooptfile | --nooptfile      -optfile NAME | --optfile NAME | -of NAME | --of NAME
       -optfile NAME | --optfile NAME | -of NAME | --of NAME  
36        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME
37            Use "NAME" as the optfile.  By default, an attempt will be            Use "NAME" as the optfile.  By default, an attempt will be
38            made to find an appropriate "standard" optfile in the            made to find an appropriate "standard" optfile in the
# Line 1083  EOF Line 1086  EOF
1086  }  }
1087    
1088  check_lapack_libs()  {  check_lapack_libs()  {
1089      if test ! "x$SKIP_LAPACK_CHECK" = x ; then      if test "x$CHECK_FOR_LAPACK" = xf ; then return ; fi
         return  
     fi  
1090      echo >> $LOGFILE      echo >> $LOGFILE
1091      echo "running: check_lapack_libs()" >> $LOGFILE      echo "running: check_lapack_libs()" >> $LOGFILE
1092      cat <<EOF > genmake_tla.F      cat <<EOF > genmake_tla.F
# Line 1281  GSL= Line 1282  GSL=
1282  DEVEL=  DEVEL=
1283  HAVE_TEST_L=  HAVE_TEST_L=
1284    
1285  # comment this line out to enable lapack test  # set this to "t" to enable lapack test
1286  SKIP_LAPACK_CHECK=t  CHECK_FOR_LAPACK=f
1287    
1288  # DEFINES checked by test compilation or command-line  # DEFINES checked by test compilation or command-line
1289  HAVE_SYSTEM=  HAVE_SYSTEM=
# Line 1331  FS90= Line 1332  FS90=
1332  AUTODIFF_PKG_USED=f  AUTODIFF_PKG_USED=f
1333  OPENAD=  OPENAD=
1334  AD_OPTFILE=  AD_OPTFILE=
1335    CAT_SRC_FOR_TAF=1
1336  TAF=  TAF=
1337  AD_TAF_FLAGS=  AD_TAF_FLAGS=
1338  FTL_TAF_FLAGS=  FTL_TAF_FLAGS=
# Line 1405  for ac_option in "$@" ; do Line 1407  for ac_option in "$@" ; do
1407          -help | --help | -h | --h)          -help | --help | -h | --h)
1408              usage ;;              usage ;;
1409    
         -nooptfile | --nooptfile)  
             OPTFILE="NONE" ;;  
1410          -optfile | --optfile | -of | --of)          -optfile | --optfile | -of | --of)
1411              ac_prev=OPTFILE ;;              ac_prev=OPTFILE ;;
1412          -optfile=* | --optfile=* | -of=* | --of=*)          -optfile=* | --optfile=* | -of=* | --of=*)
1413              OPTFILE=$ac_optarg ;;              OPTFILE=$ac_optarg ;;
1414    
1415          -oad | --oad)          -oad | --oad)
1416              OPENAD="true" ;;              OPENAD="true" ; ALWAYS_USE_F90=1 ;;
1417            -nocat4ad | -dog4ad | -ncad | -dad)
1418                CAT_SRC_FOR_TAF=0 ;;
1419          -adoptfile | --adoptfile | -adof | --adof)          -adoptfile | --adoptfile | -adof | --adof)
1420              ac_prev=AD_OPTFILE ;;              ac_prev=AD_OPTFILE ;;
1421          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)
# Line 1585  done Line 1587  done
1587    
1588  #TMP=./genmk_$$  #TMP=./genmk_$$
1589  #- try to put temporary files in system-local /tmp dir  #- try to put temporary files in system-local /tmp dir
1590  TMP=/tmp/genmk_$$  TMP=/tmp/genmk_${USER}_$$
1591  touch $TMP ; retVal=$?  touch $TMP ; retVal=$?
1592  if [ $retVal -eq 0 ] ; then  if [ $retVal -eq 0 ] ; then
1593    if test ! -r $TMP ; then TMP=./genmk_$$ ; fi    if test ! -r $TMP ; then TMP=./genmk_$$ ; fi
# Line 1959  else Line 1961  else
1961  fi  fi
1962  rm -f genmake_tcomp*  rm -f genmake_tcomp*
1963    
1964  printf "  Do we have the etime() command using $FC...  "  printf "  Do we have the etime() command using $FC... "
1965  cat > genmake_tcomp.$FS <<EOF  cat > genmake_tcomp_1.$FS <<EOF
1966        program hello        program hello
1967        REAL*4 ACTUAL, TARRAY(2)        REAL*4 actual, tarray(2)
1968        EXTERNAL ETIME        EXTERNAL ETIME
1969        REAL*4 ETIME        REAL*4 ETIME
1970        actual = etime( tarray )        actual = ETIME( tarray )
1971        print *, tarray        print *, tarray
1972        end        end
1973  EOF  EOF
1974  $FC $FFLAGS -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1  $FC $FFLAGS -o genmake_tcomp_1 genmake_tcomp_1.$FS > genmake_tcomp.log 2>&1
1975  RETVAL=$?  RETVAL=$?
1976  if test "x$RETVAL" = x0 ; then  if test "x$RETVAL" = x0 ; then
1977      HAVE_ETIME=t      HAVE_ETIME='Fct'
1978      DEFINES="$DEFINES -DHAVE_ETIME"      DEFINES="$DEFINES -DHAVE_ETIME_FCT"
1979      echo "yes"      echo " yes (${HAVE_ETIME})"
1980  else  else
1981      cat > genmake_tcomp_2.$FS <<EOF
1982          program hello
1983          REAL*4 actual, tarray(2)
1984          actual = -999.
1985          call ETIME( tarray, actual )
1986          if ( actual.ge.0. ) then
1987            print *, 0, tarray, actual
1988          else
1989            print *, 1, tarray, actual
1990          endif
1991          end
1992    EOF
1993      $FC $FFLAGS -o genmake_tcomp_2 genmake_tcomp_2.$FS >> genmake_tcomp.log 2>&1
1994      RETVAL=$?
1995      if test "x$RETVAL" = x0 ; then
1996        echo -n 'c,'
1997        ./genmake_tcomp_2 > genmake_tcomp_2.out 2>&1
1998        RETVAL=$?
1999      fi
2000      if test "x$RETVAL" = x0 ; then
2001        echo -n 'r:'
2002        RETVAL=`cat genmake_tcomp_2.out | $AWK '{print $1}'`
2003      fi
2004      if test "x$RETVAL" = x0 ; then
2005        HAVE_ETIME='SbR'
2006        DEFINES="$DEFINES -DHAVE_ETIME_SBR"
2007        echo " yes (${HAVE_ETIME})"
2008      else
2009      HAVE_ETIME=      HAVE_ETIME=
2010      echo "no"      echo " no"
2011      fi
2012  fi  fi
2013    #mkdir chk_etime ; cp -p -f genmake_tcomp* chk_etime
2014  rm -f genmake_tcomp*  rm -f genmake_tcomp*
2015    
2016  printf "  Can we call simple C routines (here, \"cloc()\") using $FC...  "  printf "  Can we call simple C routines (here, \"cloc()\") using $FC...  "
# Line 2633  if test "x$OPENAD" != x ; then Line 2665  if test "x$OPENAD" != x ; then
2665      OAD_CB2M_FILES="/dev/null"      OAD_CB2M_FILES="/dev/null"
2666      OADTOOLS="$TOOLSDIR/OAD_support"      OADTOOLS="$TOOLSDIR/OAD_support"
2667      echo "  looking for dontCompile file:  "      echo "  looking for dontCompile file:  "
2668      for i in "." $MODS ; do      for i in "." $MODS $OADTOOLS ; do
2669          if test -r $i"/dontCompile" ; then          if test -r $i"/dontCompile" ; then
2670              OAD_DONT_COMPILE=$i"/dontCompile"              OAD_DONT_COMPILE=$i"/dontCompile"
2671              echo "     found $OAD_DONT_COMPILE"              echo "     found $OAD_DONT_COMPILE"
# Line 2641  if test "x$OPENAD" != x ; then Line 2673  if test "x$OPENAD" != x ; then
2673          fi          fi
2674      done      done
2675      echo "  looking for dontTransform file:  "      echo "  looking for dontTransform file:  "
2676      for i in "." $MODS ; do      for i in "." $MODS $OADTOOLS ; do
2677          if test -r $i"/dontTransform" ; then          if test -r $i"/dontTransform" ; then
2678              OAD_DONT_TRANSFORM=$i"/dontTransform"              OAD_DONT_TRANSFORM=$i"/dontTransform"
2679              echo "     found $OAD_DONT_TRANSFORM"              echo "     found $OAD_DONT_TRANSFORM"
# Line 2649  if test "x$OPENAD" != x ; then Line 2681  if test "x$OPENAD" != x ; then
2681          fi          fi
2682      done      done
2683      echo "  looking for keepOriginal file:  "      echo "  looking for keepOriginal file:  "
2684      for i in "." $MODS ; do      for i in "." $MODS $OADTOOLS ; do
2685          if test -r $i"/keepOriginal" ; then          if test -r $i"/keepOriginal" ; then
2686              OAD_KEEP_ORIGINAL=$i"/keepOriginal"              OAD_KEEP_ORIGINAL=$i"/keepOriginal"
2687              echo "     found $OAD_KEEP_ORIGINAL"              echo "     found $OAD_KEEP_ORIGINAL"
# Line 2657  if test "x$OPENAD" != x ; then Line 2689  if test "x$OPENAD" != x ; then
2689          fi          fi
2690      done      done
2691      echo "  looking for cb2mFiles:  "      echo "  looking for cb2mFiles:  "
2692      for i in "." $MODS ; do      for i in "." $MODS $OADTOOLS ; do
2693          if test -r $i"/cb2mFiles" ; then          if test -r $i"/cb2mFiles" ; then
2694              OAD_CB2M_FILES=$i"/cb2mFiles"              OAD_CB2M_FILES=$i"/cb2mFiles"
2695              echo "     found $OAD_CB2M_FILES"              echo "     found $OAD_CB2M_FILES"
# Line 2896  CPPINCLUDES = ${CPPINCLUDES} Line 2928  CPPINCLUDES = ${CPPINCLUDES}
2928  KFLAGS1 = ${KFLAGS1}  KFLAGS1 = ${KFLAGS1}
2929  KFLAGS2 = ${KFLAGS2}  KFLAGS2 = ${KFLAGS2}
2930  # Optim./debug for FC  # Optim./debug for FC
2931  FFLAGS = ${FFLAGS} ${FEXTRAFLAGS}  FFLAGS = ${FFLAGS}
2932  FOPTIM = ${FOPTIM}  FOPTIM = ${FOPTIM} ${FEXTRAFLAGS}
2933  # Optim./debug for FC  # Optim./debug for FC
2934  F90FLAGS = ${F90FLAGS}  F90FLAGS = ${F90FLAGS}
2935  F90OPTIM = ${F90OPTIM}  F90OPTIM = ${F90OPTIM}
# Line 2973  links: \$(F77_SRC_FILES) \$(C_SRC_FILES) Line 3005  links: \$(F77_SRC_FILES) \$(C_SRC_FILES)
3005    
3006  small_f: \$(F77_PP_SRC_FILES) \$(F90_PP_SRC_FILES)  small_f: \$(F77_PP_SRC_FILES) \$(F90_PP_SRC_FILES)
3007    
 # output.txt: \$(EXECUTABLE)  
 #       @printf 'running ... '  
 #       @\$(EXECUTABLE) > \$@  
   
3008  # remove most of the files that "make" generates  # remove most of the files that "make" generates
3009  clean:  clean:
3010          -rm -rf *.p *.$FS90 *.mod ${RMFILES} work.{pc,pcl} *.template          -rm -rf *.p *.$FS90 *.mod ${RMFILES} work.{pc,pcl} *.template
# Line 3128  done Line 3156  done
3156  echo >> $MAKEFILE  echo >> $MAKEFILE
3157  rm -f $TMP.adSrcFiles  rm -f $TMP.adSrcFiles
3158    
3159    if test $CAT_SRC_FOR_TAF = 0 ; then
3160    cat >>$MAKEFILE <<EOF
3161    
3162    # ... Utilities ...
3163    remove_comments:
3164            sed -i.bak -f \$(TOOLSDIR)/remove_comments_sed \$(AD_FILES)
3165            @-rm -f \$(AD_FILES:.$FS=.$FS.bak)
3166    adj_sed:
3167            sed -i.bak -f \$(TOOLSDIR)/adjoint_sed \$(AD_FILES:.$FS=_ad.$FS)
3168            @-rm -f \$(AD_FILES:.$FS=_ad.$FS.bak)
3169    ftl_sed:
3170            sed -i.bak -f \$(TOOLSDIR)/adjoint_sed \$(AD_FILES:.$FS=_tl.$FS)
3171            @-rm -f \$(AD_FILES:.$FS=_tl.$FS.bak)
3172    adobjfiles: \$(AD_FILES:.$FS=_ad.o)
3173    ftlobjfiles: \$(AD_FILES:.$FS=_tl.o)
3174    EOF
3175    fi
3176    
3177  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
3178    
3179  # ... AD ...  # ... AD ...
# Line 3150  ad_input_code.$FS: \$(AD_FILES) \$(AD_FL Line 3196  ad_input_code.$FS: \$(AD_FILES) \$(AD_FL
3196          @\$(MAKE) -f \$(MAKEFILE) \$(FLOWFILES)          @\$(MAKE) -f \$(MAKEFILE) \$(FLOWFILES)
3197          cat \$(FLOWFILES) \$(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
3198    
3199  ad_taf_output.$FS: ad_input_code.$FS  adtafonly:
         @-rm -f ad_input_code_ad.$FS ; echo ''  
3200          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS
3201          ls -l ad_input_code_ad.$FS          ls -l ad_input_code_ad.$FS
3202          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
3203    
3204  adtafonly:  EOF
3205    
3206    if test $CAT_SRC_FOR_TAF = 1 ; then
3207    cat >>$MAKEFILE <<EOF
3208    # ... send 1 file to TAF ...
3209    ad_taf_output.$FS: ad_input_code.$FS
3210            @-rm -f ad_input_code_ad.$FS ; echo ''
3211          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS
3212          ls -l ad_input_code_ad.$FS          ls -l ad_input_code_ad.$FS
3213          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
# Line 3164  adtafonly: Line 3215  adtafonly:
3215  \$(EXE_AD): \$(SPECIAL_FILES) \$(H_SRC_FILES) ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES)  \$(EXE_AD): \$(SPECIAL_FILES) \$(H_SRC_FILES) ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES)
3216          \$(LINK) -o \${EXE_AD} \$(FFLAGS) \$(FOPTIM) ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS)          \$(LINK) -o \${EXE_AD} \$(FFLAGS) \$(FOPTIM) ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS)
3217    
3218  ad_tamc_output.$FS: ad_input_code.$FS  adobj: ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o)
         \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS  
         cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_tamc_output.$FS  
3219    
3220  ad_tamc: ad_tamc_output.o \$(OBJFILES)  EOF
3221          \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS)  
3222    else
3223    cat >>$MAKEFILE <<EOF
3224    # ... send multiple files to TAF ...
3225    ad_taf_output.$FS: \$(AD_FLOW_FILES) \$(AD_FILES)
3226            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Adjoint version" -bAD_CONFIG_H -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
3227            cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3228            @-rm -f ad_config.template
3229            @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3230            @\$(MAKE) -f \$(MAKEFILE) \$(FLOWFILES)
3231            @-rm -f \$(AD_FILES:.$FS=_ad.$FS) \$(AD_FILES:.$FS=_ad.o); echo ''
3232            \$(MAKE) -f \$(MAKEFILE) remove_comments
3233            \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) \$(FLOWFILES) \$(AD_FILES)
3234            \$(MAKE) -f \$(MAKEFILE) adj_sed
3235            cat \$(AD_FILES:.$FS=_ad.$FS) > ad_taf_output.$FS
3236    
3237    \$(EXE_AD): \$(SPECIAL_FILES) \$(H_SRC_FILES) ad_taf_output.$FS \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES)
3238            \$(MAKE) -f \$(MAKEFILE) adobjfiles
3239            \$(LINK) -o \${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(AD_FILES:.$FS=_ad.o) \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS)
3240    
3241    adobj: ad_taf_output.$FS \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o)
3242            \$(MAKE) -f \$(MAKEFILE) adobjfiles
3243    
3244    EOF
3245    fi
3246    
3247    cat >>$MAKEFILE <<EOF
3248  adonlyfwd:  adonlyfwd:
3249          patch < \$(TOOLSDIR)/ad_taf_output.f.onlyfwd.diff          patch < \$(TOOLSDIR)/ad_taf_output.f.onlyfwd.diff
3250    
3251  adtrick:  adtrick:
3252          patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff          patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff
3253    
3254  adobj: ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o)  ad_tamc_output.$FS: ad_input_code.$FS
3255            \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS
3256            cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_tamc_output.$FS
3257    
3258    ad_tamc: ad_tamc_output.o \$(OBJFILES)
3259            \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS)
3260    
3261  # ... FTL ...  # ... FTL ...
3262  ftlall: ftl_exe_target  ftlall: ftl_exe_target
# Line 3199  ftl_input_code.$FS: \$(AD_FILES) Line 3278  ftl_input_code.$FS: \$(AD_FILES)
3278          @\$(MAKE) -f \$(MAKEFILE) \$(AD_FLOW_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(AD_FLOW_FILES)
3279          cat \$(AD_FLOW_FILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ftl_input_code.$FS          cat \$(AD_FLOW_FILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ftl_input_code.$FS
3280    
3281  ftl_taf_output.$FS: ftl_input_code.$FS  ftltafonly:
         @-rm -f ftl_input_code_tl.$FS ; echo ''  
3282          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS
3283          ls -l ftl_input_code_tl.$FS          ls -l ftl_input_code_tl.$FS
3284          cat ftl_input_code_tl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS          cat ftl_input_code_tl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS
3285    
3286  ftltafonly:  EOF
3287    
3288    if test $CAT_SRC_FOR_TAF = 1 ; then
3289    cat >>$MAKEFILE <<EOF
3290    # ... send 1 file to TAF ...
3291    ftl_taf_output.$FS: ftl_input_code.$FS
3292            @-rm -f ftl_input_code_tl.$FS ; echo ''
3293          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS
3294          ls -l ftl_input_code_tl.$FS          ls -l ftl_input_code_tl.$FS
3295          cat ftl_input_code_tl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS          cat ftl_input_code_tl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS
# Line 3213  ftltafonly: Line 3297  ftltafonly:
3297  \$(EXE_FTL): \$(SPECIAL_FILES) \$(H_SRC_FILES) ftl_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES)  \$(EXE_FTL): \$(SPECIAL_FILES) \$(H_SRC_FILES) ftl_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES)
3298          \$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) ftl_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS)          \$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) ftl_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS)
3299    
3300    EOF
3301    
3302    else
3303    cat >>$MAKEFILE <<EOF
3304    # ... send multiple files to TAF ...
3305    ftl_taf_output.$FS: \$(AD_FLOW_FILES) \$(AD_FILES)
3306            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "TangLin version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ad_config.template
3307            cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3308            @-rm -f ad_config.template
3309            @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3310            @\$(MAKE) -f \$(MAKEFILE) \$(AD_FLOW_FILES)
3311            @-rm -f \$(AD_FILES:.$FS=_tl.$FS) \$(AD_FILES:.$FS=_tl.o); echo ''
3312            \$(MAKE) -f \$(MAKEFILE) remove_comments
3313            \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) \$(AD_FLOW_FILES) \$(AD_FILES)
3314            \$(MAKE) -f \$(MAKEFILE) ftl_sed
3315            cat \$(AD_FILES:.$FS=_tl.$FS) > ftl_taf_output.$FS
3316    
3317    \$(EXE_FTL): \$(SPECIAL_FILES) \$(H_SRC_FILES) ftl_taf_output.$FS \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES)
3318            \$(MAKE) -f \$(MAKEFILE) ftlobjfiles
3319            \$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(AD_FILES:.$FS=_tl.o) \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS)
3320    
3321    EOF
3322    fi
3323    
3324    cat >>$MAKEFILE <<EOF
3325  ftl_tamc_output.$FS: ftl_input_code.$FS  ftl_tamc_output.$FS: ftl_input_code.$FS
3326          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS
3327          cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_tamc_output.$FS          cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_tamc_output.$FS
# Line 3335  OAD_active.F90 \ Line 3444  OAD_active.F90 \
3444  OAD_cp.F90 \  OAD_cp.F90 \
3445  OAD_rev.F90 \  OAD_rev.F90 \
3446  OAD_tape.F90 \  OAD_tape.F90 \
3447    OAD_regular_cp.F90 \
3448  revolve.F90  revolve.F90
3449    
3450  OPENAD_SUPPORT_C_SRC_FILES = \  OPENAD_SUPPORT_C_SRC_FILES = \
# Line 3376  AD_OBJ_FILES_S2=\$(AD_OBJ_FILES_S1) \$(N Line 3486  AD_OBJ_FILES_S2=\$(AD_OBJ_FILES_S1) \$(N
3486  small_f: \$(CB2M_F90_PP_SRC_FILES)  small_f: \$(CB2M_F90_PP_SRC_FILES)
3487  .PHONY: small_f  .PHONY: small_f
3488    
 # ad_output.txt: \$(EXE_AD)  
 #       @printf 'linking data files ... '  
 #       \$(LN) -f ../input_ad/data* ../input_ad/eedata .  
 #       \$(LN) -f ../../global_ocean.90x40x15/input/*.bin .  
 #       @printf 'running ... '  
 #       @./\$(EXE_AD) > \$@  
   
3489  ad_input_code.f$FS90:  \$(CB2M_AD_FILES)  ad_input_code.f$FS90:  \$(CB2M_AD_FILES)
3490          cat \$^ > \$@          cat \$^ > \$@
3491    

Legend:
Removed from v.1.265  
changed lines
  Added in v.1.278

  ViewVC Help
Powered by ViewVC 1.1.22