/[MITgcm]/MITgcm/tools/genmake
ViewVC logotype

Diff of /MITgcm/tools/genmake

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.33 by jmc, Tue Mar 6 16:12:45 2001 UTC revision 1.33.2.9 by adcroft, Wed May 9 14:13:03 2001 UTC
# Line 88  while ($#allargs) Line 88  while ($#allargs)
88     echo "Including paths to JAM libraries"     echo "Including paths to JAM libraries"
89     breaksw     breaksw
90   case -help:   case -help:
91     echo "usage: $0 [-help] [-makefile[=...]] [-platform=...] [-mpi]"     echo "usage: $0 [-help] [-makefile[=...]] [-platform=...] [-mpi] [-jam] [-disable=pkg1[,pkg2,...]] [-enable=pkg1[,pkg2,...]] [-mods=dir1[,dir2,...]] [-rootdir=dir]"
92    cat << EOF
93    
94    $0 is used to generate the Makefile in the current directory.
95    
96    Typical invocations are:
97     o from "bin":   ../tools/genmake
98     o from "verification/expt/code": ../../../tools/genmake
99     o from "verification/expt/input": ../../../tools/genmake -mods=../code
100     o from a scratch directory: ~/mitgcm/tools/genmake -rootdir=~/mitgcm
101       or  ~/mitgcm/tools/genmake -rootdir=~/mitgcm -mods=~/mymods
102    
103    Packages (collected modules of code)  can be disabled to avoid unnecessary
104    compilation of unused code. For instance if you know you will not
105    use GM/Redi, KPP and OBCS and they are appropriate turned-off in the
106    configuration:
107       .../tools/genmake -disable=gmredi,kpp,obcs
108    
109    If you add some source files you can re-call the previous instance of
110    genmake with "make makefile".
111    
112    genmake also reads the file .genmakerc which can be used to configure
113    options (primarily the command-line options above) for particular experiments.
114    EOF
115     exit     exit
116     breaksw     breaksw
117   default:   default:
# Line 112  if (! $?mfile) set mfile = ( Makefile ) Line 135  if (! $?mfile) set mfile = ( Makefile )
135  set mach  = ( `uname -a` )  set mach  = ( `uname -a` )
136  echo Operating system: $mach  echo Operating system: $mach
137    
   
