/[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.63 by adcroft, Wed Aug 7 19:27:27 2002 UTC revision 1.84 by heimbach, Thu Oct 2 21:30:22 2003 UTC
# Line 9  Line 9 
9  #   modified by aja 01/00  #   modified by aja 01/00
10    
11  # Default lists  # Default lists
12  set DISABLE = ( aim autodiff cal cost ctrl ecco exf grdchk flt ptracers )  if (! $?DISABLE) set DISABLE = ( aim aim_v23 admtlm autodiff cal cost ctrl ecco exf grdchk flt land ptracers seaice therm_seaice bulk_force dic gchem )
13  set DEFINES = ( )  if (! $?ENABLE) set ENABLE  = ( )
14  set ENABLE  = ( )  if (! $?DEFINES) set DEFINES = ( )
15  set MODS  = ( )  if (! $?MODS) set MODS  = ( )
16    
17  # Grab variables/lists from .genmakerc  # Grab variables/lists from .genmakerc
18  if (-r .genmakerc) source .genmakerc  if (-r .genmakerc) source .genmakerc
# Line 100  while ($#allargs) Line 100  while ($#allargs)
100     set include_jam_libs     set include_jam_libs
101     echo "Including paths to JAM libraries"     echo "Including paths to JAM libraries"
102     breaksw     breaksw
103     case -arpack:
104       echo "Enabling ARPACK libraries"
105       set USEARPACK
106       breaksw
107   case -fc:   case -fc:
108   case -fc=:   case -fc=:
109     echo "To change the compiler (\$FC) you must specify one with -fc="     echo "To change the compiler (\$FC) you must specify one with -fc="
# Line 113  while ($#allargs) Line 117  while ($#allargs)
117     set FC = ( `echo $arg | sed 's/-fc=//' `)     set FC = ( `echo $arg | sed 's/-fc=//' `)
118     breaksw     breaksw
119   case -help:   case -help:
120     echo "usage: $0 [-help] [-makefile[=...]] [-platform=...] [-mpi] [-jam] [-disable=pkg1[,pkg2,...]] [-enable=pkg1[,pkg2,...]] [-mods=dir1[,dir2,...]] [-rootdir=dir]"     echo "usage: $0 [-help] [-makefile[=...]] [-platform=...] [-mpi] [-jam] [-arpack] [-disable=pkg1[,pkg2,...]] [-enable=pkg1[,pkg2,...]] [-mods=dir1[,dir2,...]] [-rootdir=dir]"
121  cat << EOF  cat << EOF
122    
123  $0 is used to generate the Makefile in the current directory.  $0 is used to generate the Makefile in the current directory.
# Line 247  foreach dr ($SOURCEDIRS) Line 251  foreach dr ($SOURCEDIRS)
251  end  end
252  if (! $?PACKAGES) then  if (! $?PACKAGES) then
253    set PACKAGES=()    set PACKAGES=()
254    foreach pkg (`cd $ROOTDIR/pkg; find . -type d | grep -v CVS | sed 's:\./::' | grep -v "\." | sort`)    foreach pkg (`cd $ROOTDIR/pkg; find . -type d -print | grep -v CVS | sed 's:\./::' | grep -v "\." | sort`)
255     if (-d $ROOTDIR/pkg/$pkg) set PACKAGES=($PACKAGES $pkg)     if (-d $ROOTDIR/pkg/$pkg) set PACKAGES=($PACKAGES $pkg)
256    end    end
257  endif  endif
# Line 292  foreach dr ($PACKAGES) Line 296  foreach dr ($PACKAGES)
296          set DEFINES = ($DEFINES '-DDISABLE_MOM_VECINV'); breaksw          set DEFINES = ($DEFINES '-DDISABLE_MOM_VECINV'); breaksw
297        case generic_advdiff:        case generic_advdiff:
298          set DEFINES = ($DEFINES '-DDISABLE_GENERIC_ADVDIFF'); breaksw          set DEFINES = ($DEFINES '-DDISABLE_GENERIC_ADVDIFF'); breaksw
299          case debug:
300            set DEFINES = ($DEFINES '-DDISABLE_DEBUGMODE'); breaksw
301        default:        default:
302          breaksw          breaksw
303      endsw      endsw
# Line 314  if ($?FC) then Line 320  if ($?FC) then
320   echo "$FC was specified as the compiler"   echo "$FC was specified as the compiler"
321  else  else
322   echo " "   echo " "
323   set likelysuspects=(ifc g77 pgf77 f77 f90 f95)   switch ($platform)
324      case Linux*:
325       set likelysuspects=(g77 ifc pgf77 f77 f90 f95)
326       breaksw
327      default:
328       set likelysuspects=(f77)
329       breaksw
330     endsw
331   foreach fc ($likelysuspects)   foreach fc ($likelysuspects)
332    set foundfc=`which $fc |& cat - `    set foundfc=`which $fc |& cat - `
333    if (-x $foundfc[1]) then    if (-x $foundfc[1]) then
# Line 331  else Line 344  else
344   else   else
345    echo "No compiler found\!"    echo "No compiler found\!"
346    echo I tried looking for \"$likelysuspects\" in your \$PATH but found none    echo I tried looking for \"$likelysuspects\" in your \$PATH but found none
347    exit 13    echo I will continue anyway and see what happens.
348      set FC = ( 'f77' )
349    # exit 13
350   endif   endif
351  endif  endif
352    
# Line 352  set KFLAGS1    = (  ) Line 367  set KFLAGS1    = (  )
367  set KFLAGS2    = (  )  set KFLAGS2    = (  )
368  set LIBS       = (  )  set LIBS       = (  )
369  set KPPFILES   = (  )  set KPPFILES   = (  )
370  set NOOPTFILES = (  )  if (! $?NOOPTFILES ) set NOOPTFILES = (  )
371  set NOOPTFLAGS = (  )  if (! $?NOOPTFLAGS ) set NOOPTFLAGS = (  )
372  set RMFILES    = (  )  set RMFILES    = (  )
373    
374  # We often want to use different compile/link options is using MPI  # We often want to use different compile/link options is using MPI
# Line 365  else Line 380  else
380  # set DEFINES = ( ${DEFINES} '-UALLOW_USE_MPI -UALWAYS_USE_MPI' )  # set DEFINES = ( ${DEFINES} '-UALLOW_USE_MPI -UALWAYS_USE_MPI' )
381  endif  endif
382    
383    if ($?USEARPACK) then
384      set USEARPACK  = ( '+arpack' )
385      set LIBS       = ( '-L/usr/lib -larpack -llapack' )
386    else
387      set USEARPACK
388    endif
389    
390  # Platform specific options  # Platform specific options
391  switch ($platform$USEMPI)  switch ($platform$USEMPI$USEARPACK)
392    case OSF1+mpi:    case OSF1+mpi:
393    #ph: e.g. halem.gsfc.nasa.gov
394      echo "Configuring for DEC Alpha with MPI"      echo "Configuring for DEC Alpha with MPI"
395      set LIBS       = ( '-lfmpi -lmpi -lkmp_osfp10 -pthread' )      set LIBS       = ( '-lfmpi -lmpi -lkmp_osfp10 -pthread' )
396    #ph: -lkmp_osfp10 not needed on some/many platforms
397    case OSF1:    case OSF1:
398      echo "Configuring for DEC Alpha"      echo "Configuring for DEC Alpha"
399      set CPP        = ( '/usr/bin/cpp -P' )      set CPP        = ( '/usr/bin/cpp -P' )
400      set DEFINES    = ( ${DEFINES}  '-DTARGET_DEC -DWORDLENGTH=1' )      set DEFINES    = ( ${DEFINES}  '-DTARGET_DEC -DWORDLENGTH=1' )
401        set MAKEDEPEND = ( mkdep -f depend.out )
402    #ph: makedepend not available on some/many DEC Alpha's; use mkdep instead
403      set KPP        = ( )      set KPP        = ( )
404      set KPPFILES   = ( )      set KPPFILES   = ( )
405      set KFLAGS1    = ( )      set KFLAGS1    = ( )
406      set FC         = ( 'f77' )      set FC         = ( 'f77' )
407      set FFLAGS     = ( '-convert big_endian -r8 -extend_source -automatic -call_shared -notransform_loops -align dcommons' )      set FFLAGS     = ( '-convert big_endian -r8 -extend_source -automatic -call_shared -notransform_loops -align dcommons' )
408      set FOPTIM     = ( '-O5 -fast -tune host -inline all' )      set FOPTIM     = ( '-O5 -fast -tune host -inline all' )
409    #ph: -O5 probably too aggressive in conjunction with adjoint code
410      set NOOPTFLAGS = ( '-O0' )      set NOOPTFLAGS = ( '-O0' )
411      set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F')      set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F')
412      set RMFILES    = ( '*.p.out' )      set RMFILES    = ( '*.p.out' )
# Line 400  switch ($platform$USEMPI) Line 427  switch ($platform$USEMPI)
427      set INCLUDES   = ( '-I/usr/local/mpi/include' )      set INCLUDES   = ( '-I/usr/local/mpi/include' )
428      set FFLAGS     = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4 -r8 -static' )      set FFLAGS     = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4 -r8 -static' )
429      set FOPTIM     = ( '-O3' )      set FOPTIM     = ( '-O3' )
430  #   set NOOPTFLAGS = ( '-O0' )      if ($?IEEE) set FFLAGS = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4 -static' )
431  #   set NOOPTFILES = ( 'barrier.F different_multiple.F ' \      if ($?IEEE) set FOPTIM = ( '-O0 -OPT:IEEE_arithmetic=1 -OPT:IEEE_NaN_inf=ON' )
 #                      'external_fields_load.F' )  
