/[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.22 by edhill, Thu Oct 23 04:41:41 2003 UTC revision 1.28 by edhill, Tue Nov 4 19:51:54 2003 UTC
# Line 72  find_possible_configs()  { Line 72  find_possible_configs()  {
72    
73      tmp1=`uname`"_"`uname -m`      tmp1=`uname`"_"`uname -m`
74      tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`      tmp2=`echo $tmp1 | sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
75      PLATFORM=`echo $tmp2 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'`      tmp3=`echo $tmp2 | sed -e 's/power macintosh/ppc/'`
76        PLATFORM=`echo $tmp3 | sed -e 's/i[3-6]86/ia32/' | sed -e 's/athlon/ia32/'`
77      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`      OFLIST=`(cd $ROOTDIR/tools/build_options; ls | grep "^$PLATFORM")`
78      echo "  The platform appears to be:  $PLATFORM"      echo "  The platform appears to be:  $PLATFORM"
79  #     if test "x$OFLIST" = x ; then  #     if test "x$OFLIST" = x ; then
# Line 104  find_possible_configs()  { Line 105  find_possible_configs()  {
105      fi      fi
106    
107      # look for possible fortran compilers      # look for possible fortran compilers
108      tmp="$MITGCM_FC $FC g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95"      tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95"
109      p_FC=      p_FC=
110      for c in $tmp ; do      for c in $tmp ; do
111          rm -f ./hello.f ./hello          rm -f ./hello.f ./hello
# Line 909  for i in $PACKAGES ; do Line 910  for i in $PACKAGES ; do
910      fi      fi
911  done  done
912    
 #  This is compatible with the old genmake.  The "DISABLE_*" flags  
 #  need to be replaced by the "ALLOW_*" flags set below.  
 #  
 # echo -n "  Setting package-specific CPP flags:  "  
 # pkrm=( mom_fluxform mom_vecinv generic_advdiff )  
 # pkrmdef=( -DDISABLE_MOM_FLUXFORM -DDISABLE_MOM_VECINV -DDISABLE_GENERIC_ADVDIFF -DDISABLE_DEBUGMODE )  
 # echo -n "  "  
 # i=0  
 # while test $i -lt "${#pkrm[@]}" ; do  
 #     echo "$PACKAGES" | grep "${pk[$i]}" > /dev/null 2>&1  
 #     RETVAL=$?  
 #     if test "x$RETVAL" = x1 ; then  
 #       DEFINES="$DEFINES ${pkdef[$i]}"  
 #       echo -n " ${pkdef[$i]}"  
 #     fi  
 #     i=$(( $i + 1 ))  
 # done  
 # echo  
913    
914  # Create a list of #define and #undef to enable/disable packages  # Create a list of #define and #undef to enable/disable packages
915  PACKAGES_DOT_H=PACKAGES_CONFIG.h  PACKAGES_DOT_H=PACKAGES_CONFIG.h
# Line 960  for n in $names ; do Line 943  for n in $names ; do
943          if test "x$has_pack" = xf ; then          if test "x$has_pack" = xf ; then
944              undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'`              undef=`echo "ALLOW_$n" | $AWK '{print toupper($0)}'`
945              echo "#undef $undef" >> $PACKAGES_DOT_H".tmp"              echo "#undef $undef" >> $PACKAGES_DOT_H".tmp"
 #           DEFINES="$DEFINES -U$undef"  
   
 #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  
             case $n in  
                 mom_fluxform)  
                     DEFINES="$DEFINES -DDISABLE_MOM_FLUXFORM"  
                     ;;  
                 mom_vecinv)  
                     DEFINES="$DEFINES -DDISABLE_MOM_VECINV"  
                     ;;  
                 debug)  
                     DEFINES="$DEFINES -DDISABLE_DEBUGMODE"  
                     ;;  
             esac  
 #EH3  WARNING :  This is an UGLY HACK that needs to be removed!!!  
   
946          fi          fi
947      fi      fi
948  done  done
# Line 1364  rm -f ad_files Line 1331  rm -f ad_files
1331    
1332  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
1333    
 AD_CONFIG.h:  
         cat AD_CONFIG.template > AD_CONFIG.h  
   
