/[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.57 by heimbach, Thu Nov 8 23:40:52 2001 UTC revision 1.63 by adcroft, Wed Aug 7 19:27:27 2002 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 )  set DISABLE = ( aim autodiff cal cost ctrl ecco exf grdchk flt ptracers )
13  set DEFINES = ( )  set DEFINES = ( )
14  set ENABLE  = ( )  set ENABLE  = ( )
15  set MODS  = ( )  set MODS  = ( )
# Line 78  while ($#allargs) Line 78  while ($#allargs)
78     echo "-enable overrides -disable, ie. a package listed in both is enabled"     echo "-enable overrides -disable, ie. a package listed in both is enabled"
79     exit     exit
80     breaksw     breaksw
  case -ieee:  
    set IEEE  
    breaksw  
81   case -enable=*:   case -enable=*:
82     set ENABLE = ( $ENABLE `echo $arg | sed 's/-enable=//' | sed 's/,/ /g' `)     set ENABLE = ( $ENABLE `echo $arg | sed 's/-enable=//' | sed 's/,/ /g' `)
83     breaksw     breaksw
84     case -cpp:
85     case -cpp=:
86       echo "To define CPP macros use -cpp=arg"
87       exit
88       breaksw
89     case -cpp=*:
90       set DEFINES = ( $DEFINES `echo $arg | sed 's/-cpp=//' | sed 's/,/ /g' `)
91       breaksw
92     case -ieee:
93       set IEEE
94       breaksw
95   case -mpi:   case -mpi:
96     echo "Enabling MPI options"     echo "Enabling MPI options"
97     set USEMPI     set USEMPI
# Line 92  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 -fc:
104     case -fc=:
105       echo "To change the compiler (\$FC) you must specify one with -fc="
106       echo "eg. -fc=f90  or  -fc=g77"
107       exit
108       breaksw
109     case -fc*:
110       if ($?FC) then
111        echo Option -fc=... can only be specified once.; exit 1
112       endif
113       set FC = ( `echo $arg | sed 's/-fc=//' `)
114       breaksw
115   case -help:   case -help:
116     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] [-disable=pkg1[,pkg2,...]] [-enable=pkg1[,pkg2,...]] [-mods=dir1[,dir2,...]] [-rootdir=dir]"
117  cat << EOF  cat << EOF
# Line 257  foreach dr ($PACKAGES) Line 277  foreach dr ($PACKAGES)
277      echo Adding pkg dir: $adr      echo Adding pkg dir: $adr
278      set SOURCEDIRS = ($SOURCEDIRS $adr)      set SOURCEDIRS = ($SOURCEDIRS $adr)
279      set INCLUDEDIRS = ($INCLUDEDIRS $adr)      set INCLUDEDIRS = ($INCLUDEDIRS $adr)
280        switch ($dr)
281          case ptracers:
282            set DEFINES = ($DEFINES '-DALLOW_PTRACERS'); breaksw
283          default:
284            breaksw
285        endsw
286    else    else
287      echo "                                      *" Package \"$dr\" NOT enabled.      echo "                                      *" Package \"$dr\" NOT enabled.
288      switch ($dr)      switch ($dr)
# Line 283  foreach dr ($STANDARDDIRS) Line 309  foreach dr ($STANDARDDIRS)
309    set INCLUDEDIRS = ($INCLUDEDIRS $idr)    set INCLUDEDIRS = ($INCLUDEDIRS $idr)
310  end  end
311    
312    # Find possible compilers
313    if ($?FC) then
314     echo "$FC was specified as the compiler"
315    else
316     echo " "
317     set likelysuspects=(ifc g77 pgf77 f77 f90 f95)
318     foreach fc ($likelysuspects)
319      set foundfc=`which $fc |& cat - `
320      if (-x $foundfc[1]) then
321       if ($?possiblefc) then
322        set possiblefc=($possiblefc $fc)
323       else
324        set possiblefc=$fc
325       endif
326      endif
327     end
328     if ($?possiblefc) then
329      set FC=$possiblefc[1]
330      echo Found these compilers: $possiblefc.  Using \"$FC\" as the compiler
331     else
332      echo "No compiler found\!"
333      echo I tried looking for \"$likelysuspects\" in your \$PATH but found none
334      exit 13
335     endif
336    endif
337    
338  # This is the generic configuration.  # This is the generic configuration.
339  # Platform specific options are chosen below  # Platform specific options are chosen below
340  set LN         = ( 'ln -s' )  set LN         = ( 'ln -s' )
341  set CPP        = ( '/lib/cpp -P' )  set CPP        = ( '/lib/cpp -P' )
342  set S64        = ( '$(TOOLSDIR)/set64bitConst.sh' )  set S64        = ( '$(TOOLSDIR)/set64bitConst.sh' )
343  set KPP        = (  )  set KPP        = (  )
344  set FC         = ( 'f77' )  #set FC         = ( 'f77' )
345  set LINK       = ( 'f77' )  set LINK       = $FC
346    set MAKEDEPEND = ( 'makedepend' )
347  set INCLUDES   = ( -I. )  set INCLUDES   = ( -I. )
348  set FFLAGS     = (  )  set FFLAGS     = (  )
349  set FOPTIM     = (  )  set FOPTIM     = (  )
# Line 393  switch ($platform$USEMPI) Line 446  switch ($platform$USEMPI)
446    case SunOS:    case SunOS:
447      set LN         = ( '/usr/bin/ln -s' )      set LN         = ( '/usr/bin/ln -s' )
448      set CPP        = ( '/usr/ccs/lib/cpp -P' )      set CPP        = ( '/usr/ccs/lib/cpp -P' )
449      set S64        = ( cat )      set MAKEDEPEND = ( ${TOOLSDIR}/xmakedepend )
450      set DEFINES    = ( ${DEFINES} '-DTARGET_SUN -DWORDLENGTH=4 -D_d=E' )      set DEFINES    = ( ${DEFINES} '-DTARGET_SUN -DWORDLENGTH=4 -D_d=E' )
451      set FFLAGS     = ( '-stackvar -explicitpar -vpara -e -u -noautopar -r8 -i4 -fsimple=0' )      set FFLAGS     = ( '-stackvar -explicitpar -vpara -e -u -noautopar -xtypemap=real:64,double:64,integer:32 -fsimple=0' )
452      set FOPTIM     = ( '-dalign -O3 -xarch=v9' )      set FOPTIM     = ( '-dalign -O3 -xarch=v9' )
453      set CFLAGS     = ( '-dalign -O3 -xarch=v9' )      set CFLAGS     = ( '-dalign -O3 -xarch=v9' )
454      set NOOPTFLAGS = ( '-dalign -O0 -xarch=v9' )      set NOOPTFLAGS = ( '-dalign -O0 -xarch=v9' )
# Line 404  switch ($platform$USEMPI) Line 457  switch ($platform$USEMPI)
457    case SunOS+mpi:    case SunOS+mpi:
458      set LN         = ( '/usr/bin/ln -s' )      set LN         = ( '/usr/bin/ln -s' )
459      set CPP        = ( '/usr/ccs/lib/cpp -P' )      set CPP        = ( '/usr/ccs/lib/cpp -P' )
     set S64        = ( cat )  
