/[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.236 by jmc, Fri Aug 24 23:07:27 2012 UTC revision 1.237 by jmc, Fri Aug 24 23:41:17 2012 UTC
# Line 17  Usage: "$0" [OPTIONS] Line 17  Usage: "$0" [OPTIONS]
17    where [OPTIONS] can be:    where [OPTIONS] can be:
18    
19      -help | --help | -h | --h      -help | --help | -h | --h
20            Print this help message and exit.            Print this help message and exit.
21    
22      -adoptfile NAME | --adoptfile NAME | -adof NAME | --adof NAME      -adoptfile NAME | --adoptfile NAME | -adof NAME | --adof NAME
23        -adoptfile=NAME | --adoptfile=NAME | -adof=NAME | --adof=NAME        -adoptfile=NAME | --adoptfile=NAME | -adof=NAME | --adof=NAME
24            Use "NAME" as the adoptfile.  By default, the file at            Use "NAME" as the adoptfile.  By default, the file at
25            "tools/adjoint_options/adjoint_default" will be used.            "tools/adjoint_options/adjoint_default" will be used.
26    
27      -nooptfile | --nooptfile      -nooptfile | --nooptfile
28        -optfile NAME | --optfile NAME | -of NAME | --of NAME        -optfile NAME | --optfile NAME | -of NAME | --of NAME
29        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME
30            Use "NAME" as the optfile.  By default, an attempt will be            Use "NAME" as the optfile.  By default, an attempt will be
31            made to find an appropriate "standard" optfile in the            made to find an appropriate "standard" optfile in the
32            tools/build_options/ directory.            tools/build_options/ directory.
33    
34      -pdepend NAME | --pdepend NAME      -pdepend NAME | --pdepend NAME
35        -pdepend=NAME | --pdepend=NAME        -pdepend=NAME | --pdepend=NAME
36            Get package dependency information from "NAME".            Get package dependency information from "NAME".
37    
38      -pgroups NAME | --pgroups NAME      -pgroups NAME | --pgroups NAME
39        -pgroups=NAME | --pgroups=NAME        -pgroups=NAME | --pgroups=NAME
40            Get the package groups information from "NAME".            Get the package groups information from "NAME".
41    
42      -bash NAME      -bash NAME
43            Explicitly specify the Bourne or BASH shell to use            Explicitly specify the Bourne or BASH shell to use
44    
45      -make NAME | -m NAME      -make NAME | -m NAME
46        --make=NAME | -m=NAME        --make=NAME | -m=NAME
47            Use "NAME" for the MAKE program. The default is "make" but            Use "NAME" for the MAKE program. The default is "make" but
48            many platforms, "gmake" is the preferred choice.            many platforms, "gmake" is the preferred choice.
49    
50      -makefile NAME | -mf NAME      -makefile NAME | -mf NAME
51        --makefile=NAME | -mf=NAME        --makefile=NAME | -mf=NAME
52            Call the makefile "NAME".  The default is "Makefile".            Call the makefile "NAME".  The default is "Makefile".
53    
54      -makedepend NAME | -md NAME      -makedepend NAME | -md NAME
55        --makedepend=NAME | -md=NAME        --makedepend=NAME | -md=NAME
56            Use "NAME" for the MAKEDEPEND program.            Use "NAME" for the MAKEDEPEND program.
57    
58      -rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME      -rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME
59        -rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME        -rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME
60            Specify the location of the MITgcm ROOTDIR as "NAME".            Specify the location of the MITgcm ROOTDIR as "NAME".
61            By default, genamke will try to find the location by            By default, genamke will try to find the location by
62            looking in parent directories (up to the 5th parent).            looking in parent directories (up to the 5th parent).
63    
64      -mods NAME | --mods NAME | -mo NAME | --mo NAME      -mods NAME | --mods NAME | -mo NAME | --mo NAME
65        -mods=NAME | --mods=NAME | -mo=NAME | --mo=NAME        -mods=NAME | --mods=NAME | -mo=NAME | --mo=NAME
66            Here, "NAME" specifies a list of directories that are            Here, "NAME" specifies a list of directories that are
67            used for additional source code.  Files found in the            used for additional source code.  Files found in the
68            "mods list" are given preference over files of the same            "mods list" are given preference over files of the same
69            name found elsewhere.            name found elsewhere.
70    
71      -disable NAME | --disable NAME      -disable NAME | --disable NAME
72        -disable=NAME | --disable=NAME        -disable=NAME | --disable=NAME
73            Here "NAME" specifies a list of packages that we don't            Here "NAME" specifies a list of packages that we don't
74            want to use.  If this violates package dependencies,            want to use.  If this violates package dependencies,
75            genamke will exit with an error message.            genamke will exit with an error message.
76    
77      -enable NAME | --enable NAME      -enable NAME | --enable NAME
78        -enable=NAME | --enable=NAME        -enable=NAME | --enable=NAME
79            Here "NAME" specifies a list of packages that we wish            Here "NAME" specifies a list of packages that we wish
80            to specifically enable.  If this violates package            to specifically enable.  If this violates package
81            dependencies, genamke will exit with an error message.            dependencies, genamke will exit with an error message.
82    
83      -standarddirs NAME | --standarddirs NAME      -standarddirs NAME | --standarddirs NAME
84        -standarddirs=NAME | --standarddirs=NAME        -standarddirs=NAME | --standarddirs=NAME
85            Here, "NAME" specifies a list of directories to be            Here, "NAME" specifies a list of directories to be
86            used as the "standard" code.            used as the "standard" code.
87    
88      -fortran NAME | --fortran NAME | -fc NAME | --fc NAME      -fortran NAME | --fortran NAME | -fc NAME | --fc NAME
89        -fc=NAME | --fc=NAME        -fc=NAME | --fc=NAME
90            Use "NAME" as the fortran compiler.  By default, genmake            Use "NAME" as the fortran compiler.  By default, genmake
91            will search for a working compiler by trying a list of            will search for a working compiler by trying a list of
92            "usual suspects" such as g77, f77, etc.            "usual suspects" such as g77, f77, etc.
93    
94      -cc NAME | --cc NAME | -cc=NAME | --cc=NAME      -cc NAME | --cc NAME | -cc=NAME | --cc=NAME
95            Use "NAME" as the C compiler.  By default, genmake            Use "NAME" as the C compiler.  By default, genmake
96            will search for a working compiler by trying a list of            will search for a working compiler by trying a list of
97            "usual suspects" such as gcc, c89, cc, etc.            "usual suspects" such as gcc, c89, cc, etc.
98    
99      -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4      -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4
100            Use "real*4" type for _RS variable (#undef REAL4_IS_SLOW)            Use "real*4" type for _RS variable (#undef REAL4_IS_SLOW)
101            *only* works if CPP_EEOPTIONS.h allows this.            *only* works if CPP_EEOPTIONS.h allows this.
102    
103      -ignoretime | -ignore_time | --ignoretime | --ignore_time      -ignoretime | -ignore_time | --ignoretime | --ignore_time
104            Ignore all the "wall clock" routines entirely.  This will            Ignore all the "wall clock" routines entirely.  This will
105            not in any way hurt the model results -- it simply means            not in any way hurt the model results -- it simply means
106            that the code that checks how long the model spends in            that the code that checks how long the model spends in
107            various routines will give junk values.            various routines will give junk values.
108    
109      -ts | --ts      -ts | --ts
110            Produce timing information per timestep            Produce timing information per timestep
111      -papis | --papis      -papis | --papis
112            Produce summary MFlop/s (and IPC) with PAPI per timestep            Produce summary MFlop/s (and IPC) with PAPI per timestep
113      -pcls | --pcls      -pcls | --pcls
114            Produce summary MFlop/s etc. with PCL per timestep            Produce summary MFlop/s etc. with PCL per timestep
115      -foolad | --foolad      -foolad | --foolad
116            Fool the AD code generator            Fool the AD code generator
117      -papi | --papi      -papi | --papi
118            Performance analysis with PAPI            Performance analysis with PAPI
119      -pcl | --pcl      -pcl | --pcl
120            Performance analysis with PCL            Performance analysis with PCL
121      -hpmt | --hpmt      -hpmt | --hpmt
122            Performance analysis with the HPM Toolkit            Performance analysis with the HPM Toolkit
123    
124      -ieee | --ieee      -ieee | --ieee
125            use IEEE numerics.  Note that this option *only* works            use IEEE numerics.  Note that this option *only* works
126            if it is supported by the OPTFILE that is being used.            if it is supported by the OPTFILE that is being used.
127      -devel | --devel      -devel | --devel
128            Add additional warning and debugging flags for development            Add additional warning and debugging flags for development
129            (if supported by the OPTFILE); also switch to IEEE numerics.            (if supported by the OPTFILE); also switch to IEEE numerics.
130      -gsl | --gsl      -gsl | --gsl
131            Use GSL to control floating point rounding and precision            Use GSL to control floating point rounding and precision
132    
133      -mpi | --mpi      -mpi | --mpi
134            Include MPI header files and link to MPI libraries            Include MPI header files and link to MPI libraries
135      -mpi=PATH | --mpi=PATH      -mpi=PATH | --mpi=PATH
136            Include MPI header files and link to MPI libraries using MPI_ROOT            Include MPI header files and link to MPI libraries using MPI_ROOT
137            set to PATH. i.e. Include files from \$PATH/include, link to libraries            set to PATH. i.e. Include files from \$PATH/include, link to libraries
138            from \$PATH/lib and use binaries from \$PATH/bin.            from \$PATH/lib and use binaries from \$PATH/bin.
139    
140      -omp | --omp      -omp | --omp
141            Activate OpenMP code + use Compiler option OMPFLAG            Activate OpenMP code + use Compiler option OMPFLAG
142      -omp=OMPFLAG | --omp=OMPFLAG      -omp=OMPFLAG | --omp=OMPFLAG
143            Activate OpenMP code + use Compiler option OMPFLAG            Activate OpenMP code + use Compiler option OMPFLAG
144    
145      -es | --es | -embed-source | --embed-source      -es | --es | -embed-source | --embed-source
146            Embed a tarball containing the full source code            Embed a tarball containing the full source code
147            (including the Makefile, etc.) used to build the            (including the Makefile, etc.) used to build the
148            executable [off by default]            executable [off by default]
149    
150      -ds | --ds      -ds | --ds
151            Report genmake internal variables status (DUMPSTATE)            Report genmake internal variables status (DUMPSTATE)
152            to file "genmake_state" (for debug purpose)            to file "genmake_state" (for debug purpose)
153    
154    While it is most often a single word, the "NAME" variables specified    While it is most often a single word, the "NAME" variables specified
155    above can in many cases be a space-delimited string such as:    above can in many cases be a space-delimited string such as:
# Line 207  test_for_string_in_file() { Line 207  test_for_string_in_file() {
207      RETVAL=$?      RETVAL=$?
208      if test "x${RETVAL}" = x0 ; then      if test "x${RETVAL}" = x0 ; then
209          printf "Error: In $file there is an illegal line: "          printf "Error: In $file there is an illegal line: "
210          grep -i "$strng" $file          grep -i "$strng" $file
211          exit 99          exit 99
212      fi      fi
213      return 0      return 0
# Line 435  build_embed_encode() Line 435  build_embed_encode()
435  {  {
436      printf "  building the embed-encode utility...  "      printf "  building the embed-encode utility...  "
437      if test ! -e "$ROOTDIR/tools/embed_encode/encode_files" ; then      if test ! -e "$ROOTDIR/tools/embed_encode/encode_files" ; then
438          if test ! -d "$ROOTDIR/tools/embed_encode" ; then          if test ! -d "$ROOTDIR/tools/embed_encode" ; then
439              echo              echo
440              echo "    Error: can't locate \"$ROOTDIR/tools/embed_encode\""              echo "    Error: can't locate \"$ROOTDIR/tools/embed_encode\""
441              echo              echo
442              EMBED_SRC=f              EMBED_SRC=f
443              return 1              return 1
444          fi          fi
445          clist="cc gcc c89 $CC"          clist="cc gcc c89 $CC"
446          for ic in $clist ; do          for ic in $clist ; do
447              comm="$ic -o encode_files encode_files.c"              comm="$ic -o encode_files encode_files.c"
# Line 1206  SOURCEDIRS= Line 1206  SOURCEDIRS=
1206  INCLUDEDIRS=  INCLUDEDIRS=
1207  STANDARDDIRS="USE_THE_DEFAULT"  STANDARDDIRS="USE_THE_DEFAULT"
1208    
1209    #- local config file
1210    gm_local="genmake_local"
1211    
1212  G2ARGS=  G2ARGS=
1213  BASH=  BASH=
1214  PWD=`pwd`  PWD=`pwd`
# Line 1277  LOGFILE="genmake.log" Line 1280  LOGFILE="genmake.log"
1280  rm -f genmake_state genmake_*optfile $LOGFILE  rm -f genmake_state genmake_*optfile $LOGFILE
1281    
1282  echo "===  Processing options files and arguments  ==="  echo "===  Processing options files and arguments  ==="
 gm_local="genmake_local"  
 printf "  getting local config information:  "  
 if test -f $gm_local ; then  
     echo "using $gm_local"  
     . $gm_local  
     # echo "DISABLE=$DISABLE"  
     # echo "ENABLE=$ENABLE"  
 else  
     echo "none found"  
 fi  
1283    
1284  #echo "$0::$1:$2:$3:$4:$5:$6:$7:"  #echo "$0::$1:$2:$3:$4:$5:$6:$7:"
1285  #parse_options  #parse_options
# Line 1346  for ac_option in "$@" ; do Line 1339  for ac_option in "$@" ; do
1339          -makedepend=* | --makedepend=* | -md=* | --md=*)          -makedepend=* | --makedepend=* | -md=* | --md=*)
1340              MAKEDEPEND=$ac_optarg ;;              MAKEDEPEND=$ac_optarg ;;
1341    
1342          -makefile | --makefile | -ma | --ma)          -makefile | --makefile | -mf | --mf)
1343              ac_prev=MAKEFILE ;;              ac_prev=MAKEFILE ;;
1344          -makefile=* | --makefile=* | -ma=* | --ma=*)          -makefile=* | --makefile=* | -mf=* | --mf=*)
1345              MAKEFILE=$ac_optarg ;;              MAKEFILE=$ac_optarg ;;
1346    
1347          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)
# Line 1415  for ac_option in "$@" ; do Line 1408  for ac_option in "$@" ; do
1408              IEEE=true ;;              IEEE=true ;;
1409          -noieee | --noieee)          -noieee | --noieee)
1410              echo "Warning: ignore option '$ac_option' (default is already without '-ieee')" ;;              echo "Warning: ignore option '$ac_option' (default is already without '-ieee')" ;;
1411          -devel | --devel)          -devel | --devel)
1412              IEEE=true ; DEVEL=true ;;              IEEE=true ; DEVEL=true ;;
1413          -gsl | --gsl)          -gsl | --gsl)
1414              GSL=true ;;              GSL=true ;;
1415    
1416          -ts | --ts)          -ts | --ts)
# Line 1485  for ac_option in "$@" ; do Line 1478  for ac_option in "$@" ; do
1478    
1479  done  done
1480    
1481    printf "  getting local config information:  "
1482    if test -f $gm_local ; then
1483        echo "using $gm_local"
1484        . $gm_local
1485    else
1486        echo "none found"
1487    fi
1488    
1489  if test -f ./.genmakerc ; then  if test -f ./.genmakerc ; then
1490      echo      echo
1491      echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\""      echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\""
# Line 1771  if test ! "x$HPMT" = x ; then Line 1772  if test ! "x$HPMT" = x ; then
1772        if test ! "x$PAPI" = x ; then        if test ! "x$PAPI" = x ; then
1773            echo "  PAPI and the HPM Toolkit cannot co-exist!"            echo "  PAPI and the HPM Toolkit cannot co-exist!"
1774            echo "  Sticking with PAPI!"            echo "  Sticking with PAPI!"
1775        else if test ! "x$PCL" = x ; then        else
1776            if test ! "x$PCL" = x ; then
1777            echo "  PCL and the HPM Toolkit cannot co-exist!"            echo "  PCL and the HPM Toolkit cannot co-exist!"
1778            echo "  Sticking with PCL!"            echo "  Sticking with PCL!"
1779        else          else
1780            echo "  Turning on performance analysis with the HPM Toolkit"            echo "  Turning on performance analysis with the HPM Toolkit"
1781            echo "  Please make sure HPMTINC, HPMTLIB are defined"            echo "  Please make sure HPMTINC, HPMTLIB are defined"
1782            DEFINES="$DEFINES -DUSE_LIBHPM"            DEFINES="$DEFINES -DUSE_LIBHPM"
1783            INCLUDES="$INCLUDES $HPMTINC"            INCLUDES="$INCLUDES $HPMTINC"
1784            LIBS="$LIBS $HPMTLIB"            LIBS="$LIBS $HPMTLIB"
1785        fi          fi
1786        fi        fi
1787  fi  fi
1788  if test ! "x$GSL" = x ; then  if test ! "x$GSL" = x ; then
# Line 2105  else Line 2107  else
2107          exit 1          exit 1
2108      else      else
2109          echo "    using PKG_LIST=\"$PKG_LIST\""          echo "    using PKG_LIST=\"$PKG_LIST\""
2110          #  Strip the comments and add all the names          #  Strip the comments and add all the names
2111          pkg_list=`cat $PKG_LIST | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`          pkg_list=`cat $PKG_LIST | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`
2112          RETVAL=$?          RETVAL=$?
2113          if test "x${RETVAL}" != x0 ; then          if test "x${RETVAL}" != x0 ; then
# Line 2200  else Line 2202  else
2202          echo "Error: problem encountered while building source files in pkg/mnc:"          echo "Error: problem encountered while building source files in pkg/mnc:"
2203          cat make_mnc.errors 1>&2          cat make_mnc.errors 1>&2
2204          if test "x$mnc_in" = x0 ; then          if test "x$mnc_in" = x0 ; then
2205              exit 1              exit 1
2206          else          else
2207              DISABLE="$DISABLE mnc"              DISABLE="$DISABLE mnc"
2208          fi          fi
# Line 2679  echo "" >> ad_flow_files.tmp Line 2681  echo "" >> ad_flow_files.tmp
2681  CMDLINE=$0  CMDLINE=$0
2682  for xx in "$@" ; do nw=`echo $xx | wc -w`  for xx in "$@" ; do nw=`echo $xx | wc -w`
2683      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"
2684                          else CMDLINE="$CMDLINE '$xx'" ; fi                          else CMDLINE="$CMDLINE '$xx'" ; fi
2685  done  done
2686    
2687  if test -f $MAKEFILE ; then  if test -f $MAKEFILE ; then

Legend:
Removed from v.1.236  
changed lines
  Added in v.1.237

  ViewVC Help
Powered by ViewVC 1.1.22