138  # Directories for source, includes, binaries and executables  # Directories for source, includes, binaries and executables
139  #  #
140  # If -rootdir wasn't specified then assume script is being run from bin  # If -rootdir wasn't specified then assume script is being run from bin
# Line 171  if (! -d $TOOLSDIR) then Line 193  if (! -d $TOOLSDIR) then
193  endif  endif
194  if (! $?EXECUTABLE) set EXECUTABLE  = ( mitgcmuv )  if (! $?EXECUTABLE) set EXECUTABLE  = ( mitgcmuv )
195    
196    # We have a special set of source files in eesupp/src which
197    # are generated from some template source files. We'll make them
198    # first so the appear as regular source code
199    if (-r $ROOTDIR/eesupp/src/Makefile) then
200     echo Making source files in eesupp from templates...
201     (cd $ROOTDIR/eesupp/src/; make) >& make_eesupp.errs
202     if ($status == 0) then
203       rm -f make_eesupp.errs
204     else
205       cat make_eesupp.errs
206       exit 2
207     endif
208    endif
209    
210  # Now scan the standard source code tree  # Now scan the standard source code tree
211  foreach dr ($SOURCEDIRS)  foreach dr ($SOURCEDIRS)
212    set adr=$dr    set adr=$dr
213    if (! -d $adr) then    if (! -d $adr) then
214      echo mods directory $adr not found.; exit 1      echo mods directory $adr not found.; exit 1
215    endif    endif
216    echo Adding mods directory $adr    echo Adding mods dir: $adr
217  end  end
218  if (! $?PACKAGES) then  if (! $?PACKAGES) then
219    set PACKAGES=(`cd $ROOTDIR/pkg; ls -1 | grep -v CVS`)    set PACKAGES=()
220      foreach pkg (`cd $ROOTDIR/pkg; find . -type d | grep -v CVS | sed 's:\./::' | grep -v "\." | sort`)
221       if (-d $ROOTDIR/pkg/$pkg) set PACKAGES=($PACKAGES $pkg)
222      end
223  endif  endif
224  foreach dr ($PACKAGES)  foreach dr ($PACKAGES)
225    set enable    set enable
# Line 191  foreach dr ($PACKAGES) Line 230  foreach dr ($PACKAGES)
230     endif     endif
231     if ($dr == $p) unset enable     if ($dr == $p) unset enable
232     if ($p == 'all') unset enable     if ($p == 'all') unset enable
233    #  The following allows entire trees to be disabled
234       if ($dr:h == $p) unset enable
235       if ($dr:h:h == $p) unset enable
236       if ($dr:h:h:h == $p) unset enable
237       if ($dr:h:h:h:h == $p) unset enable
238    end    end
239    foreach p ($ENABLE)    foreach p ($ENABLE)
240     if ($dr == $p) set enable     if ($dr == $p) set enable
# Line 200  foreach dr ($PACKAGES) Line 244  foreach dr ($PACKAGES)
244      if (! -d $adr) then      if (! -d $adr) then
245        echo Source directory $adr not found.; exit 1        echo Source directory $adr not found.; exit 1
246      endif      endif
247      echo Adding package directory $adr      echo Adding pkg dir: $adr
248      set SOURCEDIRS = ($SOURCEDIRS $adr)      set SOURCEDIRS = ($SOURCEDIRS $adr)
249      set INCLUDEDIRS = ($INCLUDEDIRS $adr)      set INCLUDEDIRS = ($INCLUDEDIRS $adr)
250    else    else
251      echo "*" Package \"$dr\" has not been enabled.      echo "                                      *" Package \"$dr\" NOT enabled.
252    endif    endif
253  end  end
254  if (! $?STANDARDDIRS) set STANDARDDIRS=(eesupp model)  if (! $?STANDARDDIRS) set STANDARDDIRS=(eesupp model)
# Line 213  foreach dr ($STANDARDDIRS) Line 257  foreach dr ($STANDARDDIRS)
257    if (! -d $adr) then    if (! -d $adr) then
258      echo Source directory $adr not found.; exit 1      echo Source directory $adr not found.; exit 1
259    endif    endif
260    echo Adding source directory $adr    echo Adding src dir: $adr
261    set SOURCEDIRS = ($SOURCEDIRS $adr)    set SOURCEDIRS = ($SOURCEDIRS $adr)
262    set idr = `echo $adr | sed 's/src/inc/'`    set idr = `echo $adr | sed 's/src/inc/'`
263    set INCLUDEDIRS = ($INCLUDEDIRS $idr)    set INCLUDEDIRS = ($INCLUDEDIRS $idr)
# Line 279  switch ($platform$USEMPI) Line 323  switch ($platform$USEMPI)
323      echo "Configuring for SGI Mips"      echo "Configuring for SGI Mips"
324      set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )      set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )
325      set INCLUDES   = ( '-I/usr/local/mpi/include' )      set INCLUDES   = ( '-I/usr/local/mpi/include' )
326      set FFLAGS     = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4' )      set FFLAGS     = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4 -r8 -static' )
327      set FOPTIM     = ( '-O3' )      set FOPTIM     = ( '-O3' )
328  #   set NOOPTFLAGS = ( '-O0' )  #   set NOOPTFLAGS = ( '-O0' )
329  #   set NOOPTFILES = ( 'barrier.F different_multiple.F ' \  #   set NOOPTFILES = ( 'barrier.F different_multiple.F ' \
# Line 385  switch ($platform$USEMPI) Line 429  switch ($platform$USEMPI)
429      breaksw      breaksw
430    case Linux+pgi+mpi:    case Linux+pgi+mpi:
431      if ($?include_jam_libs) then      if ($?include_jam_libs) then
432       set INCLUDES   = ( '-I/usr/local//mpich-cnh-install/include' )       set INCLUDES   = ( '-I/usr/local/mpich-1.2.1/pgi_fortran_binding/include' )
433       set LIBS       = ( '-L/usr/local/mpich-cnh-install/lib/LINUX/ch_p4/ -lfmpich -lmpich' )       set LIBS       = ( '-L/usr/local/mpich-1.2.1/pgi_fortran_binding/lib/ -lfmpich -lmpich' )
434      else      else
435       set INCLUDES   = ( '-I/usr/local/include' )       set INCLUDES   = ( '-I/usr/local/include' )
436       set LIBS       = ( '-L/usr/local/lib/LINUX/ch_p4/ -lfmpich -lmpich' )       set LIBS       = ( '-L/usr/local/lib/LINUX/ch_p4/ -lfmpich -lmpich' )
# Line 548  cat >> ${mfile} <<EOF Line 592  cat >> ${mfile} <<EOF
592  # extra stuff for Hyades ............................................  # extra stuff for Hyades ............................................
593  HYADES_DIR = /u/u0/cnh/jam-lib/software  HYADES_DIR = /u/u0/cnh/jam-lib/software
594  HYADES_DIR = /u/u0/cnh/jam-lib-twoproc  HYADES_DIR = /u/u0/cnh/jam-lib-twoproc
595    HYADES_DIR = /usr/local/jamlib/current/dual_proc
596  WORK_DIR   = \$(HYADES_DIR)  WORK_DIR   = \$(HYADES_DIR)
597  DEPOSIT_DIR = linux_bin  DEPOSIT_DIR = linux_bin
598    

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.33.2.9

  ViewVC Help
Powered by ViewVC 1.1.22