1334  # ... AD ...  # ... AD ...
1335  ad: ad_taf  adall: ad_taf
1336  ad_taf_f: ad_taf_output.f  adtaf: ad_taf_output.f
1337  ad_tamc_f: ad_tamc_output.f  adtamc: ad_tamc_output.f
1338    
1339  ad_input_code.f: \$(SRCFILES)  ad_input_code.f: \$(AD_FILES) \$(HEADERFILES)
1340          cat ad_config.template > AD_CONFIG.h          cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
1341          @make \$(F77FILES)          @make \$(F77FILES)
1342          @make \$(AD_FLOW_FILES)          @make \$(AD_FLOW_FILES)
1343          cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f          cat \$(AD_FLOW_FILES) \$(AD_FILES) > ad_input_code.f
# Line 1394  ad_tamc: ad_tamc_output.o \$(OBJFILES) Line 1358  ad_tamc: ad_tamc_output.o \$(OBJFILES)
1358    
1359    
1360  # ... FTL ...  # ... FTL ...
1361  ftl: ftl_taf  ftlall: ftl_taf
1362  ftl_taf_f: ftl_taf_output.f  ftltaf: ftl_taf_output.f
1363  ftl_tamc_f: ftl_tamc_output.f  ftltamc: ftl_tamc_output.f
1364    
1365  ftl_input_code.f: \$(SRCFILES)  ftl_input_code.f: \$(AD_FILES) \$(HEADERFILES)
1366          cat ftl_config.template > AD_CONFIG.h          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h
1367            @make \$(F77FILES)
1368          @make \$(AD_FLOW_FILES)          @make \$(AD_FLOW_FILES)
1369          cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.f          cat \$(AD_FLOW_FILES) \$(AD_FILES) > ftl_input_code.f
1370    
# Line 1423  svd: svd_taf Line 1388  svd: svd_taf
1388  svd_taf_f: svd_taf_output.f  svd_taf_f: svd_taf_output.f
1389    
1390  svd_input_code.f: \$(SRCFILES)  svd_input_code.f: \$(SRCFILES)
1391          cat svd_config.template > AD_CONFIG.h          cmp svd_config.template AD_CONFIG.h || cat svd_config.template > AD_CONFIG.h
1392            @make \$(F77FILES)
1393          @make \$(AD_FLOW_FILES)          @make \$(AD_FLOW_FILES)
1394          cat \$(AD_FLOW_FILES) \$(AD_FILES) > svd_input_code.f          cat \$(AD_FLOW_FILES) \$(AD_FILES) > svd_input_code.f
1395    
# Line 1474  printf "\n\n# DO NOT DELETE\n" >> $MAKEF Line 1440  printf "\n\n# DO NOT DELETE\n" >> $MAKEF
1440  printf "\n===  Done  ===\n"  printf "\n===  Done  ===\n"
1441    
1442  #  Write the "template" files for the adjoint builds  #  Write the "template" files for the adjoint builds
1443  cat >>AD_CONFIG.template <<EOF  cat >AD_CONFIG.template <<EOF
1444  C  WARNING: This file is automatically generated by genmake2 and  C  WARNING: This file is automatically generated by genmake2 and
1445  C    used by the Makefile rules.  Please DO NOT EDIT this file  C    used by the Makefile rules.  Please DO NOT EDIT this file
1446  C    unless you are CERTAIN that you know what you're doing.  C    unless you are CERTAIN that you know what you are doing.
1447    
1448  #undef ALLOW_ADJOINT_RUN  #undef ALLOW_ADJOINT_RUN
1449  #undef ALLOW_TANGENTLINEAR_RUN  #undef ALLOW_TANGENTLINEAR_RUN
1450  #undef ALLOW_ECCO_OPTIMIZATION  #undef ALLOW_ECCO_OPTIMIZATION
1451  EOF  EOF
1452  cat >>ad_config.template <<EOF  cat >ad_config.template <<EOF
1453  C  WARNING: This file is automatically generated by genmake2 and  C  WARNING: This file is automatically generated by genmake2 and
1454  C    used by the Makefile rules.  Please DO NOT EDIT this file  C    used by the Makefile rules.  Please DO NOT EDIT this file
1455  C    unless you are CERTAIN that you know what you're doing.  C    unless you are CERTAIN that you know what you are doing.
1456    
1457  #undef ALLOW_ADJOINT_RUN  #define ALLOW_ADJOINT_RUN
1458  #undef ALLOW_TANGENTLINEAR_RUN  #undef ALLOW_TANGENTLINEAR_RUN
1459  #undef ALLOW_ECCO_OPTIMIZATION  #undef ALLOW_ECCO_OPTIMIZATION
1460  EOF  EOF
1461  cat >>ftl_config.template <<EOF  cat >ftl_config.template <<EOF
1462  C  WARNING: This file is automatically generated by genmake2 and  C  WARNING: This file is automatically generated by genmake2 and
1463  C    used by the Makefile rules.  Please DO NOT EDIT this file  C    used by the Makefile rules.  Please DO NOT EDIT this file
1464  C    unless you are CERTAIN that you know what you're doing.  C    unless you are CERTAIN that you know what you are doing.
1465    
1466  #undef ALLOW_ADJOINT_RUN  #undef ALLOW_ADJOINT_RUN
1467  #undef ALLOW_TANGENTLINEAR_RUN  #define ALLOW_TANGENTLINEAR_RUN
1468  #undef ALLOW_ECCO_OPTIMIZATION  #undef ALLOW_ECCO_OPTIMIZATION
1469  EOF  EOF
1470  cat >>svd_config.template <<EOF  cat >svd_config.template <<EOF
1471  C  WARNING: This file is automatically generated by genmake2 and  C  WARNING: This file is automatically generated by genmake2 and
1472  C    used by the Makefile rules.  Please DO NOT EDIT this file  C    used by the Makefile rules.  Please DO NOT EDIT this file
1473  C    unless you are CERTAIN that you know what you're doing.  C    unless you are CERTAIN that you know what you are doing.
1474    
1475  #undef ALLOW_ADJOINT_RUN  #undef ALLOW_ADJOINT_RUN
1476  #undef ALLOW_TANGENTLINEAR_RUN  #undef ALLOW_TANGENTLINEAR_RUN

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.22