/[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.255 by jmc, Thu Aug 8 17:34:27 2013 UTC revision 1.260 by jmc, Thu Aug 22 01:10:53 2013 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 2553  fi Line 2565  fi
2565    
2566  #  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
2567  #  compiler.  #  compiler.
2568  if test -f ./adSrcFiles.tmp ; then  if test -f $TMP.adSrcFiles ; then
2569      rm -f ./adSrcFiles.tmp      rm -f $TMP.adSrcFiles
2570  fi  fi
2571  echo "  Creating the list of files for the adjoint compiler."  echo "  Creating the list of files for the adjoint compiler."
2572  touch adSrcFiles.tmp  touch $TMP.adSrcFiles
2573  for i in $SOURCEDIRS ; do  for i in $SOURCEDIRS ; do
2574      list_files=`( cd $i && ls -1 *.list 2>/dev/null )`      list_files=`( cd $i && ls -1 *.list 2>/dev/null )`
2575      for j in $list_files ; do      for j in $list_files ; do
2576          cat $i/$j >> adSrcFiles.tmp          cat $i/$j >> $TMP.adSrcFiles
2577      done      done
2578  done  done
2579  if test ! "x"$FS = "x.f" ; then  if test ! "x"$FS = "x.f" ; then
2580      cat adSrcFiles.tmp | sed -e "s/\.f/.$FS/g" > adSrcFiles.tmp_f      cat $TMP.adSrcFiles | sed -e "s/\.f/.$FS/g" > $TMP.adSrcFiles_f
2581      mv -f adSrcFiles.tmp_f adSrcFiles.tmp      mv -f $TMP.adSrcFiles_f $TMP.adSrcFiles
2582  fi  fi
2583    
2584  echo  echo
# Line 2578  for i in $INCLUDEDIRS ; do Line 2590  for i in $INCLUDEDIRS ; do
2590      fi      fi
2591  done  done
2592    
2593  #if test ! "x$DIVA" = x -a ! "x$MPI" = x ; then  if test ! "x$DIVA" = x -a ! "x$MPI" = x ; then
 if test ! "x$MPI" = x ; then  
2594      if test ! "x$MPIINCLUDEDIR" = x ; then      if test ! "x$MPIINCLUDEDIR" = x ; then
2595          #  Do a local copy of MPI headers files (in local dir ./mpi_headers/) after          #  Do a local copy of MPI headers files (in local dir ./mpi_headers/) after
2596          #   checking for additional included headers (in case of chain of included          #   checking for additional included headers (in case of chain of included
# Line 2589  if test ! "x$MPI" = x ; then Line 2600  if test ! "x$MPI" = x ; then
2600  fi  fi
2601    
2602  echo "  Determining the list of source and include files"  echo "  Determining the list of source and include files"
2603  rm -rf .links.tmp  rm -rf $TMP.links
2604  mkdir .links.tmp  mkdir $TMP.links
2605  touch .links.tmp/foo  touch $TMP.links/foo
2606  if test ! -r ".links.tmp/foo" ; then  if test ! -r "$TMP.links/foo" ; then
2607      echo      echo
2608      echo "ERROR : something is wrong with your directory permissions or"      echo "ERROR : something is wrong with your directory permissions or"
2609      echo "   your user file-creation mask (\"umask\") since creating a"      echo "   your user file-creation mask (\"umask\") since creating a"
# Line 2608  if test ! -r ".links.tmp/foo" ; then Line 2619  if test ! -r ".links.tmp/foo" ; then
2619      echo      echo
2620      exit 1      exit 1
2621  fi  fi
2622  rm -f .links.tmp/foo  rm -f $TMP.links/foo
2623    
2624  if test "x$OPENAD" != x ; then  if test "x$OPENAD" != x ; then
2625      OAD_DONT_COMPILE="/dev/null"      OAD_DONT_COMPILE="/dev/null"
# Line 2651  if test "x$OPENAD" != x ; then Line 2662  if test "x$OPENAD" != x ; then
2662      echo "   OpenAD exceptions:  "      echo "   OpenAD exceptions:  "
2663  fi  fi
2664    
2665  echo "# This section creates symbolic links" > srclinks.tmp  echo "# This section creates symbolic links" > $TMP.srclinks
2666  echo "" >> srclinks.tmp  echo "" >> $TMP.srclinks
2667  printf 'F77_SRC_FILES = ' > F77srclist.tmp  printf 'F77_SRC_FILES = ' > $TMP.F77srclist
2668  printf 'NON_AD_F77_SRC_FILES = ' > nonADF77srclist.tmp  printf 'NON_AD_F77_SRC_FILES = ' > $TMP.nonADF77srclist
2669  printf 'C_SRC_FILES = '   > csrclist.tmp  printf 'C_SRC_FILES = '   > $TMP.csrclist
2670  printf 'F90_SRC_FILES = ' > F90srclist.tmp  printf 'F90_SRC_FILES = ' > $TMP.F90srclist
2671  printf 'H_SRC_FILES = '   > hsrclist.tmp  printf 'H_SRC_FILES = '   > $TMP.hsrclist
2672  printf 'AD_FLOW_FILES = ' > ad_flow_files.tmp  printf 'AD_FLOW_FILES = ' > $TMP.ad_flow_files
2673  alldirs="$SOURCEDIRS $INCLUDEDIRS ."  alldirs="$SOURCEDIRS $INCLUDEDIRS ."
2674  for d in $alldirs ; do  for d in $alldirs ; do
2675      deplist=      deplist=
# Line 2668  for d in $alldirs ; do Line 2679  for d in $alldirs ; do
2679          sfiles=`( echo $sfiles | grep -v _cb2m\. )`          sfiles=`( echo $sfiles | grep -v _cb2m\. )`
2680      fi      fi
2681      for sf in $sfiles ; do      for sf in $sfiles ; do
2682          if test ! -r ".links.tmp/$sf" ; then          if test ! -r "$TMP.links/$sf" ; then
2683              if test -f "$d/$sf" ; then              if test -f "$d/$sf" ; then
2684                  ignore_f=f                  ignore_f=f
2685                  case $d/$sf in                  case $d/$sf in
# Line 2693  for d in $alldirs ; do Line 2704  for d in $alldirs ; do
2704                          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
2705                              ignore_f=t                              ignore_f=t
2706                          else                          else
2707                              touch .links.tmp/$sf                              touch $TMP.links/$sf
2708                              deplist="$deplist $sf"                              deplist="$deplist $sf"
2709                          fi                          fi
2710                          ;;                          ;;
# Line 2702  for d in $alldirs ; do Line 2713  for d in $alldirs ; do
2713                      extn=`echo $sf | $AWK -F. '{print $NF}'`                      extn=`echo $sf | $AWK -F. '{print $NF}'`
2714                      case $extn in                      case $extn in
2715                        F)                        F)
2716                          echo    " \\"  >> F77srclist.tmp                          echo    " \\"  >> $TMP.F77srclist
2717                          printf " $sf" >> F77srclist.tmp                          printf " $sf" >> $TMP.F77srclist
2718                          if test "x$OPENAD" != x ; then                          if test "x$OPENAD" = x ; then
2719                                basename=${sf%%.F}
2720                                isAD=`egrep ^$basename.f'[  ]*' $TMP.adSrcFiles`
2721                                if test -z "$isAD" ; then
2722                                    echo    " \\"  >> $TMP.nonADF77srclist
2723                                    printf " $sf" >> $TMP.nonADF77srclist
2724                                fi
2725                            else #- OpenAD case:
2726                              basename=${sf%%.F}                              basename=${sf%%.F}
2727                              isAD=`egrep ^$basename.f'[  ]*' adSrcFiles.tmp`                              isAD=`egrep ^$basename.f'[  ]*' $TMP.adSrcFiles`
2728                              if test -z "$isAD" ; then                              if test -z "$isAD" ; then
2729                                  toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE}`                                  toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE}`
2730                                  if test -z "$toBeIgnored" ; then                                  if test -z "$toBeIgnored" ; then
2731                                      echo    " \\"  >> nonADF77srclist.tmp                                      echo    " \\"  >> $TMP.nonADF77srclist
2732                                      printf " $sf" >> nonADF77srclist.tmp                                      printf " $sf" >> $TMP.nonADF77srclist
2733                                  else                                  else
2734                                      echo "    not to be compiled   :  $sf"                                      echo "    not to be compiled   :  $sf"
2735                                  fi                                  fi
# Line 2726  for d in $alldirs ; do Line 2744  for d in $alldirs ; do
2744                                      echo "    original to be kept  :  $sf"                                      echo "    original to be kept  :  $sf"
2745                                  fi                                  fi
2746                                  if test -n "$notToBeTransformed" -o -n "$untransformedVersionToBeKept" ; then                                  if test -n "$notToBeTransformed" -o -n "$untransformedVersionToBeKept" ; then
2747                                      echo    " \\"  >> nonADF77srclist.tmp                                      echo    " \\"  >> $TMP.nonADF77srclist
2748                                      printf " $sf" >> nonADF77srclist.tmp                                      printf " $sf" >> $TMP.nonADF77srclist
2749                                  fi                                  fi
2750                              fi                              fi
2751                          fi                          fi
2752                          ;;                          ;;
2753                      F90)                      F90)
2754                          echo    " \\"  >> F90srclist.tmp                          echo    " \\"  >> $TMP.F90srclist
2755                          printf " $sf" >> F90srclist.tmp                          printf " $sf" >> $TMP.F90srclist
2756                          ;;                          ;;
2757                      c)                      c)
2758                          echo    " \\"  >> csrclist.tmp                          echo    " \\"  >> $TMP.csrclist
2759                          printf " $sf" >> csrclist.tmp                          printf " $sf" >> $TMP.csrclist
2760                          ;;                          ;;
2761                      h)                      h)
2762                          echo    " \\"  >> hsrclist.tmp                          echo    " \\"  >> $TMP.hsrclist
2763                          printf " $sf" >> hsrclist.tmp                          printf " $sf" >> $TMP.hsrclist
2764                          ;;                          ;;
2765                      flow)                      flow)
2766                          echo    " \\"  >> ad_flow_files.tmp                          echo    " \\"  >> $TMP.ad_flow_files
2767                          printf " $sf" >> ad_flow_files.tmp                          printf " $sf" >> $TMP.ad_flow_files
2768                          ;;                          ;;
2769                     esac                     esac
2770                  fi                  fi
# Line 2755  for d in $alldirs ; do Line 2773  for d in $alldirs ; do
2773      done      done
2774      if test "x$deplist" != x ; then      if test "x$deplist" != x ; then
2775        if test "$d" != "." ; then        if test "$d" != "." ; then
2776          echo "" >> srclinks.tmp          echo "" >> $TMP.srclinks
2777          echo "#  These files are linked from $d" >> srclinks.tmp          echo "#  These files are linked from $d" >> $TMP.srclinks
2778          echo "$deplist :" >> srclinks.tmp          echo "$deplist :" >> $TMP.srclinks
2779  # We need to make sure that the link isn't already there.  # We need to make sure that the link isn't already there.
2780  # 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"
2781  # 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.
2782          printf "\tif [ ! -L \$@ ]; then \$(LN) %s/\$@ \$@; fi\n" $d >> srclinks.tmp          printf "\tif [ ! -L \$@ ]; then \$(LN) %s/\$@ \$@; fi\n" $d >> $TMP.srclinks
2783        fi        fi
2784      fi      fi
2785  done  done
2786  rm -rf .links.tmp  rm -rf $TMP.links
2787  echo "" >> F77srclist.tmp  echo "" >> $TMP.F77srclist
2788  echo "" >> nonADF77srclist.tmp  echo "" >> $TMP.nonADF77srclist
2789  echo "" >> csrclist.tmp  echo "" >> $TMP.csrclist
2790  echo "" >> F90srclist.tmp  echo "" >> $TMP.F90srclist
2791  echo "" >> hsrclist.tmp  echo "" >> $TMP.hsrclist
2792  echo "" >> ad_flow_files.tmp  echo "" >> $TMP.ad_flow_files
2793    
2794  CMDLINE=$0  CMDLINE=$0
2795  for xx in "$@" ; do nw=`echo $xx | wc -w`  for xx in "$@" ; do nw=`echo $xx | wc -w`
# Line 2893  MAKE = ${MAKE} Line 2911  MAKE = ${MAKE}
2911    
2912  EOF  EOF
2913    
2914  cat F77srclist.tmp      >> $MAKEFILE  cat $TMP.F77srclist      >> $MAKEFILE
2915  cat nonADF77srclist.tmp >> $MAKEFILE  cat $TMP.nonADF77srclist >> $MAKEFILE
2916  cat csrclist.tmp        >> $MAKEFILE  cat $TMP.csrclist        >> $MAKEFILE
2917  cat F90srclist.tmp      >> $MAKEFILE  cat $TMP.F90srclist      >> $MAKEFILE
2918  cat hsrclist.tmp        >> $MAKEFILE  cat $TMP.hsrclist        >> $MAKEFILE
2919  cat ad_flow_files.tmp   >> $MAKEFILE  cat $TMP.ad_flow_files   >> $MAKEFILE
2920    
2921  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
2922    
2923  echo >> $MAKEFILE  echo >> $MAKEFILE
2924    
# Line 3097  done Line 3115  done
3115  echo "  Add the source list for AD code generation"  echo "  Add the source list for AD code generation"
3116  echo >> $MAKEFILE  echo >> $MAKEFILE
3117  printf "AD_FILES = " >> $MAKEFILE  printf "AD_FILES = " >> $MAKEFILE
3118  AD_FILES=`cat adSrcFiles.tmp`  AD_FILES=`cat $TMP.adSrcFiles`
3119  for i in $AD_FILES ; do  for i in $AD_FILES ; do
3120      echo    " \\" >> $MAKEFILE      echo    " \\" >> $MAKEFILE
3121      printf " $i" >> $MAKEFILE      printf " $i" >> $MAKEFILE
3122  done  done
3123  echo >> $MAKEFILE  echo >> $MAKEFILE
3124  rm -f adSrcFiles.tmp  rm -f $TMP.adSrcFiles
3125    
3126  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
3127    
# Line 3119  ad_exe_target: Line 3137  ad_exe_target:
3137          @-rm -f ad_config.template          @-rm -f ad_config.template
3138          \$(MAKE) -f \$(MAKEFILE) \$(EXE_AD)          \$(MAKE) -f \$(MAKEFILE) \$(EXE_AD)
3139    
3140  ad_input_code.$FS: \$(F77_SRC_FILES) \$(AD_FLOW_FILES)  ad_input_code.$FS: \$(AD_FILES) \$(AD_FLOW_FILES)
3141          @$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
3142          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
3143          @-rm -f ad_config.template          @-rm -f ad_config.template
3144          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3145          @\$(MAKE) -f \$(MAKEFILE) \$(FLOWFILES)          @\$(MAKE) -f \$(MAKEFILE) \$(FLOWFILES)
3146          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
3147    
3148  ad_taf_output.$FS: ad_input_code.$FS  ad_taf_output.$FS: ad_input_code.$FS
3149            @-rm -f ad_input_code_ad.$FS ; echo ''
3150          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS
3151          ls -l ad_input_code_ad.$FS          ls -l ad_input_code_ad.$FS
3152          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 3137  adtafonly: Line 3156  adtafonly:
3156          ls -l ad_input_code_ad.$FS          ls -l ad_input_code_ad.$FS
3157          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
3158    
3159  \$(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)
3160          \$(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)
3161    
3162  ad_tamc_output.$FS: ad_input_code.$FS  ad_tamc_output.$FS: ad_input_code.$FS
3163          \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS          \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS
# Line 3153  adonlyfwd: Line 3172  adonlyfwd:
3172  adtrick:  adtrick:
3173          patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff          patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff
3174    
3175  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)
3176    
3177  # ... FTL ...  # ... FTL ...
3178  ftlall: ftl_exe_target  ftlall: ftl_exe_target
# Line 3167  ftl_exe_target: Line 3186  ftl_exe_target:
3186          @-rm -f ad_config.template          @-rm -f ad_config.template
3187          \$(MAKE) -f \$(MAKEFILE) \$(EXE_FTL)          \$(MAKE) -f \$(MAKEFILE) \$(EXE_FTL)
3188    
3189  ftl_input_code.$FS: \$(F77_SRC_FILES)  ftl_input_code.$FS: \$(AD_FILES)
3190          @$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
3191          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
3192          @-rm -f ad_config.template          @-rm -f ad_config.template
3193          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3194          @\$(MAKE) -f \$(MAKEFILE) \$(AD_FLOW_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(AD_FLOW_FILES)
3195          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
3196    
3197  ftl_taf_output.$FS: ftl_input_code.$FS  ftl_taf_output.$FS: ftl_input_code.$FS
3198            @-rm -f ftl_input_code_tl.$FS ; echo ''
3199          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS
3200          ls -l ftl_input_code_tl.$FS          ls -l ftl_input_code_tl.$FS
3201          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 3185  ftltafonly: Line 3205  ftltafonly:
3205          ls -l ftl_input_code_tl.$FS          ls -l ftl_input_code_tl.$FS
3206          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
3207    
3208  \$(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)
3209          \$(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)
3210    
3211  ftl_tamc_output.$FS: ftl_input_code.$FS  ftl_tamc_output.$FS: ftl_input_code.$FS
3212          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS
# Line 3269  for i in `cat ${OAD_CB2M_FILES}` ; do Line 3289  for i in `cat ${OAD_CB2M_FILES}` ; do
3289    echo    " \\" >> $MAKEFILE    echo    " \\" >> $MAKEFILE
3290    printf " ${i}_mod.f$FS90" >> $MAKEFILE    printf " ${i}_mod.f$FS90" >> $MAKEFILE
3291  done  done
3292  AD_FILES=`cat adSrcFiles.tmp`  AD_FILES=`cat $TMP.adSrcFiles`
3293  for i in $AD_FILES ; do  for i in $AD_FILES ; do
3294    basename=${i%%.f}    basename=${i%%.f}
3295    toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE} ${OAD_DONT_TRANSFORM}`    toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE} ${OAD_DONT_TRANSFORM}`
# Line 3279  for i in $AD_FILES ; do Line 3299  for i in $AD_FILES ; do
3299    fi    fi
3300  done  done
3301  echo >> $MAKEFILE  echo >> $MAKEFILE
3302  rm -f adSrcFiles.tmp  rm -f $TMP.adSrcFiles
3303    
3304  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
3305    
# Line 3385  ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS Line 3405  ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS
3405  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
3406          \${OADTOOLS}/insertTemplateDir.bash \$< \$@          \${OADTOOLS}/insertTemplateDir.bash \$< \$@
3407    
3408  PPEXTRAS=\$(wildcard \${OADTOOLS}/ad_template.*.F) \${OADTOOLS}/ad_inline.F  PPEXTRAS=\$(notdir \$(wildcard \${OADTOOLS}/ad_template.*.F)) ad_inline.F
3409  # postprocess F'  # postprocess F'
3410  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
3411          \${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 \$<
3412          # 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
3413          touch \$@          touch \$@
3414  # put this so make knows about the postprocessing output  # put this so make knows about the postprocessing output
# Line 3399  OAD_intrinsics_oad.f \$(CB2M_AD_FILES:.f Line 3419  OAD_intrinsics_oad.f \$(CB2M_AD_FILES:.f
3419          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .
3420    
3421  # link the support files:  # link the support files:
3422  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES):  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES) \$(PPEXTRAS):
3423          \$(LN) \${OADTOOLS}/\$@ .          \$(LN) \${OADTOOLS}/\$@ .
3424    
3425  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
3426    
3427  # ============ end OpenAD specific section ==============  # ============ end OpenAD specific section ==============
3428    
# Line 3438  for i in $NOOPTFILES ; do Line 3458  for i in $NOOPTFILES ; do
3458  done  done
3459    
3460  echo "  Add rules for links"  echo "  Add rules for links"
3461  cat srclinks.tmp >> $MAKEFILE  cat $TMP.srclinks >> $MAKEFILE
3462  rm -f srclinks.tmp  rm -f $TMP.srclinks
3463    
3464  echo "  Adding makedepend marker"  echo "  Adding makedepend marker"
3465  printf "\n\n# DO NOT DELETE\n" >> $MAKEFILE  printf "\n\n# DO NOT DELETE\n" >> $MAKEFILE

Legend:
Removed from v.1.255  
changed lines
  Added in v.1.260

  ViewVC Help
Powered by ViewVC 1.1.22