/[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.187 by jmc, Wed Apr 15 22:21:03 2009 UTC revision 1.191 by jmc, Wed Apr 22 19:21:18 2009 UTC
# Line 1790  fi Line 1790  fi
1790    
1791  printf "\n===  Setting defaults  ===\n"  printf "\n===  Setting defaults  ===\n"
1792  printf "  Adding MODS directories: "  printf "  Adding MODS directories: "
 MPI_LNKF=  
1793  for d in $MODS ; do  for d in $MODS ; do
1794      if test ! -d $d ; then      if test ! -d $d ; then
1795          echo          echo
# Line 1800  for d in $MODS ; do Line 1799  for d in $MODS ; do
1799          printf "$d "          printf "$d "
1800          SOURCEDIRS="$SOURCEDIRS $d"          SOURCEDIRS="$SOURCEDIRS $d"
1801          INCLUDEDIRS="$INCLUDEDIRS $d"          INCLUDEDIRS="$INCLUDEDIRS $d"
         #-------------------------------------------------------  
         # Put special links so that MPI specific files are used  
         MPI_FILES=`(cd $d ; find . -name "*_mpi" -print)`  
         for i in $MPI_FILES ; do  
           ii=`echo $i | sed 's:^\./::'`  
           name=`echo $ii | sed 's:_mpi::' `  
           if test "x$MPI" = x ; then  
           # NO: We undo an _mpi symbolically linked file  
             if test -L $name ; then  
               cmp $name "$d/$ii" > /dev/null 2>&1  
               RETVAL=$?  
               if test "x$RETVAL" = x0 ; then  
                 printf "Un-linking $name ; "  
                 rm -f $name  
               fi  
             fi  
           else  
           # YES: We symbolically link this file (with conditions if already there)  
             if test -L $name ; then  
               cmp $d/$ii $name > /dev/null 2>&1  
               RETVAL=$?  
               yy=0 ;  
               for xx in $MPI_LNKF ; do if test $xx = $name ; then yy=1 ; fi ; done  
               if test "x$RETVAL" != x0 -a $yy = 0 ; then  
               # remove sym-link if different and has not just been linked  
                 printf "Un-link + "  
                 rm -f $name  
               fi  
               if test "x$RETVAL" = x0 ; then  
               # if identical, keep sym-link and keep record of it  
                 MPI_LNKF="$MPI_LNKF $name"  
               fi  
             fi  
             if ! test -f $name ; then  
               # make sym-link and keep record of it  
                 printf "Linking $ii to $name ; "  
                 ln -sf $d/$ii $name  
                 MPI_LNKF="$MPI_LNKF $name"  
             fi  
           fi  
         done  
         #-------------------------------------------------------  
1802      fi      fi
1803  done  done
1804  echo  echo
 #echo "MPI_LNKF='$MPI_LNKF'"  
1805    
1806  if test "x${PLATFORM}" = x ; then  if test "x${PLATFORM}" = x ; then
1807      PLATFORM=$p_PLATFORM      PLATFORM=$p_PLATFORM
# Line 2825  adall: \$(EXE_AD) Line 2781  adall: \$(EXE_AD)
2781  adtaf: ad_taf_output.$FS  adtaf: ad_taf_output.$FS
2782  adtamc: ad_tamc_output.$FS  adtamc: ad_tamc_output.$FS
2783    
2784  ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES)  ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES) \$(AD_FLOW_FILES)
2785          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template
2786          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
2787          -rm -f ad_config.template          -rm -f ad_config.template
# Line 3103  ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f Line 3059  ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f
3059    
3060  PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F  PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F
3061  # postprocess F'  # postprocess F'
3062  ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90 multi-pp.pl \$(PPEXTRAS:.F=.f)  ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90 postProcess.py \$(PPEXTRAS:.F=.f)
3063          perl multi-pp.pl -inline=../OAD_support/ad_inline.f \$<          ./postProcess.py -m r -i ../OAD_support/ad_inline.f -o \$@ \$<
         # the postprocessor still gets the name wrong  
         cat \$<.pp | sed 's/RETURN//' > \$@  
3064    
3065  # extract all transformed modules  # extract all transformed modules
3066  all_mods.xb.x2w.w2f.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90  all_mods.xb.x2w.w2f.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90
# Line 3133  mfef90: Line 3087  mfef90:
3087  whirl2xaif xaif2whirl:  whirl2xaif xaif2whirl:
3088          \$(LN) \${OPENADFORTTK}/bin/\$@ .          \$(LN) \${OPENADFORTTK}/bin/\$@ .
3089    
3090  %.pl:  preProcess.py postProcess.py:
         \$(LN) \${OPENADFORTTK}/bin/\$@ .  
   
 preProcess.py:  
3091          \$(LN) \${OPENADFORTTK_BASE}/tools/SourceProcessing/\$@ .          \$(LN) \${OPENADFORTTK_BASE}/tools/SourceProcessing/\$@ .
3092    
3093  whirl2f whirl2f_be:  whirl2f whirl2f_be:

Legend:
Removed from v.1.187  
changed lines
  Added in v.1.191

  ViewVC Help
Powered by ViewVC 1.1.22