/[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.179 by jmc, Fri Nov 21 16:15:00 2008 UTC revision 1.186 by jmc, Sun Mar 29 19:09:24 2009 UTC
# Line 1046  INCLUDES="-I. $INCLUDES" Line 1046  INCLUDES="-I. $INCLUDES"
1046  FFLAGS=  FFLAGS=
1047  FOPTIM=  FOPTIM=
1048  FEXTRAFLAGS=  FEXTRAFLAGS=
1049    USE_EXTENDED_SRC=
1050    EXTENDED_SRC_FLAG=
1051  CFLAGS=  CFLAGS=
1052  KFLAGS1=  KFLAGS1=
1053  KFLAGS2=  KFLAGS2=
# Line 1646  if test ! "x$GSL" = x ; then Line 1648  if test ! "x$GSL" = x ; then
1648        INCLUDES="$INCLUDES $GSLINC"        INCLUDES="$INCLUDES $GSLINC"
1649        LIBS="$LIBS $GSLLIB"        LIBS="$LIBS $GSLLIB"
1650  fi  fi
1651    #- if USE_EXTENDED_SRC is set, add EXTENDED_SRC_FLAG to FFLAGS :
1652    if test ! "x$USE_EXTENDED_SRC" = x ; then
1653          FFLAGS="$FFLAGS $EXTENDED_SRC_FLAG"
1654          F90FIXEDFORMAT="$F90FIXEDFORMAT $EXTENDED_SRC_FLAG"
1655    fi
1656    
1657  printf "\n===  Checking system libraries  ===\n"  printf "\n===  Checking system libraries  ===\n"
1658  printf "  Do we have the system() command using $FC...  "  printf "  Do we have the system() command using $FC...  "
# Line 1768  fi Line 1775  fi
1775    
1776    
1777  printf "\n===  Setting defaults  ===\n"  printf "\n===  Setting defaults  ===\n"
1778  printf "  Adding MODS directories:  "  printf "  Adding MODS directories: "
1779    MPI_LNKF=
1780  for d in $MODS ; do  for d in $MODS ; do
1781      if test ! -d $d ; then      if test ! -d $d ; then
1782          echo          echo
1783          echo "Error: MODS directory \"$d\" not found!"          echo "Error: MODS directory \"$d\" not found!"
1784          exit 1          exit 1
1785      else      else
1786          printf " $d"          printf "$d "
1787          SOURCEDIRS="$SOURCEDIRS $d"          SOURCEDIRS="$SOURCEDIRS $d"
1788          INCLUDEDIRS="$INCLUDEDIRS $d"          INCLUDEDIRS="$INCLUDEDIRS $d"
1789            #-------------------------------------------------------
1790            # Put special links so that MPI specific files are used
1791            MPI_FILES=`(cd $d ; find . -name "*_mpi" -print)`
1792            for i in $MPI_FILES ; do
1793              ii=`echo $i | sed 's:^\./::'`
1794              name=`echo $ii | sed 's:_mpi::' `
1795              if test "x$MPI" = x ; then
1796              # NO: We undo an _mpi symbolically linked file
1797                if test -L $name ; then
1798                  cmp $name "$d/$ii" > /dev/null 2>&1
1799                  RETVAL=$?
1800                  if test "x$RETVAL" = x0 ; then
1801                    printf "Un-linking $name ; "
1802                    rm -f $name
1803                  fi
1804                fi
1805              else
1806              # YES: We symbolically link this file (with conditions if already there)
1807                if test -L $name ; then
1808                  cmp $d/$ii $name > /dev/null 2>&1
1809                  RETVAL=$?
1810                  yy=0 ;
1811                  for xx in $MPI_LNKF ; do if test $xx = $name ; then yy=1 ; fi ; done
1812                  if test "x$RETVAL" != x0 -a $yy = 0 ; then
1813                  # remove sym-link if different and has not just been linked
1814                    printf "Un-link + "
1815                    rm -f $name
1816                  fi
1817                  if test "x$RETVAL" = x0 ; then
1818                  # if identical, keep sym-link and keep record of it
1819                    MPI_LNKF="$MPI_LNKF $name"
1820                  fi
1821                fi
1822                if ! test -f $name ; then
1823                  # make sym-link and keep record of it
1824                    printf "Linking $ii to $name ; "
1825                    ln -sf $d/$ii $name
1826                    MPI_LNKF="$MPI_LNKF $name"
1827                fi
1828              fi
1829            done
1830            #-------------------------------------------------------
1831      fi      fi
1832  done  done
1833  echo  echo
1834    #echo "MPI_LNKF='$MPI_LNKF'"
1835    
1836  if test "x${PLATFORM}" = x ; then  if test "x${PLATFORM}" = x ; then
1837      PLATFORM=$p_PLATFORM      PLATFORM=$p_PLATFORM
# Line 2720  EOF Line 2771  EOF
2771  #===  Automatic Differentiation Rules  ===  #===  Automatic Differentiation Rules  ===
2772  #===  for TAMC/TAF  ======================  #===  for TAMC/TAF  ======================
2773    
2774  if test "x$OPENAD" == x ; then  if test "x$OPENAD" = x ; then
2775    
2776  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
2777    
# Line 3005  ad_input_code_sf.w2f.f$FS90: ad_input_co Line 3056  ad_input_code_sf.w2f.f$FS90: ad_input_co
3056    
3057  # canonicalizer  # canonicalizer
3058  ad_input_code_sf.w2f.pre.f$FS90: ad_input_code_sf.w2f.f$FS90 preProcess.py  ad_input_code_sf.w2f.pre.f$FS90: ad_input_code_sf.w2f.f$FS90 preProcess.py
3059          ./preProcess.py -H \$< -o \$@          ./preProcess.py -H -S \$< -o \$@
3060    
3061  # F -> WHIRL  # F -> WHIRL
3062  # note that the canonicalized version cuts off at col 72  # note that the canonicalized version cuts off at col 72
# Line 3022  ad_input_code_sf.w2f.pre.xaif : ad_input Line 3073  ad_input_code_sf.w2f.pre.xaif : ad_input
3073          ./whirl2xaif -s -n --debug 1 -o \$@ \$<          ./whirl2xaif -s -n --debug 1 -o \$@ \$<
3074    
3075  # XAIF -> XAIF'  # XAIF -> XAIF'
3076  ad_input_code_sf.w2f.pre.xb.xaif : ad_input_code_sf.w2f.pre.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd openad_adm  ad_input_code_sf.w2f.pre.xb.xaif : ad_input_code_sf.w2f.pre.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd oadDriver
3077          ./openad_adm -f -t forward_step -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r          ./oadDriver -f -t forward_step -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r
3078    
3079  # XAIF' -> WHIRL'  # XAIF' -> WHIRL'
3080  ad_input_code_sf.w2f.pre.xb.x2w.B : ad_input_code_sf.w2f.pre.xb.xaif xaif2whirl  ad_input_code_sf.w2f.pre.xb.x2w.B : ad_input_code_sf.w2f.pre.xb.xaif xaif2whirl
# Line 3037  ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS Line 3088  ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS
3088  ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90 ../OAD_support/insertTemplateDir.bash  ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90 ../OAD_support/insertTemplateDir.bash
3089          ../OAD_support/insertTemplateDir.bash \$< \$@          ../OAD_support/insertTemplateDir.bash \$< \$@
3090    
3091    PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F
3092  # postprocess F'  # postprocess F'
3093  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 ../OAD_support/ad_inline.f \$(wildcard ../OAD_support/ad_template.*.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 multi-pp.pl \$(PPEXTRAS:.F=.f)
3094          perl multi-pp.pl -inline=../OAD_support/ad_inline.f \$<          perl multi-pp.pl -inline=../OAD_support/ad_inline.f \$<
3095          # the postprocessor still gets the name wrong          # the postprocessor still gets the name wrong
3096          cat \$<.pp | sed 's/RETURN//' > \$@          cat \$<.pp | sed 's/RETURN//' > \$@
# Line 3077  preProcess.py: Line 3129  preProcess.py:
3129  whirl2f whirl2f_be:  whirl2f whirl2f_be:
3130          \$(LN) \${OPEN64ROOT}/whirl2f/\$@ .          \$(LN) \${OPEN64ROOT}/whirl2f/\$@ .
3131    
3132  openad_adm:  oadDriver:
3133          \$(LN) \${XAIFBOOSTERROOT}/xaifBooster/algorithms/BasicBlockPreaccumulationReverse/test/t \$@          \$(LN) \${XAIFBOOSTERROOT}/xaifBooster/algorithms/BasicBlockPreaccumulationReverse/driver/oadDriver \$@
3134    
3135  # ============ end OpenAD specific section ==============  # ============ end OpenAD specific section ==============
3136    

Legend:
Removed from v.1.179  
changed lines
  Added in v.1.186

  ViewVC Help
Powered by ViewVC 1.1.22