/[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.62 by adcroft, Mon Mar 4 17:26:41 2002 UTC revision 1.66 by adcroft, Thu Aug 8 15:24:00 2002 UTC
# 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 272  foreach dr ($PACKAGES) Line 292  foreach dr ($PACKAGES)
292          set DEFINES = ($DEFINES '-DDISABLE_MOM_VECINV'); breaksw          set DEFINES = ($DEFINES '-DDISABLE_MOM_VECINV'); breaksw
293        case generic_advdiff:        case generic_advdiff:
294          set DEFINES = ($DEFINES '-DDISABLE_GENERIC_ADVDIFF'); breaksw          set DEFINES = ($DEFINES '-DDISABLE_GENERIC_ADVDIFF'); breaksw
295          case debug:
296            set DEFINES = ($DEFINES '-DDISABLE_DEBUGMODE'); breaksw
297        default:        default:
298          breaksw          breaksw
299      endsw      endsw
# Line 289  foreach dr ($STANDARDDIRS) Line 311  foreach dr ($STANDARDDIRS)
311    set INCLUDEDIRS = ($INCLUDEDIRS $idr)    set INCLUDEDIRS = ($INCLUDEDIRS $idr)
312  end  end
313    
314    # Find possible compilers
315    if ($?FC) then
316     echo "$FC was specified as the compiler"
317    else
318     echo " "
319     switch ($platform)
320      case Linux*:
321       set likelysuspects=(ifc g77 pgf77 f77 f90 f95)
322       breaksw
323      default:
324       set likelysuspects=(f77)
325       breaksw
326     endsw
327     foreach fc ($likelysuspects)
328      set foundfc=`which $fc |& cat - `
329      if (-x $foundfc[1]) then
330       if ($?possiblefc) then
331        set possiblefc=($possiblefc $fc)
332       else
333        set possiblefc=$fc
334       endif
335      endif
336     end
337     if ($?possiblefc) then
338      set FC=$possiblefc[1]
339      echo Found these compilers: $possiblefc.  Using \"$FC\" as the compiler
340     else
341      echo "No compiler found\!"
342      echo I tried looking for \"$likelysuspects\" in your \$PATH but found none
343      echo I will continue anyway and see what happens.
344      set FC = ( 'f77' )
345    # exit 13
346     endif
347    endif
348    
349  # This is the generic configuration.  # This is the generic configuration.
350  # Platform specific options are chosen below  # Platform specific options are chosen below
351  set LN         = ( 'ln -s' )  set LN         = ( 'ln -s' )
352  set CPP        = ( '/lib/cpp -P' )  set CPP        = ( '/lib/cpp -P' )
353  set S64        = ( '$(TOOLSDIR)/set64bitConst.sh' )  set S64        = ( '$(TOOLSDIR)/set64bitConst.sh' )
354  set KPP        = (  )  set KPP        = (  )
355  set FC         = ( 'f77' )  #set FC         = ( 'f77' )
356  set LINK       = ( 'f77' )  set LINK       = $FC
357  set MAKEDEPEND = ( 'makedepend' )  set MAKEDEPEND = ( 'makedepend' )
358  set INCLUDES   = ( -I. )  set INCLUDES   = ( -I. )
359  set FFLAGS     = (  )  set FFLAGS     = (  )
# Line 486  switch ($platform$USEMPI) Line 543  switch ($platform$USEMPI)
543      echo "Configuring for " $platform      echo "Configuring for " $platform
544      set LN         = ( '/bin/ln -s' )      set LN         = ( '/bin/ln -s' )
545      set CPP        = ( '/lib/cpp  -traditional -P' )      set CPP        = ( '/lib/cpp  -traditional -P' )
546      set DEFINES    = ( ${DEFINES} '-D_BYTESWAPIO -DWORDLENGTH=4' )      switch ($FC)
547      set FC         = ( 'g77' )       case g77:
548      set FFLAGS     = ( '-Wimplicit -Wunused -Wuninitialized' )        set DEFINES    = ( ${DEFINES} '-D_BYTESWAPIO -DWORDLENGTH=4' )
549      if ($?IEEE) set FFLAGS     = ( $FFLAGS '-ffloat-store' )        set FFLAGS     = ( '-Wimplicit -Wunused -Wuninitialized' )
550      set FOPTIM     = ( '-O3 -malign-double -funroll-loops' )        if ($?IEEE) set FFLAGS = ( $FFLAGS '-ffloat-store' )
551      set LINK       = ( 'g77' )        set FOPTIM     = ( '-O3 -malign-double -funroll-loops' )
552          breaksw
553         case pgf77:
554          set DEFINES    = ( ${DEFINES} '-DWORDLENGTH=4' )
555          set FC         = ( 'pgf77' )
556          set FFLAGS     = ( '-byteswapio -r8 -Mnodclchk -Mextend' )
557          set FOPTIM     = ( '-tp p6 -v -O2 -Munroll -Mvect=cachesize:512000,transform -Kieee' )
558          breaksw
559         case ifc:
560          set DEFINES    = ( ${DEFINES} '-D_BYTESWAPIO -DWORDLENGTH=4' )
561          set FFLAGS     = ( '-132 -r8 -i4 -w95 -W0 -WB' )
562          if ($?IEEE) set FFLAGS     = ( $FFLAGS '-mp' )
563          set FOPTIM     = ( '-O3 -align' )
564    #P3   set FOPTIM     = ( $FOPTIM '-tpp6 -xWKM' )
565    #P4   set FOPTIM     = ( $FOPTIM '-tpp7 -xWKM' )
566          set LIBS       = ( '-lPEPCF90' )
567          breaksw
568         default:
569          echo Error: Linux compiler not recognized: \$FC=$FC
570          exit
571          breaksw
572        endsw      
573      breaksw      breaksw
574    case T3E:    case T3E:
575    case sn6312:    case sn6312:
# Line 759  output.txt: \$(EXECUTABLE) Line 837  output.txt: \$(EXECUTABLE)
837          @\$(EXECUTABLE) > \$@          @\$(EXECUTABLE) > \$@
838    
839  clean:  clean:
840          -rm -rf *.o *.f *.p ${RMFILES}          -rm -rf *.o *.f *.p ${RMFILES} work.{pc,pcl}
841  Clean:  Clean:
842          @make clean          @make clean
843          @make cleanlinks          @make cleanlinks

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.66

  ViewVC Help
Powered by ViewVC 1.1.22