/[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.254 by heimbach, Wed Aug 7 16:20:03 2013 UTC revision 1.263 by jahn, Mon Jan 6 16:49:10 2014 UTC
# Line 208  test_for_string_in_file() { Line 208  test_for_string_in_file() {
208  expand_pkg_groups() {  expand_pkg_groups() {
209      new_packages=      new_packages=
210      if test -r $PKG_GROUPS ; then      if test -r $PKG_GROUPS ; then
211          cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > ./p1.tmp          cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > $TMP.p1
212          cat ./p1.tmp | $AWK '(NF>2 && $2==":"){ print $0 }' > ./p2.tmp          cat $TMP.p1 | $AWK '(NF>2 && $2==":"){ print $0 }' > $TMP.p2
213          matched=0          matched=0
214          for i in $PACKAGES ; do          for i in $PACKAGES ; do
215              line=`grep "^ *$i" ./p2.tmp`              line=`grep "^ *$i" $TMP.p2`
216              RETVAL=$?              RETVAL=$?
217              if test "x$RETVAL" = x0 ; then              if test "x$RETVAL" = x0 ; then
218                  matched=1                  matched=1
# Line 224  expand_pkg_groups() { Line 224  expand_pkg_groups() {
224              fi              fi
225          done          done
226          PACKAGES=$new_packages          PACKAGES=$new_packages
227          rm -f ./p[1,2].tmp          rm -f $TMP.p[1,2]
228          return $matched          return $matched
229      else      else
230          echo "Warning: can't read package groups definition file: $PKG_GROUPS"          echo "Warning: can't read package groups definition file: $PKG_GROUPS"
# Line 1351  gm_s3="FEXTRAFLAGS IEEE DEVEL GSL TS PAP Line 1351  gm_s3="FEXTRAFLAGS IEEE DEVEL GSL TS PAP
1351  gm_s4="LN S64 LINK PACKAGES INCLUDES FFLAGS FOPTIM"  gm_s4="LN S64 LINK PACKAGES INCLUDES FFLAGS FOPTIM"
1352  gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS"  gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS"
1353  gm_s6="PWD TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK"  gm_s6="PWD TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK"
1354  gm_s7="THISHOST THISUSER THISDATE THISVER MACHINE FC_NAMEMANGLE"  gm_s7="TMP THISHOST THISUSER THISDATE THISVER MACHINE FC_NAMEMANGLE"
1355  gm_s8="HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME HAVE_LAPACK HAVE_FLUSH"  gm_s8="HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME HAVE_LAPACK HAVE_FLUSH"
1356    
1357  #  The following are all related to adjoint/tangent-linear stuff  #  The following are all related to adjoint/tangent-linear stuff
# Line 1576  for ac_option in "$@" ; do Line 1576  for ac_option in "$@" ; do
1576    
1577  done  done
1578    
1579    #TMP=./genmk_$$
1580    #- try to put temporary files in system-local /tmp dir
1581    TMP=/tmp/genmk_$$
1582    touch $TMP ; retVal=$?
1583    if [ $retVal -eq 0 ] ; then
1584      if test ! -r $TMP ; then TMP=./genmk_$$ ; fi
1585    else
1586      TMP=./genmk_$$
1587    fi
1588    rm -f $TMP
1589    #echo "  temp files: $TMP.*"
1590    
1591  printf "  getting local config information:  "  printf "  getting local config information:  "
1592  if test -f $gm_local ; then  if test -f $gm_local ; then
1593      echo "using $gm_local"      echo "using $gm_local"
# Line 2237  if test "x${PKG_GROUPS}" != x ; then Line 2249  if test "x${PKG_GROUPS}" != x ; then
2249  fi  fi
2250    
2251  echo "  applying DISABLE settings"  echo "  applying DISABLE settings"
2252  echo "" > ./.tmp_pack  echo "" > $TMP.pack
2253  for i in $PACKAGES ; do  for i in $PACKAGES ; do
2254      echo $i >> ./.tmp_pack      echo $i >> $TMP.pack
2255  done  done
2256  for i in `grep  "-" ./.tmp_pack` ; do  for i in `grep  "-" $TMP.pack` ; do
2257      j=`echo $i | sed 's/[-]//'`      j=`echo $i | sed 's/[-]//'`
2258      DISABLE="$DISABLE $j"      DISABLE="$DISABLE $j"
2259  done  done
# Line 2259  for p in $PACKAGES ; do Line 2271  for p in $PACKAGES ; do
2271  done  done
2272  PACKAGES="$pack"  PACKAGES="$pack"
2273  echo "  applying ENABLE settings"  echo "  applying ENABLE settings"
2274  echo "" > ./.tmp_pack  echo "" > $TMP.pack
2275  PACKAGES="$PACKAGES $ENABLE"  PACKAGES="$PACKAGES $ENABLE"
2276  # Test if each explicitly referenced package exists  # Test if each explicitly referenced package exists
2277  for i in $PACKAGES ; do  for i in $PACKAGES ; do
# Line 2268  for i in $PACKAGES ; do Line 2280  for i in $PACKAGES ; do
2280          echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'"          echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'"
2281          exit 1          exit 1
2282      fi      fi
2283      echo $i >> ./.tmp_pack      echo $i >> $TMP.pack
2284  done  done
2285  PACKAGES=  PACKAGES=
2286  for i in `grep -v "-" ./.tmp_pack | sort | uniq` ; do  for i in `grep -v "-" $TMP.pack | sort | uniq` ; do
2287      PACKAGES="$PACKAGES $i"      PACKAGES="$PACKAGES $i"
2288  done  done
2289  rm -f ./.tmp_pack  rm -f $TMP.pack
2290  echo "    packages are: $PACKAGES"  echo "    packages are: $PACKAGES"
2291    
2292  #  Check for package MNC: if NetCDF is available, then build the MNC  #  Check for package MNC: if NetCDF is available, then build the MNC
# Line 2344  EOF Line 2356  EOF
2356      fi      fi
2357  fi  fi
2358    
2359  #  Check for package RADTRANS: if LAPACK is not available,  #  Make sure the openad package is enabled if using OpenAD
2360  #  then issue a warning that the direct radtrans solver is not available.  if test "x$OPENAD" != x ; then
2361  if test "x$HAVE_LAPACK" != xt ; then      echo " $PACKAGES " | grep ' openad ' > /dev/null 2>&1
     echo " $PACKAGES " | grep ' radtrans ' > /dev/null 2>&1  
2362      RETVAL=$?      RETVAL=$?
2363      if test "x$RETVAL" = x0 ; then      if test "x$RETVAL" != x0 ; then
2364          cat <<EOF          cat <<EOF
 *********************************************************************  
 WARNING: the "radtrans" package was enabled but tests failed to  
   compile LAPACK applications.  This means that the direct radtrans  
   solver is not available and compilation will fail if it is enabled.  
   If you want to use the direct solver, please check that:  
2365    
   1) LAPACK is correctly installed for this compiler and  
   2) the LIBS variable (within the "optfile") specifies the correct  
      LAPACK library to link against.  
2366  *********************************************************************  *********************************************************************
2367    ERROR: when generating an adjoint with OpenAD, the openad package
2368      must be enabled.  Please add it to packages.conf.
2369    *********************************************************************
2370    
2371  EOF  EOF
2372            exit 1
2373      fi      fi
2374  fi  fi
2375    
# Line 2553  fi Line 2561  fi
2561    
2562  #  Here, we build the list of files to be "run through" the adjoint  #  Here, we build the list of files to be "run through" the adjoint
2563  #  compiler.  #  compiler.
2564  if test -f ./adSrcFiles.tmp ; then  if test -f $TMP.adSrcFiles ; then
2565      rm -f ./adSrcFiles.tmp      rm -f $TMP.adSrcFiles
2566  fi  fi
2567  echo "  Creating the list of files for the adjoint compiler."  echo "  Creating the list of files for the adjoint compiler."
2568  touch adSrcFiles.tmp  touch $TMP.adSrcFiles
2569  for i in $SOURCEDIRS ; do  for i in $SOURCEDIRS ; do
2570      list_files=`( cd $i && ls -1 *.list 2>/dev/null )`      list_files=`( cd $i && ls -1 *.list 2>/dev/null )`
2571      for j in $list_files ; do      for j in $list_files ; do
2572          cat $i/$j >> adSrcFiles.tmp          cat $i/$j >> $TMP.adSrcFiles
2573      done      done
2574  done  done
2575  if test ! "x"$FS = "x.f" ; then  if test ! "x"$FS = "x.f" ; then
2576      cat adSrcFiles.tmp | sed -e "s/\.f/.$FS/g" > adSrcFiles.tmp_f      cat $TMP.adSrcFiles | sed -e "s/\.f/.$FS/g" > $TMP.adSrcFiles_f
2577      mv -f adSrcFiles.tmp_f adSrcFiles.tmp      mv -f $TMP.adSrcFiles_f $TMP.adSrcFiles
2578  fi  fi
2579    
2580  echo  echo
# Line 2588  if test ! "x$DIVA" = x -a ! "x$MPI" = x Line 2596  if test ! "x$DIVA" = x -a ! "x$MPI" = x
2596  fi  fi
2597    
2598  echo "  Determining the list of source and include files"  echo "  Determining the list of source and include files"
2599  rm -rf .links.tmp  rm -rf $TMP.links
2600  mkdir .links.tmp  mkdir $TMP.links
2601  touch .links.tmp/foo  touch $TMP.links/foo
2602  if test ! -r ".links.tmp/foo" ; then  if test ! -r "$TMP.links/foo" ; then
2603      echo      echo
2604      echo "ERROR : something is wrong with your directory permissions or"      echo "ERROR : something is wrong with your directory permissions or"
2605      echo "   your user file-creation mask (\"umask\") since creating a"      echo "   your user file-creation mask (\"umask\") since creating a"
# Line 2607  if test ! -r ".links.tmp/foo" ; then Line 2615  if test ! -r ".links.tmp/foo" ; then
2615      echo      echo
2616      exit 1      exit 1
2617  fi  fi
2618  rm -f .links.tmp/foo  rm -f $TMP.links/foo
2619    
2620  if test "x$OPENAD" != x ; then  if test "x$OPENAD" != x ; then
2621      OAD_DONT_COMPILE="/dev/null"      OAD_DONT_COMPILE="/dev/null"
# Line 2650  if test "x$OPENAD" != x ; then Line 2658  if test "x$OPENAD" != x ; then
2658      echo "   OpenAD exceptions:  "      echo "   OpenAD exceptions:  "
2659  fi  fi
2660    
2661  echo "# This section creates symbolic links" > srclinks.tmp  echo "# This section creates symbolic links" > $TMP.srclinks
2662  echo "" >> srclinks.tmp  echo "" >> $TMP.srclinks
2663  printf 'F77_SRC_FILES = ' > F77srclist.tmp  printf 'F77_SRC_FILES = ' > $TMP.F77srclist
2664  printf 'NON_AD_F77_SRC_FILES = ' > nonADF77srclist.tmp  printf 'NON_AD_F77_SRC_FILES = ' > $TMP.nonADF77srclist
2665  printf 'C_SRC_FILES = '   > csrclist.tmp  printf 'C_SRC_FILES = '   > $TMP.csrclist
2666  printf 'F90_SRC_FILES = ' > F90srclist.tmp  printf 'F90_SRC_FILES = ' > $TMP.F90srclist
2667  printf 'H_SRC_FILES = '   > hsrclist.tmp  printf 'H_SRC_FILES = '   > $TMP.hsrclist
2668  printf 'AD_FLOW_FILES = ' > ad_flow_files.tmp  printf 'AD_FLOW_FILES = ' > $TMP.ad_flow_files
2669  alldirs="$SOURCEDIRS $INCLUDEDIRS ."  alldirs="$SOURCEDIRS $INCLUDEDIRS ."
2670  for d in $alldirs ; do  for d in $alldirs ; do
2671      deplist=      deplist=
# Line 2667  for d in $alldirs ; do Line 2675  for d in $alldirs ; do
2675          sfiles=`( echo $sfiles | grep -v _cb2m\. )`          sfiles=`( echo $sfiles | grep -v _cb2m\. )`
2676      fi      fi
2677      for sf in $sfiles ; do      for sf in $sfiles ; do
2678          if test ! -r ".links.tmp/$sf" ; then          if test ! -r "$TMP.links/$sf" ; then
2679              if test -f "$d/$sf" ; then              if test -f "$d/$sf" ; then
2680                  ignore_f=f                  ignore_f=f
2681                  case $d/$sf in                  case $d/$sf in
# Line 2692  for d in $alldirs ; do Line 2700  for d in $alldirs ; do
2700                          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
2701                              ignore_f=t                              ignore_f=t
2702                          else                          else
2703                              touch .links.tmp/$sf                              touch $TMP.links/$sf
2704                              deplist="$deplist $sf"                              deplist="$deplist $sf"
2705                          fi                          fi
2706                          ;;                          ;;
# Line 2701  for d in $alldirs ; do Line 2709  for d in $alldirs ; do
2709                      extn=`echo $sf | $AWK -F. '{print $NF}'`                      extn=`echo $sf | $AWK -F. '{print $NF}'`
2710                      case $extn in                      case $extn in
2711                        F)                        F)
2712                          echo    " \\"  >> F77srclist.tmp                          echo    " \\"  >> $TMP.F77srclist
2713                          printf " $sf" >> F77srclist.tmp                          printf " $sf" >> $TMP.F77srclist
2714                          if test "x$OPENAD" != x ; then                          if test "x$OPENAD" = x ; then
2715                                basename=${sf%%.F}
2716                                isAD=`egrep ^$basename.f'[  ]*' $TMP.adSrcFiles`
2717                                if test -z "$isAD" ; then
2718                                    echo    " \\"  >> $TMP.nonADF77srclist
2719                                    printf " $sf" >> $TMP.nonADF77srclist
2720                                fi
2721                            else #- OpenAD case:
2722                              basename=${sf%%.F}                              basename=${sf%%.F}
2723                              isAD=`egrep ^$basename.f'[  ]*' adSrcFiles.tmp`                              isAD=`egrep ^$basename.f'[  ]*' $TMP.adSrcFiles`
2724                              if test -z "$isAD" ; then                              if test -z "$isAD" ; then
2725                                  toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE}`                                  toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE}`
2726                                  if test -z "$toBeIgnored" ; then                                  if test -z "$toBeIgnored" ; then
2727                                      echo    " \\"  >> nonADF77srclist.tmp                                      echo    " \\"  >> $TMP.nonADF77srclist
2728                                      printf " $sf" >> nonADF77srclist.tmp                                      printf " $sf" >> $TMP.nonADF77srclist
2729                                  else                                  else
2730                                      echo "    not to be compiled   :  $sf"                                      echo "    not to be compiled   :  $sf"
2731                                  fi                                  fi
# Line 2725  for d in $alldirs ; do Line 2740  for d in $alldirs ; do
2740                                      echo "    original to be kept  :  $sf"                                      echo "    original to be kept  :  $sf"
2741                                  fi                                  fi
2742                                  if test -n "$notToBeTransformed" -o -n "$untransformedVersionToBeKept" ; then                                  if test -n "$notToBeTransformed" -o -n "$untransformedVersionToBeKept" ; then
2743                                      echo    " \\"  >> nonADF77srclist.tmp                                      echo    " \\"  >> $TMP.nonADF77srclist
2744                                      printf " $sf" >> nonADF77srclist.tmp                                      printf " $sf" >> $TMP.nonADF77srclist
2745                                  fi                                  fi
2746                              fi                              fi
2747                          fi                          fi
2748                          ;;                          ;;
2749                      F90)                      F90)
2750                          echo    " \\"  >> F90srclist.tmp                          echo    " \\"  >> $TMP.F90srclist
2751                          printf " $sf" >> F90srclist.tmp                          printf " $sf" >> $TMP.F90srclist
2752                          ;;                          ;;
2753                      c)                      c)
2754                          echo    " \\"  >> csrclist.tmp                          echo    " \\"  >> $TMP.csrclist
2755                          printf " $sf" >> csrclist.tmp                          printf " $sf" >> $TMP.csrclist
2756                          ;;                          ;;
2757                      h)                      h)
2758                          echo    " \\"  >> hsrclist.tmp                          echo    " \\"  >> $TMP.hsrclist
2759                          printf " $sf" >> hsrclist.tmp                          printf " $sf" >> $TMP.hsrclist
2760                          ;;                          ;;
2761                      flow)                      flow)
2762                          echo    " \\"  >> ad_flow_files.tmp                          echo    " \\"  >> $TMP.ad_flow_files
2763                          printf " $sf" >> ad_flow_files.tmp                          printf " $sf" >> $TMP.ad_flow_files
2764                          ;;                          ;;
2765                     esac                     esac
2766                  fi                  fi
# Line 2754  for d in $alldirs ; do Line 2769  for d in $alldirs ; do
2769      done      done
2770      if test "x$deplist" != x ; then      if test "x$deplist" != x ; then
2771        if test "$d" != "." ; then        if test "$d" != "." ; then
2772          echo "" >> srclinks.tmp          echo "" >> $TMP.srclinks
2773          echo "#  These files are linked from $d" >> srclinks.tmp          echo "#  These files are linked from $d" >> $TMP.srclinks
2774          echo "$deplist :" >> srclinks.tmp          echo "$deplist :" >> $TMP.srclinks
2775  # We need to make sure that the link isn't already there.  # We need to make sure that the link isn't already there.
2776  # This may happen when make thinks that a header file has to be "remade"  # This may happen when make thinks that a header file has to be "remade"
2777  # because a module it depends on has changed.  In this case we do nothing.  # because a module it depends on has changed.  In this case we do nothing.
2778          printf "\tif [ ! -L \$@ ]; then \$(LN) %s/\$@ \$@; fi\n" $d >> srclinks.tmp          printf "\tif [ ! -L \$@ ]; then \$(LN) %s/\$@ \$@; fi\n" $d >> $TMP.srclinks
2779        fi        fi
2780      fi      fi
2781  done  done
2782  rm -rf .links.tmp  rm -rf $TMP.links
2783  echo "" >> F77srclist.tmp  echo "" >> $TMP.F77srclist
2784  echo "" >> nonADF77srclist.tmp  echo "" >> $TMP.nonADF77srclist
2785  echo "" >> csrclist.tmp  echo "" >> $TMP.csrclist
2786  echo "" >> F90srclist.tmp  echo "" >> $TMP.F90srclist
2787  echo "" >> hsrclist.tmp  echo "" >> $TMP.hsrclist
2788  echo "" >> ad_flow_files.tmp  echo "" >> $TMP.ad_flow_files
2789    
2790  CMDLINE=$0  CMDLINE=$0
2791  for xx in "$@" ; do nw=`echo $xx | wc -w`  for xx in "$@" ; do nw=`echo $xx | wc -w`
# Line 2892  MAKE = ${MAKE} Line 2907  MAKE = ${MAKE}
2907    
2908  EOF  EOF
2909    
2910  cat F77srclist.tmp      >> $MAKEFILE  cat $TMP.F77srclist      >> $MAKEFILE
2911  cat nonADF77srclist.tmp >> $MAKEFILE  cat $TMP.nonADF77srclist >> $MAKEFILE
2912  cat csrclist.tmp        >> $MAKEFILE  cat $TMP.csrclist        >> $MAKEFILE
2913  cat F90srclist.tmp      >> $MAKEFILE  cat $TMP.F90srclist      >> $MAKEFILE
2914  cat hsrclist.tmp        >> $MAKEFILE  cat $TMP.hsrclist        >> $MAKEFILE
2915  cat ad_flow_files.tmp   >> $MAKEFILE  cat $TMP.ad_flow_files   >> $MAKEFILE
2916    
2917  rm -f F77srclist.tmp nonADF77srclist.tmp csrclist.tmp F90srclist.tmp hsrclist.tmp ad_flow_files.tmp  rm -f $TMP.F77srclist $TMP.nonADF77srclist $TMP.csrclist $TMP.F90srclist $TMP.hsrclist $TMP.ad_flow_files
2918    
2919  echo >> $MAKEFILE  echo >> $MAKEFILE
2920    
# Line 3096  done Line 3111  done
3111  echo "  Add the source list for AD code generation"  echo "  Add the source list for AD code generation"
3112  echo >> $MAKEFILE  echo >> $MAKEFILE
3113  printf "AD_FILES = " >> $MAKEFILE  printf "AD_FILES = " >> $MAKEFILE
3114  AD_FILES=`cat adSrcFiles.tmp`  AD_FILES=`cat $TMP.adSrcFiles`
3115  for i in $AD_FILES ; do  for i in $AD_FILES ; do
3116      echo    " \\" >> $MAKEFILE      echo    " \\" >> $MAKEFILE
3117      printf " $i" >> $MAKEFILE      printf " $i" >> $MAKEFILE
3118  done  done
3119  echo >> $MAKEFILE  echo >> $MAKEFILE
3120  rm -f adSrcFiles.tmp  rm -f $TMP.adSrcFiles
3121    
3122  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
3123    
# Line 3118  ad_exe_target: Line 3133  ad_exe_target:
3133          @-rm -f ad_config.template          @-rm -f ad_config.template
3134          \$(MAKE) -f \$(MAKEFILE) \$(EXE_AD)          \$(MAKE) -f \$(MAKEFILE) \$(EXE_AD)
3135    
3136  ad_input_code.$FS: \$(F77_SRC_FILES) \$(AD_FLOW_FILES)  ad_input_code.$FS: \$(AD_FILES) \$(AD_FLOW_FILES)
3137          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Adjoint version" -bAD_CONFIG_H -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Adjoint version" -bAD_CONFIG_H -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
3138          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
3139          @-rm -f ad_config.template          @-rm -f ad_config.template
3140          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3141          @\$(MAKE) -f \$(MAKEFILE) \$(FLOWFILES)          @\$(MAKE) -f \$(MAKEFILE) \$(FLOWFILES)
3142          cat \$(FLOWFILES) \$(F77_PP_SRC_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
3143    
3144  ad_taf_output.$FS: ad_input_code.$FS  ad_taf_output.$FS: ad_input_code.$FS
3145            @-rm -f ad_input_code_ad.$FS ; echo ''
3146          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS
3147          ls -l ad_input_code_ad.$FS          ls -l ad_input_code_ad.$FS
3148          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 3136  adtafonly: Line 3152  adtafonly:
3152          ls -l ad_input_code_ad.$FS          ls -l ad_input_code_ad.$FS
3153          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
3154    
3155  \$(EXE_AD): \$(SPECIAL_FILES) \$(F77_SRC_FILES) \$(C_SRC_FILES:.c=.o) \$(H_SRC_FILES) \$(F90_SRC_FILES) ad_taf_output.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)
3156          \$(LINK) -o \${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(C_SRC_FILES:.c=.o) ad_taf_output.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)
3157    
3158  ad_tamc_output.$FS: ad_input_code.$FS  ad_tamc_output.$FS: ad_input_code.$FS
3159          \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS          \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS
# Line 3152  adonlyfwd: Line 3168  adonlyfwd:
3168  adtrick:  adtrick:
3169          patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff          patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff
3170    
3171  adobj: ad_taf_output.o \$(OBJFILES)  adobj: ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o)
3172    
3173  # ... FTL ...  # ... FTL ...
3174  ftlall: ftl_exe_target  ftlall: ftl_exe_target
# Line 3166  ftl_exe_target: Line 3182  ftl_exe_target:
3182          @-rm -f ad_config.template          @-rm -f ad_config.template
3183          \$(MAKE) -f \$(MAKEFILE) \$(EXE_FTL)          \$(MAKE) -f \$(MAKEFILE) \$(EXE_FTL)
3184    
3185  ftl_input_code.$FS: \$(F77_SRC_FILES)  ftl_input_code.$FS: \$(AD_FILES)
3186          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "TangLin version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ad_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "TangLin version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ad_config.template
3187          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
3188          @-rm -f ad_config.template          @-rm -f ad_config.template
3189          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3190          @\$(MAKE) -f \$(MAKEFILE) \$(AD_FLOW_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(AD_FLOW_FILES)
3191          cat \$(AD_FLOW_FILES) \$(F77_PP_SRC_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
3192    
3193  ftl_taf_output.$FS: ftl_input_code.$FS  ftl_taf_output.$FS: ftl_input_code.$FS
3194            @-rm -f ftl_input_code_tl.$FS ; echo ''
3195          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS
3196          ls -l ftl_input_code_tl.$FS          ls -l ftl_input_code_tl.$FS
3197          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 3184  ftltafonly: Line 3201  ftltafonly:
3201          ls -l ftl_input_code_tl.$FS          ls -l ftl_input_code_tl.$FS
3202          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
3203    
3204  \$(EXE_FTL): ftl_taf_output.o \$(C_SRC_FILES:.c=.o)  \$(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)
3205          \$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(C_SRC_FILES:.c=.o) ftl_taf_output.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)
3206    
3207  ftl_tamc_output.$FS: ftl_input_code.$FS  ftl_tamc_output.$FS: ftl_input_code.$FS
3208          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS
# Line 3268  for i in `cat ${OAD_CB2M_FILES}` ; do Line 3285  for i in `cat ${OAD_CB2M_FILES}` ; do
3285    echo    " \\" >> $MAKEFILE    echo    " \\" >> $MAKEFILE
3286    printf " ${i}_mod.f$FS90" >> $MAKEFILE    printf " ${i}_mod.f$FS90" >> $MAKEFILE
3287  done  done
3288  AD_FILES=`cat adSrcFiles.tmp`  AD_FILES=`cat $TMP.adSrcFiles`
3289  for i in $AD_FILES ; do  for i in $AD_FILES ; do
3290    basename=${i%%.f}    basename=${i%%.f}
3291    toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE} ${OAD_DONT_TRANSFORM}`    toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE} ${OAD_DONT_TRANSFORM}`
# Line 3278  for i in $AD_FILES ; do Line 3295  for i in $AD_FILES ; do
3295    fi    fi
3296  done  done
3297  echo >> $MAKEFILE  echo >> $MAKEFILE
3298  rm -f adSrcFiles.tmp  rm -f $TMP.adSrcFiles
3299    
3300  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
3301    
# Line 3384  ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS Line 3401  ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS
3401  ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS90 \${OADTOOLS}/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 \${OADTOOLS}/insertTemplateDir.bash
3402          \${OADTOOLS}/insertTemplateDir.bash \$< \$@          \${OADTOOLS}/insertTemplateDir.bash \$< \$@
3403    
3404  PPEXTRAS=\$(wildcard \${OADTOOLS}/ad_template.*.F) \${OADTOOLS}/ad_inline.F  PPEXTRAS=\$(notdir \$(wildcard \${OADTOOLS}/ad_template.*.F)) ad_inline.F
3405  # postprocess F'  # postprocess F'
3406  postProcess.tag: ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90 \$(PPEXTRAS:.F=.f) | w2f__types.f90  postProcess.tag: ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90 \$(PPEXTRAS:.F=.f) | w2f__types.f90
3407          \${OPENADFORTTK_BASE}/tools/SourceProcessing/postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed --separateOutput --pathSuffix "" --filenameSuffix "_oad" -m r -i \${OADTOOLS}/ad_inline.f \$<          \${OPENADFORTTK_BASE}/tools/SourceProcessing/postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed --separateOutput --pathSuffix "" --filenameSuffix "_oad" -m r -i ad_inline.f \$<
3408          # the target is a placeholder to trigger a single execution of the rule          # the target is a placeholder to trigger a single execution of the rule
3409          touch \$@          touch \$@
3410  # put this so make knows about the postprocessing output  # put this so make knows about the postprocessing output
# Line 3398  OAD_intrinsics_oad.f \$(CB2M_AD_FILES:.f Line 3415  OAD_intrinsics_oad.f \$(CB2M_AD_FILES:.f
3415          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .
3416    
3417  # link the support files:  # link the support files:
3418  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES):  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES) \$(PPEXTRAS):
3419          \$(LN) \${OADTOOLS}/\$@ .          \$(LN) \${OADTOOLS}/\$@ .
3420    
3421  AD_CLEAN += *_mod.h *_mod.F90 *.FF90 *.mod-whirl temp.sed oad_cp.* postProcess.tag \$(PPEXTRAS:.F=.f)  AD_CLEAN += *_mod.h *_mod.F90 *.FF90 *.mod-whirl temp.sed oad_cp.* postProcess.tag
3422    
3423  # ============ end OpenAD specific section ==============  # ============ end OpenAD specific section ==============
3424    
# Line 3437  for i in $NOOPTFILES ; do Line 3454  for i in $NOOPTFILES ; do
3454  done  done
3455    
3456  echo "  Add rules for links"  echo "  Add rules for links"
3457  cat srclinks.tmp >> $MAKEFILE  cat $TMP.srclinks >> $MAKEFILE
3458  rm -f srclinks.tmp  rm -f $TMP.srclinks
3459    
3460  echo "  Adding makedepend marker"  echo "  Adding makedepend marker"
3461  printf "\n\n# DO NOT DELETE\n" >> $MAKEFILE  printf "\n\n# DO NOT DELETE\n" >> $MAKEFILE

Legend:
Removed from v.1.254  
changed lines
  Added in v.1.263

  ViewVC Help
Powered by ViewVC 1.1.22