432      set RMFILES    = ( 'rii_files' )      set RMFILES    = ( 'rii_files' )
433      breaksw      breaksw
434    case o2:    case o2:
# Line 428  switch ($platform$USEMPI) Line 454  switch ($platform$USEMPI)
454      set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )      set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )
455      set INCLUDES   = ( '-I/usr/include' )      set INCLUDES   = ( '-I/usr/include' )
456      set FFLAGS     = ( '-n32 -extend_source -bytereclen' )      set FFLAGS     = ( '-n32 -extend_source -bytereclen' )
457      set FOPTIM     = ( '-O2' )      set FOPTIM     = ( '-O3 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed' )
     set NOOPTFILES = ( 'calc_mom_rhs.F' )  
     set NOOPTFLAGS = ( '-O1' )  
458      set LIBS       = ( '-lmpi -lscs' )      set LIBS       = ( '-lmpi -lscs' )
459      breaksw      breaksw
460      case o2k_noopt:
461      case o2k_noopt+mpi:
462        echo "Configuring for SGI Origin2000 running IRIX 6.5"
463        set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )
464        set INCLUDES   = ( '-I/usr/include' )
465        set FFLAGS     = ( '-n32 -extend_source -bytereclen' )
466        set FOPTIM     = ( '-O0' )
467        set LIBS       = ( '-lmpi' )
468        breaksw
469      case ames_dbg+mpi:
470        echo "Configuring for SGI Origin2000 running IRIX 6.5"
471        set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )
472        set INCLUDES   = ( '-I/usr/include -I/opt/mpt/1.6.1.beta/usr/include' )
473        set FFLAGS     = ( '-n32 -extend_source -bytereclen' )
474        set LIBS       = ( '-lmpi -lscs' )
475        set FC         = ( 'f90' )
476        set LINK       = ( 'f90' )
477        breaksw
478      case ames_opt+mpi:
479        echo "Configuring for SGI Origin2000 running IRIX 6.5"
480        set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )
481        set INCLUDES   = ( '-I/usr/include -I/opt/mpt/1.6.1.beta/usr/include' )
482        set FFLAGS     = ( '-n32 -extend_source -bytereclen' )
483        set FOPTIM     = ( '-O3 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed' )
484        set LIBS       = ( '-lmpi -lscs' )
485        set FC         = ( 'f90' )
486        set LINK       = ( 'f90' )
487        breaksw
488    case onyx:    case onyx:
489    case onyx+mpi:    case onyx+mpi:
490      echo "Configuring for SGI ONYX running IRIX64"      echo "Configuring for SGI ONYX running IRIX64"
# Line 466  switch ($platform$USEMPI) Line 518  switch ($platform$USEMPI)
518                         '-lsocket -lnsl' )                         '-lsocket -lnsl' )
519      set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F ini_vertical_grid.F ini_spherical_polar_grid.F ini_cori.F mon_printstats_rl.F mon_printstats_rs.F')      set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F ini_vertical_grid.F ini_spherical_polar_grid.F ini_cori.F mon_printstats_rl.F mon_printstats_rs.F')
520      breaksw      breaksw
521      case SunFire+mpi:
522        set FC         = ( 'mpf77' )  
523        set LINK       = ( 'mpf77' )
524        set LN         = ( '/usr/bin/ln -s' )
525        set CPP        = ( '/usr/ccs/lib/cpp -P' )
526        set MAKEDEPEND = ( ${TOOLSDIR}/xmakedepend )
527        set DEFINES    = ( ${DEFINES} '-DTARGET_SUN -DWORDLENGTH=4' )
528        set INCLUDES   = ( '-I/opt/SUNWhpc/include' )
529        set LIBS       = ( '-lmpi -lthread -lsocket -lnsl' )
530        set FFLAGS     = ( '-e -u -noautopar ' \
531                           '-xtypemap=real:64,double:64,integer:32 -fsimple=0' )
532        set FOPTIM     = ( '-dalign -O4 -xarch=native' )
533        set CFLAGS     = ( '-dalign -xO4 -xarch=native' )
534        set NOOPTFLAGS = ( '-dalign -O0 -xarch=native' )
535        breaksw
536    case IRIX32:    case IRIX32:
537      echo "Configuring for SGI ONYX running IRIX64"      echo "Configuring for SGI ONYX running IRIX64"
538      set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )      set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )
# Line 492  switch ($platform$USEMPI) Line 559  switch ($platform$USEMPI)
559      set NOOPTFILES = ( 'barrier.F different_multiple.F' \      set NOOPTFILES = ( 'barrier.F different_multiple.F' \
560                         'external_fields_load.F' )                         'external_fields_load.F' )
561      breaksw      breaksw
562      case Linux-ia64+mpi:
563        echo "Configuring with MPI"
564      case Linux-ia64:
565        echo "Configuring for " $platform
566        set LN = ( '/bin/ln -s' )
567        set CPP = ( '/lib/cpp -traditional -P' )
568        set DEFINES = ( ${DEFINES} '-D_BYTESWAPIO -DWORDLENGTH=4' )
569        set FC = ( 'efc' )
570        set FFLAGS = ( '-WB -Vaxlib -u -w' )
571        set FOPTIM = ( '-O2 ' )
572        set LINK = ( 'efc' )
573        set LIBS       = ( '-lmpi -lscs -lpthread' )
574        breaksw
575    case Linux-alpha+mpi:    case Linux-alpha+mpi:
576      echo "Configuring with MPI"      echo "Configuring with MPI"
577      set LIBS       = ( '-L/usr/local/lib/LINUX/ch_p4/ -lfmpich -lmpich' )      set LIBS       = ( '-L/usr/local/lib/LINUX/ch_p4/ -lfmpich -lmpich' )
# Line 538  switch ($platform$USEMPI) Line 618  switch ($platform$USEMPI)
618        set FFLAGS     = ( '-Wimplicit -Wunused -Wuninitialized' )        set FFLAGS     = ( '-Wimplicit -Wunused -Wuninitialized' )
619        if ($?IEEE) set FFLAGS = ( $FFLAGS '-ffloat-store' )        if ($?IEEE) set FFLAGS = ( $FFLAGS '-ffloat-store' )
620        set FOPTIM     = ( '-O3 -malign-double -funroll-loops' )        set FOPTIM     = ( '-O3 -malign-double -funroll-loops' )
621          set NOOPTFLAGS = ( '-O0' )
622        breaksw        breaksw
623       case pgf77:       case pgf77:
624        set DEFINES    = ( ${DEFINES} '-DWORDLENGTH=4' )        set DEFINES    = ( ${DEFINES} '-DWORDLENGTH=4' )
# Line 552  switch ($platform$USEMPI) Line 633  switch ($platform$USEMPI)
633        set FOPTIM     = ( '-O3 -align' )        set FOPTIM     = ( '-O3 -align' )
634  #P3   set FOPTIM     = ( $FOPTIM '-tpp6 -xWKM' )  #P3   set FOPTIM     = ( $FOPTIM '-tpp6 -xWKM' )
635  #P4   set FOPTIM     = ( $FOPTIM '-tpp7 -xWKM' )  #P4   set FOPTIM     = ( $FOPTIM '-tpp7 -xWKM' )
636        set LIBS       = ( '-lPEPCF90' )        set LIBS       = ( ${LIBS} '-lPEPCF90' )
637        breaksw        breaksw
638       default:       default:
639        echo Error: Linux compiler not recognized: \$FC=$FC        echo Error: Linux compiler not recognized: \$FC=$FC
# Line 594  switch ($platform$USEMPI) Line 675  switch ($platform$USEMPI)
675      set NOOPTFLAGS = ( '-O0' )      set NOOPTFLAGS = ( '-O0' )
676      set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F')      set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F')
677      breaksw      breaksw
678      case cg01+pgi:
679        set LN         = ( '/bin/ln -s' )
680        set CPP        = ( '/lib/cpp -traditional -P' )
681        set INCLUDES   = ( '-I/usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/include' )
682        set DEFINES    = ( ${DEFINES} '-DWORDLENGTH=4' )
683        set FC         = ( '/usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpif77' )
684        set FFLAGS     = ( '-byteswapio -r8 -Mnodclchk -Mextend' )
685    #    set LIBS       = ( '-L/home/cnh/src/gm-1.4/libgm')
686        set FOPTIM     = ( '-tp p6 -v -O2 -Munroll -Mvect=cachesize:512000,transform -Kieee' )
687        set LINK       = ( '/usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpif77' )
688        breaksw
689    case SP3:    case SP3:
690  # originally from A. Biastoch, SIO.  # originally from A. Biastoch, SIO.
691    # e.g. horizon.npaci.edu
692      echo "Configuring for IBM SP POWER3"      echo "Configuring for IBM SP POWER3"
693      set SOURCEDIRS  = ( ./ $SOURCEDIRS )      set SOURCEDIRS  = ( ./ $SOURCEDIRS )
694      set LN         = ( 'ln -s' )      set LN         = ( 'ln -s' )
# Line 618  switch ($platform$USEMPI) Line 711  switch ($platform$USEMPI)
711  #                      'external_fields_load.F' )  #                      'external_fields_load.F' )
712      set RMFILES    = ( 'rii_files' )      set RMFILES    = ( 'rii_files' )
713      breaksw      breaksw
714      case SP4:
715    #ph: e.g. bluesky.ucar.edu, marcellus.navo.hpc.mil
716        echo "Configuring for IBM SP POWER4"
717        set SOURCEDIRS  = ( ./ $SOURCEDIRS )
718        set LN         = ( 'ln -s' )
719        set DEFINES    = ( ${DEFINES} '-DTARGET_PWR3 -DTARGET_SGI -DWORDLENGTH=4' )
720        set INCLUDES   = ( '-I/usr/lpp/ppe.poe/include' )
721    #    set CPP        = ( '/lib/cpp' )
722        set FC         = ( 'mpxlf95' )
723        set LINK       = ( 'mpxlf95' )
724        set FLAGS      = ( '-O3 -qarch=pwr4 -qtune=pwr4 -qcache=auto -qmaxmem=-1' \
725                               '-bmaxdata:0x80000000 -bloadmap:mitgcmuv.map' )
726        set FFLAGS     = ( '-qfixed=132 -O3 -qarch=pwr4 -qtune=pwr4 -qcache=auto -qmaxmem=-1' \
727                               '-bmaxdata:0x80000000 ' )
728        set LDFLAGS    = ( '-O3 -qarch=pwr4 -qtune=pwr4 -qcache=auto -qmaxmem=-1' \
729                               '-bmaxdata:0x80000000' )
730        set LIBS       = ( ' -L/usr/local/apps/mass -lmass' )
731    #   set FFLAGS     = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4' )
732    #    set FOPTIM     = ( '-O3' )
733    #   set NOOPTFLAGS = ( '-O0' )
734    #   set NOOPTFILES = ( 'barrier.F different_multiple.F ' \
735    #                      'external_fields_load.F' )
736        set RMFILES    = ( 'rii_files' )
737        breaksw
738      case aer-linux-cluster+mpi
739        echo "Configuring for " $platform
740        set LN         = ( '/bin/ln -s' )
741        set CPP        = ( '/lib/cpp  -traditional -P' )
742        set DEFINES    = ( ${DEFINES} '-DWORDLENGTH=4' )
743        set FC         = ( '/opt/mpich/bin/mpif77' )
744        set LINK       = ( '/opt/mpich/bin/mpif77' )
745        set FFLAGS     = ( '-byteswapio -r8 -Mnodclchk -Mextend' )
746        set FOPTIM     = ( '-tp p6 -v -O2 -Munroll -Mvect=cachesize:512000,transform -Kieee' )
747        set LIBS       = ( '-L/opt/mpich/lib/ -lfmpich -lmpich' )
748        set INCLUDES   = ( '-I/opt/mpich/include' )
749        breaksw
750      case gfdl-sgi-o3k
751        echo "Configuring for " $platform
752        set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )
753        set FFLAGS     = ( 'extend_source -mp -mpio -bytereclen -mips4 -r8 -static' )
754        set FOPTIM     = ( '-O3' )
755        set LIBS       = ( '-lmpi' )
756        set INCLUDES   = ( '-I/opt/mpt/1510/usr/include' )
757        breaksw
758      default:
759        echo "Error: platform not recognized: uname -p = " $platform$USEMPI
760        exit
761        breaksw
762    default:    default:
763      echo "Error: platform not recognized: uname -p = " $platform$USEMPI      echo "Error: platform not recognized: uname -p = " $platform$USEMPI
764      exit      exit
# Line 835  CLEAN: Line 976  CLEAN:
976          @make Clean          @make Clean
977          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
978          -find \$(EXEDIR) -name "*.data" -exec rm {} \;          -find \$(EXEDIR) -name "*.data" -exec rm {} \;
979            -find \$(EXEDIR) -name "fort.*" -exec rm {} \;
980          -rm -f \$(EXECUTABLE)          -rm -f \$(EXECUTABLE)
981    
982  makefile:  makefile:

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.84

  ViewVC Help
Powered by ViewVC 1.1.22