460      set DEFINES    = ( ${DEFINES} '-DTARGET_SUN -DWORDLENGTH=4 -D_d=E' )      set DEFINES    = ( ${DEFINES} '-DTARGET_SUN -DWORDLENGTH=4 -D_d=E' )
461      set INCLUDES   = ( '-I/usr/local/mpi/include' )      set INCLUDES   = ( '-I/usr/local/mpi/include' )
462      set LIBS       = ( '-L/usr/local/mpi/lib/solaris/ch_shmem -lmpi -lthread' \      set LIBS       = ( '-L/usr/local/mpi/lib/solaris/ch_shmem -lmpi -lthread' \
463      set FFLAGS     = ( '-stackvar -explicitpar -vpara -e -u -noautopar -r8 -i4 -fsimple=0' )      set FFLAGS     = ( '-stackvar -explicitpar -vpara -e -u -noautopar -xtypemap=real:64,double:64,integer:32 -fsimple=0' )
464      set FOPTIM     = ( '-dalign -O3 -xarch=v9' )      set FOPTIM     = ( '-dalign -O3 -xarch=v9' )
465      set NOOPTFLAGS = ( '-dalign -O0 -xarch=v9' )      set NOOPTFLAGS = ( '-dalign -O0 -xarch=v9' )
466                         '-lsocket -lnsl' )                         '-lsocket -lnsl' )
# Line 480  switch ($platform$USEMPI) Line 532  switch ($platform$USEMPI)
532      echo "Configuring for " $platform      echo "Configuring for " $platform
533      set LN         = ( '/bin/ln -s' )      set LN         = ( '/bin/ln -s' )
534      set CPP        = ( '/lib/cpp  -traditional -P' )      set CPP        = ( '/lib/cpp  -traditional -P' )
535      set DEFINES    = ( ${DEFINES} '-D_BYTESWAPIO -DWORDLENGTH=4' )      switch ($FC)
536      set FC         = ( 'g77' )       case g77:
537      set FFLAGS     = ( '-Wimplicit -Wunused -Wuninitialized' )        set DEFINES    = ( ${DEFINES} '-D_BYTESWAPIO -DWORDLENGTH=4' )
538      if ($?IEEE) set FFLAGS     = ( $FFLAGS '-ffloat-store' )        set FFLAGS     = ( '-Wimplicit -Wunused -Wuninitialized' )
539      set FOPTIM     = ( '-O3 -malign-double -funroll-loops' )        if ($?IEEE) set FFLAGS = ( $FFLAGS '-ffloat-store' )
540      set LINK       = ( 'g77' )        set FOPTIM     = ( '-O3 -malign-double -funroll-loops' )
541          breaksw
542         case pgf77:
543          set DEFINES    = ( ${DEFINES} '-DWORDLENGTH=4' )
544          set FC         = ( 'pgf77' )
545          set FFLAGS     = ( '-byteswapio -r8 -Mnodclchk -Mextend' )
546          set FOPTIM     = ( '-tp p6 -v -O2 -Munroll -Mvect=cachesize:512000,transform -Kieee' )
547          breaksw
548         case ifc:
549          set DEFINES    = ( ${DEFINES} '-D_BYTESWAPIO -DWORDLENGTH=4' )
550          set FFLAGS     = ( '-132 -r8 -i4 -w95 -W0 -WB' )
551          if ($?IEEE) set FFLAGS     = ( $FFLAGS '-mp' )
552          set FOPTIM     = ( '-O3 -align' )
553    #P3   set FOPTIM     = ( $FOPTIM '-tpp6 -xWKM' )
554    #P4   set FOPTIM     = ( $FOPTIM '-tpp7 -xWKM' )
555          set LIBS       = ( '-lPEPCF90' )
556          breaksw
557         default:
558          echo Error: Linux compiler not recognized: \$FC=$FC
559          exit
560          breaksw
561        endsw      
562      breaksw      breaksw
563    case T3E:    case T3E:
564    case sn6312:    case sn6312:
# Line 537  switch ($platform$USEMPI) Line 610  switch ($platform$USEMPI)
610                             '-bmaxdata:0x80000000 ' )                             '-bmaxdata:0x80000000 ' )
611      set LDFLAGS    = ( '-O3 -qarch=pwr3 -qtune=pwr3 -qcache=auto -qmaxmem=-1' \      set LDFLAGS    = ( '-O3 -qarch=pwr3 -qtune=pwr3 -qcache=auto -qmaxmem=-1' \
612                             '-bmaxdata:0x80000000' )                             '-bmaxdata:0x80000000' )
613      set LIBS       = ( ' timer_stats.o -L/usr/local/apps/mass -lmass' )      set LIBS       = ( ' -L/usr/local/apps/mass -lmass' )
614  #   set FFLAGS     = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4' )  #   set FFLAGS     = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4' )
615  #    set FOPTIM     = ( '-O3' )  #    set FOPTIM     = ( '-O3' )
616  #   set NOOPTFLAGS = ( '-O0' )  #   set NOOPTFLAGS = ( '-O0' )
# Line 636  cat >> ${mfile} <<EOF Line 709  cat >> ${mfile} <<EOF
709  # CPP          : C-preprocessor command  # CPP          : C-preprocessor command
710  # INCLUDES     : Directories searched for header files  # INCLUDES     : Directories searched for header files
711  # DEFINES      : Macro definitions for CPP  # DEFINES      : Macro definitions for CPP
712    # MAKEDEPEND   : Dependency generator
713  # KPP          : Special preprocessor command (specific to platform)  # KPP          : Special preprocessor command (specific to platform)
714  # KFLAGS       : Flags for KPP  # KFLAGS       : Flags for KPP
715  # FC           : Fortran compiler command  # FC           : Fortran compiler command
# Line 694  cat >> ${mfile} <<EOF Line 768  cat >> ${mfile} <<EOF
768  LN = ${LN}  LN = ${LN}
769  # C preprocessor  # C preprocessor
770  CPP = cat \$< | ${S64} | ${CPP}  CPP = cat \$< | ${S64} | ${CPP}
771    # Dependency generator
772    MAKEDEPEND = ${MAKEDEPEND}
773  # Special preprocessor (KAP on DECs, FPP on Crays)  # Special preprocessor (KAP on DECs, FPP on Crays)
774  KPP = ${KPP}  KPP = ${KPP}
775  # Fortran compiler  # Fortran compiler
# Line 739  all: \$(EXECUTABLE) Line 815  all: \$(EXECUTABLE)
815          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)
816  depend:  depend:
817          @make links          @make links
818          makedepend -o .f \$(DEFINES) \$(INCLUDES) \$(SRCFILES)          \$(MAKEDEPEND) -o .f \$(DEFINES) \$(INCLUDES) \$(SRCFILES)
819    
820  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES)  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES)
821    
# Line 750  output.txt: \$(EXECUTABLE) Line 826  output.txt: \$(EXECUTABLE)
826          @\$(EXECUTABLE) > \$@          @\$(EXECUTABLE) > \$@
827    
828  clean:  clean:
829          -rm -rf *.o *.f *.p ${RMFILES}          -rm -rf *.o *.f *.p ${RMFILES} work.{pc,pcl}
830  Clean:  Clean:
831          @make clean          @make clean
832          @make cleanlinks          @make cleanlinks

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

  ViewVC Help
Powered by ViewVC 1.1.22