| 1 |
cnh |
1.1 |
#!/bin/csh -f |
| 2 |
|
|
# |
| 3 |
|
|
# $Header: /u/u0/gcmpack/MITgcm/tools/genmake,v 1.82 2003/06/27 01:59:09 heimbach Exp $ |
| 4 |
|
|
# $Name: $ |
| 5 |
|
|
# |
| 6 |
|
|
# Makefile generator for MITgcm UV codes |
| 7 |
|
|
# created by cnh 03/98 |
| 8 |
|
|
# adapted by aja 06/98 |
| 9 |
|
|
# modified by aja 01/00 |
| 10 |
|
|
|
| 11 |
|
|
# Default lists |
| 12 |
|
|
if (! $?DISABLE) set DISABLE = ( aim aim_v23 autodiff cal cost ctrl ecco exf grdchk flt land ptracers seaice therm_seaice bulk_force dic gchem ) |
| 13 |
|
|
if (! $?ENABLE) set ENABLE = ( ) |
| 14 |
|
|
if (! $?DEFINES) set DEFINES = ( ) |
| 15 |
|
|
if (! $?MODS) set MODS = ( ) |
| 16 |
|
|
|
| 17 |
|
|
# Grab variables/lists from .genmakerc |
| 18 |
|
|
if (-r .genmakerc) source .genmakerc |
| 19 |
|
|
|
| 20 |
|
|
# Process command-line arguments |
| 21 |
|
|
set allargs=( $argv ) |
| 22 |
|
|
while ($#allargs) |
| 23 |
|
|
set arg = $allargs[1] |
| 24 |
|
|
switch ($arg) |
| 25 |
|
|
case -makefile: |
| 26 |
|
|
set mfile = ( Makefile ) |
| 27 |
|
|
breaksw |
| 28 |
|
|
case -makefile=*: |
| 29 |
|
|
set mfile = ( `echo $arg | sed 's/-makefile=//' `) |
| 30 |
|
|
breaksw |
| 31 |
|
|
case -platform: |
| 32 |
|
|
case -platform=: |
| 33 |
|
|
echo "To change platform you must specify one with -platform=" |
| 34 |
|
|
echo "eg. -platform=sparc or -platform=mips" |
| 35 |
|
|
exit |
| 36 |
|
|
breaksw |
| 37 |
|
|
case -platform*: |
| 38 |
|
|
if ($?platform) then |
| 39 |
|
|
echo Option -platform=dir can only be specified once.; exit 1 |
| 40 |
|
|
endif |
| 41 |
|
|
set platform = ( `echo $arg | sed 's/-platform=//' `) |
| 42 |
|
|
breaksw |
| 43 |
|
|
case -rootdir: |
| 44 |
|
|
case -rootdir=: |
| 45 |
|
|
echo "To specify root directory you must specify one with -rootdir=dir" |
| 46 |
|
|
echo "with NO space eg. -rootdir=../../.. or -rootdir=/usr/people/joe/src" |
| 47 |
|
|
exit |
| 48 |
|
|
breaksw |
| 49 |
|
|
case -rootdir=*: |
| 50 |
|
|
if ($?ROOTDIR) then |
| 51 |
|
|
echo "***" Warning: variable \$ROOTDIR is already set to $ROOTDIR |
| 52 |
|
|
echo "***" Command line \"$arg\" will override this. |
| 53 |
|
|
endif |
| 54 |
|
|
set ROOTDIR = ( `echo $arg | sed 's/-rootdir=//' `) |
| 55 |
|
|
breaksw |
| 56 |
|
|
case -mods: |
| 57 |
|
|
case -mods=: |
| 58 |
|
|
echo "To specify an additional source directory you must specify one with -mods=dir" |
| 59 |
|
|
echo "with NO space eg. -mods=../code or -mods=/usr/people/joe/src" |
| 60 |
|
|
exit |
| 61 |
|
|
breaksw |
| 62 |
|
|
case -mods=*: |
| 63 |
|
|
set MODS = ( $MODS `echo $arg | sed 's/-mods=//' | sed 's/,/ /g' `) |
| 64 |
|
|
breaksw |
| 65 |
|
|
case -disable: |
| 66 |
|
|
case -disable=: |
| 67 |
|
|
echo "To disable packages from compilation use -disable=pkg1,pkg2" |
| 68 |
|
|
echo "with NO spaces eg. -disable=kpp,gmredi or -disable=all (to enable all packages)" |
| 69 |
|
|
exit |
| 70 |
|
|
breaksw |
| 71 |
|
|
case -disable=*: |
| 72 |
|
|
set DISABLE = ( $DISABLE `echo $arg | sed 's/-disable=//' | sed 's/,/ /g' `) |
| 73 |
|
|
breaksw |
| 74 |
|
|
case -enable: |
| 75 |
|
|
case -enable=: |
| 76 |
|
|
echo "To enable packages from compilation use -enable=pkg1,pkg2" |
| 77 |
|
|
echo "with NO spaces eg. -enable=aim or -enable=all (to enable all packages)" |
| 78 |
|
|
echo "-enable overrides -disable, ie. a package listed in both is enabled" |
| 79 |
|
|
exit |
| 80 |
|
|
breaksw |
| 81 |
|
|
case -enable=*: |
| 82 |
|
|
set ENABLE = ( $ENABLE `echo $arg | sed 's/-enable=//' | sed 's/,/ /g' `) |
| 83 |
|
|
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: |
| 96 |
|
|
echo "Enabling MPI options" |
| 97 |
|
|
set USEMPI |
| 98 |
|
|
breaksw |
| 99 |
|
|
case -jam: |
| 100 |
|
|
set include_jam_libs |
| 101 |
|
|
echo "Including paths to JAM libraries" |
| 102 |
|
|
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: |
| 116 |
|
|
echo "usage: $0 [-help] [-makefile[=...]] [-platform=...] [-mpi] [-jam] [-disable=pkg1[,pkg2,...]] [-enable=pkg1[,pkg2,...]] [-mods=dir1[,dir2,...]] [-rootdir=dir]" |
| 117 |
|
|
cat << EOF |
| 118 |
|
|
|
| 119 |
|
|
$0 is used to generate the Makefile in the current directory. |
| 120 |
|
|
|
| 121 |
|
|
Typical invocations are: |
| 122 |
|
|
o from "bin": ../tools/genmake |
| 123 |
|
|
o from "verification/expt/code": ../../../tools/genmake |
| 124 |
|
|
o from "verification/expt/input": ../../../tools/genmake -mods=../code |
| 125 |
|
|
o from a scratch directory: ~/mitgcm/tools/genmake -rootdir=~/mitgcm |
| 126 |
|
|
or ~/mitgcm/tools/genmake -rootdir=~/mitgcm -mods=~/mymods |
| 127 |
|
|
|
| 128 |
|
|
Packages (collected modules of code) can be disabled to avoid unnecessary |
| 129 |
|
|
compilation of unused code. For instance if you know you will not |
| 130 |
|
|
use GM/Redi, KPP and OBCS and they are appropriate turned-off in the |
| 131 |
|
|
configuration: |
| 132 |
|
|
.../tools/genmake -disable=gmredi,kpp,obcs |
| 133 |
|
|
|
| 134 |
|
|
If you add some source files you can re-call the previous instance of |
| 135 |
|
|
genmake with "make makefile". |
| 136 |
|
|
|
| 137 |
|
|
genmake also reads the file .genmakerc which can be used to configure |
| 138 |
|
|
options (primarily the command-line options above) for particular experiments. |
| 139 |
|
|
EOF |
| 140 |
|
|
exit |
| 141 |
|
|
breaksw |
| 142 |
|
|
default: |
| 143 |
|
|
echo "Unknown command-line option: " $arg |
| 144 |
|
|
echo $0 "-help to show usage" |
| 145 |
|
|
exit |
| 146 |
|
|
breaksw |
| 147 |
|
|
endsw |
| 148 |
|
|
shift allargs |
| 149 |
|
|
end |
| 150 |
|
|
|
| 151 |
|
|
# Default actions/options |
| 152 |
|
|
|
| 153 |
|
|
# If platform wasn't specified then determine platform type of the host |
| 154 |
|
|
if (! $?platform) then |
| 155 |
|
|
set platform = (`uname`) |
| 156 |
|
|
# This let's us distinguish between different Linux platforms |
| 157 |
|
|
if ($platform == Linux) then |
| 158 |
|
|
set machine = (`uname -m`) |
| 159 |
|
|
set platform = ($platform'-'$machine) |
| 160 |
|
|
endif |
| 161 |
|
|
endif |
| 162 |
|
|
# If name of makefile wasn't specified then use default "Makefile" |
| 163 |
|
|
if (! $?mfile) set mfile = ( Makefile ) |
| 164 |
|
|
|
| 165 |
|
|
set mach = ( `uname -a` ) |
| 166 |
|
|
echo Operating system: $mach |
| 167 |
|
|
|
| 168 |
|
|
# Directories for source, includes, binaries and executables |
| 169 |
|
|
# |
| 170 |
|
|
# If -rootdir wasn't specified then assume script is being run from bin |
| 171 |
|
|
# but if it was supplied then we should place the executable in the build dir |
| 172 |
|
|
if (! $?ROOTDIR) then |
| 173 |
|
|
set pwd=`pwd` |
| 174 |
|
|
if ($pwd:t == bin & -d ../model & -d ../eesupp & -d ../pkg) then |
| 175 |
|
|
set ROOTDIR = ( .. ) |
| 176 |
|
|
endif |
| 177 |
|
|
endif |
| 178 |
|
|
# Scan for logical ROOTDIR |
| 179 |
|
|
if (! $?ROOTDIR) then |
| 180 |
|
|
foreach dr (. .. ../.. ../../.. ../../../.. ../../../../..) |
| 181 |
|
|
if (-d $dr/model & -d $dr/eesupp & -d $dr/pkg) then |
| 182 |
|
|
set ROOTDIR = $dr |
| 183 |
|
|
echo ROOTDIR was not specified. Setting ROOTDIR = \"$ROOTDIR\" |
| 184 |
|
|
break |
| 185 |
|
|
endif |
| 186 |
|
|
end |
| 187 |
|
|
endif |
| 188 |
|
|
if (! $?ROOTDIR) then |
| 189 |
|
|
echo Root directory was not specified and could not be determined. |
| 190 |
|
|
echo Specify the root location of the model source with -rootdir=dir |
| 191 |
|
|
exit 1 |
| 192 |
|
|
endif |
| 193 |
|
|
if (! -d $ROOTDIR) then |
| 194 |
|
|
echo Root directory $ROOTDIR not found.;exit 1 |
| 195 |
|
|
endif |
| 196 |
|
|
# If -mods wasn't specified then we will assume that we can find all the |
| 197 |
|
|
# source code in the standard directories |
| 198 |
|
|
if (! $?MODS) then |
| 199 |
|
|
set SOURCEDIRS = ( ) |
| 200 |
|
|
set INCLUDEDIRS = ( ) |
| 201 |
|
|
else |
| 202 |
|
|
set SOURCEDIRS = ( $MODS ) |
| 203 |
|
|
set INCLUDEDIRS = ( $MODS ) |
| 204 |
|
|
endif |
| 205 |
|
|
if (! $?BUILDDIR) set BUILDDIR = ( . ) |
| 206 |
|
|
if (! -d $BUILDDIR) then |
| 207 |
|
|
echo Build directory $BUILDDIR not found.;exit 1 |
| 208 |
|
|
endif |
| 209 |
|
|
if (! $?EXEDIR) then |
| 210 |
|
|
set pwd=`pwd` |
| 211 |
|
|
if ($pwd:t == bin & -d ../exe & $ROOTDIR == ..) then |
| 212 |
|
|
set EXEDIR = ( ../exe ) |
| 213 |
|
|
else |
| 214 |
|
|
set EXEDIR = ( . ) |
| 215 |
|
|
endif |
| 216 |
|
|
endif |
| 217 |
|
|
if (! -d $EXEDIR) then |
| 218 |
|
|
echo Executable directory $EXEDIR not found.;exit 1 |
| 219 |
|
|
endif |
| 220 |
|
|
if (! $?TOOLSDIR) set TOOLSDIR = ( $ROOTDIR/tools ) |
| 221 |
|
|
if (! -d $TOOLSDIR) then |
| 222 |
|
|
echo Tools directory $TOOLSDIR not found.;exit 1 |
| 223 |
|
|
endif |
| 224 |
|
|
if (! $?EXECUTABLE) set EXECUTABLE = ( mitgcmuv ) |
| 225 |
|
|
|
| 226 |
|
|
# We have a special set of source files in eesupp/src which |
| 227 |
|
|
# are generated from some template source files. We'll make them |
| 228 |
|
|
# first so the appear as regular source code |
| 229 |
|
|
if (-r $ROOTDIR/eesupp/src/Makefile) then |
| 230 |
|
|
echo Making source files in eesupp from templates... |
| 231 |
|
|
(cd $ROOTDIR/eesupp/src/; make) >& make_eesupp.errs |
| 232 |
|
|
if ($status == 0) then |
| 233 |
|
|
rm -f make_eesupp.errs |
| 234 |
|
|
else |
| 235 |
|
|
cat make_eesupp.errs |
| 236 |
|
|
exit 2 |
| 237 |
|
|
endif |
| 238 |
|
|
endif |
| 239 |
|
|
|
| 240 |
|
|
# Now scan the standard source code tree |
| 241 |
|
|
foreach dr ($SOURCEDIRS) |
| 242 |
|
|
set adr=$dr |
| 243 |
|
|
if (! -d $adr) then |
| 244 |
|
|
echo mods directory $adr not found.; exit 1 |
| 245 |
|
|
endif |
| 246 |
|
|
echo Adding mods dir: $adr |
| 247 |
|
|
end |
| 248 |
|
|
if (! $?PACKAGES) then |
| 249 |
|
|
set PACKAGES=() |
| 250 |
|
|
foreach pkg (`cd $ROOTDIR/pkg; find . -type d -print | grep -v CVS | sed 's:\./::' | grep -v "\." | sort`) |
| 251 |
|
|
if (-d $ROOTDIR/pkg/$pkg) set PACKAGES=($PACKAGES $pkg) |
| 252 |
|
|
end |
| 253 |
|
|
endif |
| 254 |
|
|
foreach dr ($PACKAGES) |
| 255 |
|
|
set enable |
| 256 |
|
|
foreach p ($DISABLE) |
| 257 |
|
|
if ($p != 'all' & ! -d $ROOTDIR/pkg/$p) then |
| 258 |
|
|
echo Specified package \"$p\" does not exist. |
| 259 |
|
|
exit 1 |
| 260 |
|
|
endif |
| 261 |
|
|
if ($dr == $p) unset enable |
| 262 |
|
|
if ($p == 'all') unset enable |
| 263 |
|
|
# The following allows entire trees to be disabled |
| 264 |
|
|
if ($dr:h == $p) unset enable |
| 265 |
|
|
if ($dr:h:h == $p) unset enable |
| 266 |
|
|
if ($dr:h:h:h == $p) unset enable |
| 267 |
|
|
if ($dr:h:h:h:h == $p) unset enable |
| 268 |
|
|
end |
| 269 |
|
|
foreach p ($ENABLE) |
| 270 |
|
|
if ($dr == $p) set enable |
| 271 |
|
|
end |
| 272 |
|
|
if ($?enable) then |
| 273 |
|
|
set adr=$ROOTDIR/pkg/$dr |
| 274 |
|
|
if (! -d $adr) then |
| 275 |
|
|
echo Source directory $adr not found.; exit 1 |
| 276 |
|
|
endif |
| 277 |
|
|
echo Adding pkg dir: $adr |
| 278 |
|
|
set SOURCEDIRS = ($SOURCEDIRS $adr) |
| 279 |
|
|
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 |
| 287 |
|
|
echo " *" Package \"$dr\" NOT enabled. |
| 288 |
|
|
switch ($dr) |
| 289 |
|
|
case mom_fluxform: |
| 290 |
|
|
set DEFINES = ($DEFINES '-DDISABLE_MOM_FLUXFORM'); breaksw |
| 291 |
|
|
case mom_vecinv: |
| 292 |
|
|
set DEFINES = ($DEFINES '-DDISABLE_MOM_VECINV'); breaksw |
| 293 |
|
|
case generic_advdiff: |
| 294 |
|
|
set DEFINES = ($DEFINES '-DDISABLE_GENERIC_ADVDIFF'); breaksw |
| 295 |
|
|
case debug: |
| 296 |
|
|
set DEFINES = ($DEFINES '-DDISABLE_DEBUGMODE'); breaksw |
| 297 |
|
|
default: |
| 298 |
|
|
breaksw |
| 299 |
|
|
endsw |
| 300 |
|
|
endif |
| 301 |
|
|
end |
| 302 |
|
|
if (! $?STANDARDDIRS) set STANDARDDIRS=(eesupp model) |
| 303 |
|
|
foreach dr ($STANDARDDIRS) |
| 304 |
|
|
set adr=$ROOTDIR/$dr/src |
| 305 |
|
|
if (! -d $adr) then |
| 306 |
|
|
echo Source directory $adr not found.; exit 1 |
| 307 |
|
|
endif |
| 308 |
|
|
echo Adding src dir: $adr |
| 309 |
|
|
set SOURCEDIRS = ($SOURCEDIRS $adr) |
| 310 |
|
|
set idr = `echo $adr | sed 's/src/inc/'` |
| 311 |
|
|
set INCLUDEDIRS = ($INCLUDEDIRS $idr) |
| 312 |
|
|
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=(g77 ifc 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. |
| 350 |
|
|
# Platform specific options are chosen below |
| 351 |
|
|
set LN = ( 'ln -s' ) |
| 352 |
|
|
set CPP = ( '/lib/cpp -P' ) |
| 353 |
|
|
set S64 = ( '$(TOOLSDIR)/set64bitConst.sh' ) |
| 354 |
|
|
set KPP = ( ) |
| 355 |
|
|
#set FC = ( 'f77' ) |
| 356 |
|
|
set LINK = $FC |
| 357 |
|
|
set MAKEDEPEND = ( 'makedepend' ) |
| 358 |
|
|
set INCLUDES = ( -I. ) |
| 359 |
|
|
set FFLAGS = ( ) |
| 360 |
|
|
set FOPTIM = ( ) |
| 361 |
|
|
set CFLAGS = ( ) |
| 362 |
|
|
set KFLAGS1 = ( ) |
| 363 |
|
|
set KFLAGS2 = ( ) |
| 364 |
|
|
set LIBS = ( ) |
| 365 |
|
|
set KPPFILES = ( ) |
| 366 |
|
|
if (! $?NOOPTFILES ) set NOOPTFILES = ( ) |
| 367 |
|
|
if (! $?NOOPTFLAGS ) set NOOPTFLAGS = ( ) |
| 368 |
|
|
set RMFILES = ( ) |
| 369 |
|
|
|
| 370 |
|
|
# We often want to use different compile/link options is using MPI |
| 371 |
|
|
if ($?USEMPI) then |
| 372 |
|
|
set USEMPI = ( '+mpi' ) |
| 373 |
|
|
set DEFINES = ( ${DEFINES} '-DALLOW_USE_MPI -DALWAYS_USE_MPI' ) |
| 374 |
|
|
else |
| 375 |
|
|
set USEMPI |
| 376 |
|
|
# set DEFINES = ( ${DEFINES} '-UALLOW_USE_MPI -UALWAYS_USE_MPI' ) |
| 377 |
|
|
endif |
| 378 |
|
|
|
| 379 |
|
|
# Platform specific options |
| 380 |
|
|
switch ($platform$USEMPI) |
| 381 |
|
|
case OSF1+mpi: |
| 382 |
|
|
#ph: e.g. halem.gsfc.nasa.gov |
| 383 |
|
|
echo "Configuring for DEC Alpha with MPI" |
| 384 |
|
|
set LIBS = ( '-lfmpi -lmpi -lkmp_osfp10 -pthread' ) |
| 385 |
|
|
#ph: -lkmp_osfp10 not needed on some/many platforms |
| 386 |
|
|
case OSF1: |
| 387 |
|
|
echo "Configuring for DEC Alpha" |
| 388 |
|
|
set CPP = ( '/usr/bin/cpp -P' ) |
| 389 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_DEC -DWORDLENGTH=1' ) |
| 390 |
|
|
set MAKEDEPEND = ( mkdep -f depend.out ) |
| 391 |
|
|
#ph: makedepend not available on some/many DEC Alpha's; use mkdep instead |
| 392 |
|
|
set KPP = ( ) |
| 393 |
|
|
set KPPFILES = ( ) |
| 394 |
|
|
set KFLAGS1 = ( ) |
| 395 |
|
|
set FC = ( 'f77' ) |
| 396 |
|
|
set FFLAGS = ( '-convert big_endian -r8 -extend_source -automatic -call_shared -notransform_loops -align dcommons' ) |
| 397 |
|
|
set FOPTIM = ( '-O5 -fast -tune host -inline all' ) |
| 398 |
|
|
#ph: -O5 probably too aggressive in conjunction with adjoint code |
| 399 |
|
|
set NOOPTFLAGS = ( '-O0' ) |
| 400 |
|
|
set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F') |
| 401 |
|
|
set RMFILES = ( '*.p.out' ) |
| 402 |
|
|
breaksw |
| 403 |
|
|
case IRIX64+mpi: |
| 404 |
|
|
echo "Configuring for SGI Mips with MPI" |
| 405 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' ) |
| 406 |
|
|
set INCLUDES = ( '-I/usr/local/mpi/include' ) |
| 407 |
|
|
set FC = ( 'mpif77' ) |
| 408 |
|
|
set LINK = ( 'mpif77' ) |
| 409 |
|
|
set FFLAGS = ( '-extend_source -bytereclen -r10000 -mips4' ) |
| 410 |
|
|
set FOPTIM = ( '-O3' ) |
| 411 |
|
|
set RMFILES = ( 'rii_files' ) |
| 412 |
|
|
breaksw |
| 413 |
|
|
case IRIX64: |
| 414 |
|
|
echo "Configuring for SGI Mips" |
| 415 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' ) |
| 416 |
|
|
set INCLUDES = ( '-I/usr/local/mpi/include' ) |
| 417 |
|
|
set FFLAGS = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4 -r8 -static' ) |
| 418 |
|
|
set FOPTIM = ( '-O3' ) |
| 419 |
|
|
if ($?IEEE) set FFLAGS = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4 -static' ) |
| 420 |
|
|
if ($?IEEE) set FOPTIM = ( '-O0 -OPT:IEEE_arithmetic=1 -OPT:IEEE_NaN_inf=ON' ) |
| 421 |
|
|
set RMFILES = ( 'rii_files' ) |
| 422 |
|
|
breaksw |
| 423 |
|
|
case o2: |
| 424 |
|
|
case IRIX: |
| 425 |
|
|
echo "Configuring for SGI O2 running IRIX 6.5" |
| 426 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' ) |
| 427 |
|
|
set FFLAGS = ( '-extend_source -bytereclen -r10000 -mips4' ) |
| 428 |
|
|
set FOPTIM = ( '-O2' ) |
| 429 |
|
|
set NOOPTFLAGS = ( '-O0' ) |
| 430 |
|
|
breaksw |
| 431 |
|
|
case o2+mpi: |
| 432 |
|
|
case IRIX+mpi: |
| 433 |
|
|
echo "Configuring for SGI O2 running IRIX 6.5 with MPI" |
| 434 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' ) |
| 435 |
|
|
set FFLAGS = ( '-extend_source -bytereclen -r10000 -mips4' ) |
| 436 |
|
|
set FOPTIM = ( '-O2' ) |
| 437 |
|
|
set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F' ) |
| 438 |
|
|
set NOOPTFLAGS = ( '-O0' ) |
| 439 |
|
|
set LIBS = ( '-lmpi' ) |
| 440 |
|
|
breaksw |
| 441 |
|
|
case o2k+mpi: |
| 442 |
|
|
echo "Configuring for SGI Origin2000 running IRIX 6.5" |
| 443 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' ) |
| 444 |
|
|
set INCLUDES = ( '-I/usr/include' ) |
| 445 |
|
|
set FFLAGS = ( '-n32 -extend_source -bytereclen' ) |
| 446 |
|
|
set FOPTIM = ( '-O3 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed' ) |
| 447 |
|
|
set LIBS = ( '-lmpi -lscs' ) |
| 448 |
|
|
breaksw |
| 449 |
|
|
case o2k_noopt: |
| 450 |
|
|
case o2k_noopt+mpi: |
| 451 |
|
|
echo "Configuring for SGI Origin2000 running IRIX 6.5" |
| 452 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' ) |
| 453 |
|
|
set INCLUDES = ( '-I/usr/include' ) |
| 454 |
|
|
set FFLAGS = ( '-n32 -extend_source -bytereclen' ) |
| 455 |
|
|
set FOPTIM = ( '-O0' ) |
| 456 |
|
|
set LIBS = ( '-lmpi' ) |
| 457 |
|
|
breaksw |
| 458 |
|
|
case ames_dbg+mpi: |
| 459 |
|
|
echo "Configuring for SGI Origin2000 running IRIX 6.5" |
| 460 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' ) |
| 461 |
|
|
set INCLUDES = ( '-I/usr/include -I/opt/mpt/1.6.1.beta/usr/include' ) |
| 462 |
|
|
set FFLAGS = ( '-n32 -extend_source -bytereclen' ) |
| 463 |
|
|
set LIBS = ( '-lmpi -lscs' ) |
| 464 |
|
|
set FC = ( 'f90' ) |
| 465 |
|
|
set LINK = ( 'f90' ) |
| 466 |
|
|
breaksw |
| 467 |
|
|
case ames_opt+mpi: |
| 468 |
|
|
echo "Configuring for SGI Origin2000 running IRIX 6.5" |
| 469 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' ) |
| 470 |
|
|
set INCLUDES = ( '-I/usr/include -I/opt/mpt/1.6.1.beta/usr/include' ) |
| 471 |
|
|
set FFLAGS = ( '-n32 -extend_source -bytereclen' ) |
| 472 |
|
|
set FOPTIM = ( '-O3 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed' ) |
| 473 |
|
|
set LIBS = ( '-lmpi -lscs' ) |
| 474 |
|
|
set FC = ( 'f90' ) |
| 475 |
|
|
set LINK = ( 'f90' ) |
| 476 |
|
|
breaksw |
| 477 |
|
|
case onyx: |
| 478 |
|
|
case onyx+mpi: |
| 479 |
|
|
echo "Configuring for SGI ONYX running IRIX64" |
| 480 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' ) |
| 481 |
|
|
set FFLAGS = ( '-extend_source -bytereclen -r10000 -64' ) |
| 482 |
|
|
set FOPTIM = ( '-O2' ) |
| 483 |
|
|
set NOOPTFLAGS = ( '-O0' ) |
| 484 |
|
|
set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F' ) |
| 485 |
|
|
set LIBS = ( '-lmpi' ) |
| 486 |
|
|
breaksw |
| 487 |
|
|
case SunOS: |
| 488 |
|
|
set LN = ( '/usr/bin/ln -s' ) |
| 489 |
|
|
set CPP = ( '/usr/ccs/lib/cpp -P' ) |
| 490 |
|
|
set MAKEDEPEND = ( ${TOOLSDIR}/xmakedepend ) |
| 491 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SUN -DWORDLENGTH=4 -D_d=E' ) |
| 492 |
|
|
set FFLAGS = ( '-stackvar -explicitpar -vpara -e -u -noautopar -xtypemap=real:64,double:64,integer:32 -fsimple=0' ) |
| 493 |
|
|
set FOPTIM = ( '-dalign -O3 -xarch=v9' ) |
| 494 |
|
|
set CFLAGS = ( '-dalign -O3 -xarch=v9' ) |
| 495 |
|
|
set NOOPTFLAGS = ( '-dalign -O0 -xarch=v9' ) |
| 496 |
|
|
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 aim_aim2dyn.F aim_dyn2aim.F aim_aim2dyn_exchanges.F aim_external_fields_load.F aim_calc_diags.F aim_external_forcing.F aim_do_atmos_physics.F aim_write_diags.F aim_do_inphys.F ') |
| 497 |
|
|
breaksw |
| 498 |
|
|
case SunOS+mpi: |
| 499 |
|
|
set LN = ( '/usr/bin/ln -s' ) |
| 500 |
|
|
set CPP = ( '/usr/ccs/lib/cpp -P' ) |
| 501 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SUN -DWORDLENGTH=4 -D_d=E' ) |
| 502 |
|
|
set INCLUDES = ( '-I/usr/local/mpi/include' ) |
| 503 |
|
|
set LIBS = ( '-L/usr/local/mpi/lib/solaris/ch_shmem -lmpi -lthread' \ |
| 504 |
|
|
set FFLAGS = ( '-stackvar -explicitpar -vpara -e -u -noautopar -xtypemap=real:64,double:64,integer:32 -fsimple=0' ) |
| 505 |
|
|
set FOPTIM = ( '-dalign -O3 -xarch=v9' ) |
| 506 |
|
|
set NOOPTFLAGS = ( '-dalign -O0 -xarch=v9' ) |
| 507 |
|
|
'-lsocket -lnsl' ) |
| 508 |
|
|
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') |
| 509 |
|
|
breaksw |
| 510 |
|
|
case SunFire+mpi: |
| 511 |
|
|
set FC = ( 'mpf77' ) |
| 512 |
|
|
set LINK = ( 'mpf77' ) |
| 513 |
|
|
set LN = ( '/usr/bin/ln -s' ) |
| 514 |
|
|
set CPP = ( '/usr/ccs/lib/cpp -P' ) |
| 515 |
|
|
set MAKEDEPEND = ( ${TOOLSDIR}/xmakedepend ) |
| 516 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SUN -DWORDLENGTH=4' ) |
| 517 |
|
|
set INCLUDES = ( '-I/opt/SUNWhpc/include' ) |
| 518 |
|
|
set LIBS = ( '-lmpi -lthread -lsocket -lnsl' ) |
| 519 |
|
|
set FFLAGS = ( '-e -u -noautopar ' \ |
| 520 |
|
|
'-xtypemap=real:64,double:64,integer:32 -fsimple=0' ) |
| 521 |
|
|
set FOPTIM = ( '-dalign -O4 -xarch=native' ) |
| 522 |
|
|
set CFLAGS = ( '-dalign -xO4 -xarch=native' ) |
| 523 |
|
|
set NOOPTFLAGS = ( '-dalign -O0 -xarch=native' ) |
| 524 |
|
|
breaksw |
| 525 |
|
|
case IRIX32: |
| 526 |
|
|
echo "Configuring for SGI ONYX running IRIX64" |
| 527 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' ) |
| 528 |
|
|
set INCLUDES = ( '-I/usr/include' ) |
| 529 |
|
|
set FFLAGS = ( '-extend_source -bytereclen -r10000 -64' ) |
| 530 |
|
|
set FOPTIM = ( '-O2' ) |
| 531 |
|
|
set NOOPTFLAGS = ( '-O0' ) |
| 532 |
|
|
set NOOPTFILES = ( 'barrier.F different_multiple.F ' \ |
| 533 |
|
|
'external_fields_load.F' ) |
| 534 |
|
|
set LIBS = ( '-lmpi' ) |
| 535 |
|
|
breaksw |
| 536 |
|
|
case HP-UX+mpi: |
| 537 |
|
|
set FC = ( 'mpif77' ) |
| 538 |
|
|
set LINK = ( 'mpif77' ) |
| 539 |
|
|
set INCLUDES = ( '-I/opt/mpi/include' ) |
| 540 |
|
|
case HP-UX: |
| 541 |
|
|
echo "Configuring for HP Exemplar" |
| 542 |
|
|
set CPP = ( '/usr/ccs/lbin/cpp -P' ) |
| 543 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_HP -DWORDLENGTH=4' ) |
| 544 |
|
|
set FFLAGS = ( '+es +U77 +Onoautopar +Oexemplar_model' \ |
| 545 |
|
|
'+Okernel_threads' ) |
| 546 |
|
|
set FOPTIM = ( '+O2' ) |
| 547 |
|
|
set NOOPTFLAGS = ( '+O0' ) |
| 548 |
|
|
set NOOPTFILES = ( 'barrier.F different_multiple.F' \ |
| 549 |
|
|
'external_fields_load.F' ) |
| 550 |
|
|
breaksw |
| 551 |
|
|
case Linux-alpha+mpi: |
| 552 |
|
|
echo "Configuring with MPI" |
| 553 |
|
|
set LIBS = ( '-L/usr/local/lib/LINUX/ch_p4/ -lfmpich -lmpich' ) |
| 554 |
|
|
set INCLUDES = ( '-I/usr/local/include' ) |
| 555 |
|
|
case Linux-alpha: |
| 556 |
|
|
echo "Configuring for " $platform |
| 557 |
|
|
set LN = ( '/bin/ln -s' ) |
| 558 |
|
|
set CPP = ( '/lib/cpp -traditional -P' ) |
| 559 |
|
|
set DEFINES = ( ${DEFINES} '-D_BYTESWAPIO -DWORDLENGTH=4' ) |
| 560 |
|
|
set FC = ( 'g77' ) |
| 561 |
|
|
set FFLAGS = ( ' ' ) |
| 562 |
|
|
if ($?IEEE) set FFLAGS = ( $FFLAGS '-ffloat-store' ) |
| 563 |
|
|
set FOPTIM = ( '-ffast-math -fexpensive-optimizations -fomit-frame-pointer -O3' ) |
| 564 |
|
|
set LINK = ( 'g77' ) |
| 565 |
|
|
breaksw |
| 566 |
|
|
case Linux*+pgi+mpi: |
| 567 |
|
|
if ($?include_jam_libs) then |
| 568 |
|
|
set INCLUDES = ( '-I/usr/local/mpich-1.2.1/pgi_fortran_binding/include' ) |
| 569 |
|
|
set LIBS = ( '-L/usr/local/mpich-1.2.1/pgi_fortran_binding/lib/ -lfmpich -lmpich' ) |
| 570 |
|
|
else |
| 571 |
|
|
set INCLUDES = ( '-I/usr/local/include' ) |
| 572 |
|
|
set LIBS = ( '-L/usr/local/lib/LINUX/ch_p4/ -lfmpich -lmpich' ) |
| 573 |
|
|
endif |
| 574 |
|
|
case Linux*+pgi: |
| 575 |
|
|
echo "Configuring for " $platform |
| 576 |
|
|
set LN = ( '/bin/ln -s' ) |
| 577 |
|
|
set CPP = ( '/lib/cpp -traditional -P' ) |
| 578 |
|
|
set DEFINES = ( ${DEFINES} '-DWORDLENGTH=4' ) |
| 579 |
|
|
set FC = ( 'pgf77' ) |
| 580 |
|
|
set FFLAGS = ( '-byteswapio -r8 -Mnodclchk -Mextend' ) |
| 581 |
|
|
set FOPTIM = ( '-tp p6 -v -O2 -Munroll -Mvect=cachesize:512000,transform -Kieee' ) |
| 582 |
|
|
set LINK = ( 'pgf77' ) |
| 583 |
|
|
breaksw |
| 584 |
|
|
case Linux*+mpi: |
| 585 |
|
|
set LIBS = ( '-L/usr/local/lib/LINUX/ch_p4/ -lfmpich -lmpich' ) |
| 586 |
|
|
set INCLUDES = ( '-I/usr/local/include' ) |
| 587 |
|
|
case Linux*: |
| 588 |
|
|
echo "Configuring for " $platform |
| 589 |
|
|
set LN = ( '/bin/ln -s' ) |
| 590 |
|
|
set CPP = ( '/lib/cpp -traditional -P' ) |
| 591 |
|
|
switch ($FC) |
| 592 |
|
|
case g77: |
| 593 |
|
|
set DEFINES = ( ${DEFINES} '-D_BYTESWAPIO -DWORDLENGTH=4' ) |
| 594 |
|
|
set FFLAGS = ( '-Wimplicit -Wunused -Wuninitialized' ) |
| 595 |
|
|
if ($?IEEE) set FFLAGS = ( $FFLAGS '-ffloat-store' ) |
| 596 |
|
|
set FOPTIM = ( '-O3 -malign-double -funroll-loops' ) |
| 597 |
|
|
set NOOPTFLAGS = ( '-O0' ) |
| 598 |
|
|
breaksw |
| 599 |
|
|
case pgf77: |
| 600 |
|
|
set DEFINES = ( ${DEFINES} '-DWORDLENGTH=4' ) |
| 601 |
|
|
set FC = ( 'pgf77' ) |
| 602 |
|
|
set FFLAGS = ( '-byteswapio -r8 -Mnodclchk -Mextend' ) |
| 603 |
|
|
set FOPTIM = ( '-tp p6 -v -O2 -Munroll -Mvect=cachesize:512000,transform -Kieee' ) |
| 604 |
|
|
breaksw |
| 605 |
|
|
case ifc: |
| 606 |
|
|
set FC = ( '/usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/intel/bin/mpif77' ) |
| 607 |
|
|
set LINK = ( '/usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/intel/bin/mpif77' ) |
| 608 |
|
|
set DEFINES = ( ${DEFINES} '-D_BYTESWAPIO -DWORDLENGTH=4' ) |
| 609 |
|
|
set INCLUDES = ( '-I/usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/intel/include' ) |
| 610 |
|
|
set FFLAGS = ( '-132 -r8 -i4 -w95 -W0 -WB' ) |
| 611 |
|
|
if ($?IEEE) set FFLAGS = ( $FFLAGS '-mp' ) |
| 612 |
|
|
set FOPTIM = ( '-O3 -align' ) |
| 613 |
|
|
#P3 set FOPTIM = ( $FOPTIM '-tpp6 -xWKM' ) |
| 614 |
|
|
set FOPTIM = ( $FOPTIM '-tpp7 -xWKM' ) |
| 615 |
|
|
set LIBS = ( '-lPEPCF90' ) |
| 616 |
|
|
breaksw |
| 617 |
|
|
default: |
| 618 |
|
|
echo Error: Linux compiler not recognized: \$FC=$FC |
| 619 |
|
|
exit |
| 620 |
|
|
breaksw |
| 621 |
|
|
endsw |
| 622 |
|
|
breaksw |
| 623 |
|
|
case T3E: |
| 624 |
|
|
case sn6312: |
| 625 |
|
|
echo "Configuring for T3E" |
| 626 |
|
|
set CPP = ( '/opt/ctl/bin/cpp -P') |
| 627 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_T3E -DWORDLENGTH=4' ) |
| 628 |
|
|
set FC = ( 'f90' ) |
| 629 |
|
|
set LINK = ( 'f90' ) |
| 630 |
|
|
set FFLAGS = ( '-O 2,fusion' ) |
| 631 |
|
|
breaksw |
| 632 |
|
|
case T90: |
| 633 |
|
|
case sn7113: |
| 634 |
|
|
echo "Configuring for T90" |
| 635 |
|
|
set FC = ( 'f90' ) |
| 636 |
|
|
set LINK = ( 'f90' ) |
| 637 |
|
|
set LN = ( '/bin/ln -s' ) |
| 638 |
|
|
set CPP = ( '/opt/ctl/bin/cpp -N -P' ) |
| 639 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_CRAY_VECTOR -DWORDLENGTH=4' ) |
| 640 |
|
|
set FFLAGS = ( '-m3 -Rabc -N 132') |
| 641 |
|
|
set FOPTIM = ( '-O0' ) |
| 642 |
|
|
set NOOPTFLAGS = ( '-O0' ) |
| 643 |
|
|
set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F') |
| 644 |
|
|
breaksw |
| 645 |
|
|
case SV1: |
| 646 |
|
|
case sn3002: |
| 647 |
|
|
set FC = ( 'f90' ) |
| 648 |
|
|
set LINK = ( 'f90' ) |
| 649 |
|
|
set LN = ( '/bin/ln -s' ) |
| 650 |
|
|
set CPP = ( '/opt/ctl/bin/cpp -N -P' ) |
| 651 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_CRAY_VECTOR -DWORDLENGTH=4' ) |
| 652 |
|
|
set FFLAGS = ( '-m3 -Rabc -ei -eI -s cf77types -N 132') |
| 653 |
|
|
set FOPTIM = ( '-O0' ) |
| 654 |
|
|
set NOOPTFLAGS = ( '-O0' ) |
| 655 |
|
|
set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F') |
| 656 |
|
|
breaksw |
| 657 |
|
|
case cg01+pgi: |
| 658 |
|
|
set LN = ( '/bin/ln -s' ) |
| 659 |
|
|
set CPP = ( '/lib/cpp -traditional -P' ) |
| 660 |
|
|
set INCLUDES = ( '-I/usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/include' ) |
| 661 |
|
|
set DEFINES = ( ${DEFINES} '-DWORDLENGTH=4' ) |
| 662 |
|
|
set FC = ( '/usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpif77' ) |
| 663 |
|
|
set FFLAGS = ( '-byteswapio -r8 -Mnodclchk -Mextend' ) |
| 664 |
|
|
# set LIBS = ( '-L/home/cnh/src/gm-1.4/libgm') |
| 665 |
|
|
set FOPTIM = ( '-tp p6 -v -O2 -Munroll -Mvect=cachesize:512000,transform -Kieee' ) |
| 666 |
|
|
set LINK = ( '/usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpif77' ) |
| 667 |
|
|
breaksw |
| 668 |
|
|
case SP3: |
| 669 |
|
|
# originally from A. Biastoch, SIO. |
| 670 |
|
|
# e.g. horizon.npaci.edu |
| 671 |
|
|
echo "Configuring for IBM SP POWER3" |
| 672 |
|
|
set SOURCEDIRS = ( ./ $SOURCEDIRS ) |
| 673 |
|
|
set LN = ( 'ln -s' ) |
| 674 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_PWR3 -DTARGET_SGI -DWORDLENGTH=4' ) |
| 675 |
|
|
set INCLUDES = ( '-I/usr/lpp/ppe.poe/include' ) |
| 676 |
|
|
# set CPP = ( '/lib/cpp' ) |
| 677 |
|
|
set FC = ( 'mpxlf95' ) |
| 678 |
|
|
set LINK = ( 'mpxlf95' ) |
| 679 |
|
|
set FLAGS = ( '-O3 -qarch=pwr3 -qtune=pwr3 -qcache=auto -qmaxmem=-1' \ |
| 680 |
|
|
'-bmaxdata:0x80000000 -bloadmap:mitgcmuv.map' ) |
| 681 |
|
|
set FFLAGS = ( '-qfixed=132 -O3 -qarch=pwr3 -qtune=pwr3 -qcache=auto -qmaxmem=-1' \ |
| 682 |
|
|
'-bmaxdata:0x80000000 ' ) |
| 683 |
|
|
set LDFLAGS = ( '-O3 -qarch=pwr3 -qtune=pwr3 -qcache=auto -qmaxmem=-1' \ |
| 684 |
|
|
'-bmaxdata:0x80000000' ) |
| 685 |
|
|
set LIBS = ( ' -L/usr/local/apps/mass -lmass' ) |
| 686 |
|
|
# set FFLAGS = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4' ) |
| 687 |
|
|
# set FOPTIM = ( '-O3' ) |
| 688 |
|
|
# set NOOPTFLAGS = ( '-O0' ) |
| 689 |
|
|
# set NOOPTFILES = ( 'barrier.F different_multiple.F ' \ |
| 690 |
|
|
# 'external_fields_load.F' ) |
| 691 |
|
|
set RMFILES = ( 'rii_files' ) |
| 692 |
|
|
breaksw |
| 693 |
|
|
case SP4: |
| 694 |
|
|
#ph: e.g. bluesky.ucar.edu, marcellus.navo.hpc.mil |
| 695 |
|
|
echo "Configuring for IBM SP POWER4" |
| 696 |
|
|
set SOURCEDIRS = ( ./ $SOURCEDIRS ) |
| 697 |
|
|
set LN = ( 'ln -s' ) |
| 698 |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_PWR3 -DTARGET_SGI -DWORDLENGTH=4' ) |
| 699 |
|
|
set INCLUDES = ( '-I/usr/lpp/ppe.poe/include' ) |
| 700 |
|
|
# set CPP = ( '/lib/cpp' ) |
| 701 |
|
|
set FC = ( 'mpxlf95' ) |
| 702 |
|
|
set LINK = ( 'mpxlf95' ) |
| 703 |
|
|
set FLAGS = ( '-O3 -qarch=pwr4 -qtune=pwr4 -qcache=auto -qmaxmem=-1' \ |
| 704 |
|
|
'-bmaxdata:0x80000000 -bloadmap:mitgcmuv.map' ) |
| 705 |
|
|
set FFLAGS = ( '-qfixed=132 -O3 -qarch=pwr4 -qtune=pwr4 -qcache=auto -qmaxmem=-1' \ |
| 706 |
|
|
'-bmaxdata:0x80000000 ' ) |
| 707 |
|
|
set LDFLAGS = ( '-O3 -qarch=pwr4 -qtune=pwr4 -qcache=auto -qmaxmem=-1' \ |
| 708 |
|
|
'-bmaxdata:0x80000000' ) |
| 709 |
|
|
set LIBS = ( ' -L/usr/local/apps/mass -lmass' ) |
| 710 |
|
|
# set FFLAGS = ( '-extend_source -mp -mpio -bytereclen -r10000 -mips4' ) |
| 711 |
|
|
# set FOPTIM = ( '-O3' ) |
| 712 |
|
|
# set NOOPTFLAGS = ( '-O0' ) |
| 713 |
|
|
# set NOOPTFILES = ( 'barrier.F different_multiple.F ' \ |
| 714 |
|
|
# 'external_fields_load.F' ) |
| 715 |
|
|
set RMFILES = ( 'rii_files' ) |
| 716 |
|
|
breaksw |
| 717 |
|
|
case aer-linux-cluster+mpi |
| 718 |
|
|
echo "Configuring for " $platform |
| 719 |
|
|
set LN = ( '/bin/ln -s' ) |
| 720 |
|
|
set CPP = ( '/lib/cpp -traditional -P' ) |
| 721 |
|
|
set DEFINES = ( ${DEFINES} '-DWORDLENGTH=4' ) |
| 722 |
|
|
set FC = ( '/opt/mpich/bin/mpif77' ) |
| 723 |
|
|
set LINK = ( '/opt/mpich/bin/mpif77' ) |
| 724 |
|
|
set FFLAGS = ( '-byteswapio -r8 -Mnodclchk -Mextend' ) |
| 725 |
|
|
set FOPTIM = ( '-tp p6 -v -O2 -Munroll -Mvect=cachesize:512000,transform -Kieee' ) |
| 726 |
|
|
set LIBS = ( '-L/opt/mpich/lib/ -lfmpich -lmpich' ) |
| 727 |
|
|
set INCLUDES = ( '-I/opt/mpich/include' ) |
| 728 |
|
|
breaksw |
| 729 |
|
|
default: |
| 730 |
|
|
echo "Error: platform not recognized: uname -p = " $platform$USEMPI |
| 731 |
|
|
exit |
| 732 |
|
|
breaksw |
| 733 |
|
|
endsw |
| 734 |
|
|
|
| 735 |
|
|
############################################################################### |
| 736 |
|
|
## ## |
| 737 |
|
|
## Everything below here should not need to be changed. Platform specific ## |
| 738 |
|
|
## changes and code specific changes should be configured above this line. ## |
| 739 |
|
|
## ## |
| 740 |
|
|
############################################################################### |
| 741 |
|
|
|
| 742 |
|
|
# Convert lists of directories into command-line options |
| 743 |
|
|
foreach inc ($INCLUDEDIRS) |
| 744 |
|
|
set INCLUDES = ($INCLUDES -I$inc) |
| 745 |
|
|
end |
| 746 |
|
|
|
| 747 |
|
|
# Search for source code |
| 748 |
|
|
rm -rf .links.tmp;mkdir .links.tmp |
| 749 |
|
|
echo "# This section creates symbolic links" > srclinks.tmp |
| 750 |
|
|
echo "" >> srclinks.tmp |
| 751 |
|
|
echo -n 'SRCFILES = ' > srclist.inc |
| 752 |
|
|
echo -n 'CSRCFILES = ' > csrclist.inc |
| 753 |
|
|
echo -n 'HEADERFILES = ' > hlist.inc |
| 754 |
|
|
foreach dr ($SOURCEDIRS $INCLUDEDIRS .) |
| 755 |
|
|
set deplist=( ) |
| 756 |
|
|
foreach srcfile (`cd $dr; ls *.[hcF]`) |
| 757 |
|
|
if (! -r .links.tmp/$srcfile) then |
| 758 |
|
|
if (-f $dr/$srcfile) then |
| 759 |
|
|
switch ($srcfile:e) |
| 760 |
|
|
case F: |
| 761 |
|
|
touch .links.tmp/$srcfile |
| 762 |
|
|
set deplist=($deplist $srcfile) |
| 763 |
|
|
echo ' \' >> srclist.inc |
| 764 |
|
|
echo -n " " $srcfile >> srclist.inc |
| 765 |
|
|
breaksw |
| 766 |
|
|
case c: |
| 767 |
|
|
touch .links.tmp/$srcfile |
| 768 |
|
|
set deplist=($deplist $srcfile) |
| 769 |
|
|
echo ' \' >> csrclist.inc |
| 770 |
|
|
echo -n " " $srcfile >> csrclist.inc |
| 771 |
|
|
breaksw |
| 772 |
|
|
case h: |
| 773 |
|
|
touch .links.tmp/$srcfile |
| 774 |
|
|
set deplist=($deplist $srcfile) |
| 775 |
|
|
echo ' \' >> hlist.inc |
| 776 |
|
|
echo -n " " $srcfile >> hlist.inc |
| 777 |
|
|
breaksw |
| 778 |
|
|
endsw |
| 779 |
|
|
endif |
| 780 |
|
|
endif |
| 781 |
|
|
end |
| 782 |
|
|
if ($#deplist != 0) then |
| 783 |
|
|
echo "# These files are linked from $dr" >> srclinks.tmp |
| 784 |
|
|
echo $deplist':' >> srclinks.tmp |
| 785 |
|
|
echo ' $(LN) '$dr'/$@ $@' >> srclinks.tmp |
| 786 |
|
|
endif |
| 787 |
|
|
end |
| 788 |
|
|
rm -rf .links.tmp |
| 789 |
|
|
echo "" >> srclist.inc |
| 790 |
|
|
echo "" >> csrclist.inc |
| 791 |
|
|
echo "" >> hlist.inc |
| 792 |
|
|
|
| 793 |
|
|
set THISHOSTNAME = ( `hostname` ) |
| 794 |
|
|
set THISCWD = ( `pwd` ) |
| 795 |
|
|
set THISDATE = ( `date` ) |
| 796 |
|
|
|
| 797 |
|
|
if (-r $mfile) mv -f $mfile $mfile.bak |
| 798 |
|
|
########################################### |
| 799 |
|
|
## This is the template for the makefile ## |
| 800 |
|
|
########################################### |
| 801 |
|
|
echo Creating makefile: $mfile |
| 802 |
|
|
echo "# Multithreaded + multi-processing makefile for $mach" > ${mfile} |
| 803 |
|
|
echo "# This makefile was generated automatically on" >> ${mfile} |
| 804 |
|
|
echo "# $THISDATE" >> ${mfile} |
| 805 |
|
|
echo "# by the command:" >> ${mfile} |
| 806 |
|
|
echo "# ${0} $argv" >> ${mfile} |
| 807 |
|
|
echo "# executed by:" >> ${mfile} |
| 808 |
|
|
echo "# $USER@${THISHOSTNAME}:${THISCWD}" >> ${mfile} |
| 809 |
|
|
cat >> ${mfile} <<EOF |
| 810 |
|
|
# |
| 811 |
|
|
# BUILDDIR : Directory where object files are written |
| 812 |
|
|
# SOURCEDIRS : Directories containing the source (.F) files |
| 813 |
|
|
# INCLUDEDIRS : Directories containing the header-source (.h) files |
| 814 |
|
|
# EXEDIR : Directory where executable that is generated is written |
| 815 |
|
|
# EXECUTABLE : Full path of executable binary |
| 816 |
|
|
# |
| 817 |
|
|
# CPP : C-preprocessor command |
| 818 |
|
|
# INCLUDES : Directories searched for header files |
| 819 |
|
|
# DEFINES : Macro definitions for CPP |
| 820 |
|
|
# MAKEDEPEND : Dependency generator |
| 821 |
|
|
# KPP : Special preprocessor command (specific to platform) |
| 822 |
|
|
# KFLAGS : Flags for KPP |
| 823 |
|
|
# FC : Fortran compiler command |
| 824 |
|
|
# FFLAGS : Configuration/debugging options for FC |
| 825 |
|
|
# FOPTIM : Optimization options for FC |
| 826 |
|
|
# LINK : Command for link editor program |
| 827 |
|
|
# LIBS : Library flags /or/ additional optimization/debugging flags |
| 828 |
|
|
|
| 829 |
|
|
ROOTDIR = ${ROOTDIR} |
| 830 |
|
|
BUILDDIR = ${BUILDDIR} |
| 831 |
|
|
SOURCEDIRS = ${SOURCEDIRS} |
| 832 |
|
|
INCLUDEDIRS = ${INCLUDEDIRS} |
| 833 |
|
|
EXEDIR = ${EXEDIR} |
| 834 |
|
|
EXECUTABLE = \$(EXEDIR)/${EXECUTABLE} |
| 835 |
|
|
TOOLSDIR = ${TOOLSDIR} |
| 836 |
|
|
|
| 837 |
|
|
EOF |
| 838 |
|
|
|
| 839 |
|
|
|
| 840 |
|
|
# JAM libraries on Hyades |
| 841 |
|
|
if ($?include_jam_libs) then |
| 842 |
|
|
cat >> ${mfile} <<EOF |
| 843 |
|
|
# extra stuff for Hyades ............................................ |
| 844 |
|
|
HYADES_DIR = /u/u0/cnh/jam-lib/software |
| 845 |
|
|
HYADES_DIR = /u/u0/cnh/jam-lib-twoproc |
| 846 |
|
|
HYADES_DIR = /usr/local/jamlib/current/dual_proc |
| 847 |
|
|
WORK_DIR = \$(HYADES_DIR) |
| 848 |
|
|
DEPOSIT_DIR = linux_bin |
| 849 |
|
|
|
| 850 |
|
|
STARTXOBJDIR = startx_util/\$(DEPOSIT_DIR) |
| 851 |
|
|
STARTXOBJ = \$(WORK_DIR)/startx_util/\$(DEPOSIT_DIR)/startx_timer.o \ |
| 852 |
|
|
\$(WORK_DIR)/startx_util/\$(DEPOSIT_DIR)/startx_util.o \ |
| 853 |
|
|
\$(WORK_DIR)/startx_util/\$(DEPOSIT_DIR)/client.o \ |
| 854 |
|
|
\$(WORK_DIR)/startx_util/\$(DEPOSIT_DIR)/csutil.o |
| 855 |
|
|
|
| 856 |
|
|
JAMOBJDIR = jam/\$(DEPOSIT_DIR) |
| 857 |
|
|
JAMOBJ = \$(WORK_DIR)/jam/\$(DEPOSIT_DIR)/jam_init.o \ |
| 858 |
|
|
\$(WORK_DIR)/jam/\$(DEPOSIT_DIR)/jam_kernel.o \ |
| 859 |
|
|
\$(WORK_DIR)/jam/\$(DEPOSIT_DIR)/jam_malloc.o \ |
| 860 |
|
|
\$(WORK_DIR)/jam/\$(DEPOSIT_DIR)/jam_vmalloc.o \ |
| 861 |
|
|
\$(WORK_DIR)/jam/\$(DEPOSIT_DIR)/jam_mutex.o |
| 862 |
|
|
|
| 863 |
|
|
JAMCOBJDIR = jam_collective/\$(DEPOSIT_DIR) |
| 864 |
|
|
JAMCOBJ = \$(WORK_DIR)/jam_collective/\$(DEPOSIT_DIR)/jam_collective.o |
| 865 |
|
|
|
| 866 |
|
|
XLIBS = \$(STARTXOBJ) \$(JAMOBJ) \$(JAMCOBJ) |
| 867 |
|
|
|
| 868 |
|
|
# .................................................................. |
| 869 |
|
|
|
| 870 |
|
|
EOF |
| 871 |
|
|
endif |
| 872 |
|
|
|
| 873 |
|
|
|
| 874 |
|
|
cat >> ${mfile} <<EOF |
| 875 |
|
|
# Unix ln (link) |
| 876 |
|
|
LN = ${LN} |
| 877 |
|
|
# C preprocessor |
| 878 |
|
|
CPP = cat \$< | ${S64} | ${CPP} |
| 879 |
|
|
# Dependency generator |
| 880 |
|
|
MAKEDEPEND = ${MAKEDEPEND} |
| 881 |
|
|
# Special preprocessor (KAP on DECs, FPP on Crays) |
| 882 |
|
|
KPP = ${KPP} |
| 883 |
|
|
# Fortran compiler |
| 884 |
|
|
FC = ${FC} |
| 885 |
|
|
# Link editor |
| 886 |
|
|
LINK = ${LINK} |
| 887 |
|
|
|
| 888 |
|
|
# Defines for CPP |
| 889 |
|
|
DEFINES = ${DEFINES} |
| 890 |
|
|
# Includes for CPP |
| 891 |
|
|
INCLUDES = ${INCLUDES} |
| 892 |
|
|
# Flags for KPP |
| 893 |
|
|
KFLAGS1 = ${KFLAGS1} |
| 894 |
|
|
KFLAGS2 = ${KFLAGS2} |
| 895 |
|
|
# Optim./debug for FC |
| 896 |
|
|
FFLAGS = ${FFLAGS} |
| 897 |
|
|
FOPTIM = ${FOPTIM} |
| 898 |
|
|
# Flags for CC |
| 899 |
|
|
CFLAGS = ${CFLAGS} |
| 900 |
|
|
# Files that should not be optimized |
| 901 |
|
|
NOOPTFILES = ${NOOPTFILES} |
| 902 |
|
|
NOOPTFLAGS = ${NOOPTFLAGS} |
| 903 |
|
|
# Flags and libraries needed for linking |
| 904 |
|
|
LIBS = ${LIBS} \$(XLIBS) |
| 905 |
|
|
|
| 906 |
|
|
EOF |
| 907 |
|
|
|
| 908 |
|
|
cat srclist.inc >> ${mfile} |
| 909 |
|
|
cat csrclist.inc >> ${mfile} |
| 910 |
|
|
cat hlist.inc >> ${mfile} |
| 911 |
|
|
echo 'F77FILES = $(SRCFILES:.F=.f)' >> ${mfile} |
| 912 |
|
|
echo 'OBJFILES = $(SRCFILES:.F=.o) $(CSRCFILES:.c=.o)' >> ${mfile} |
| 913 |
|
|
|
| 914 |
|
|
rm -f srclist.inc csrclist.inc hlist.inc flist.tmp clist.tmp |
| 915 |
|
|
|
| 916 |
|
|
cat >> ${mfile} <<EOF |
| 917 |
|
|
|
| 918 |
|
|
.SUFFIXES: |
| 919 |
|
|
.SUFFIXES: .o .f .p .F .c |
| 920 |
|
|
|
| 921 |
|
|
all: \$(EXECUTABLE) |
| 922 |
|
|
\$(EXECUTABLE): \$(OBJFILES) |
| 923 |
|
|
\$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS) |
| 924 |
|
|
depend: |
| 925 |
|
|
@make links |
| 926 |
|
|
\$(MAKEDEPEND) -o .f \$(DEFINES) \$(INCLUDES) \$(SRCFILES) |
| 927 |
|
|
|
| 928 |
|
|
links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) |
| 929 |
|
|
|
| 930 |
|
|
small_f: \$(F77FILES) |
| 931 |
|
|
|
| 932 |
|
|
output.txt: \$(EXECUTABLE) |
| 933 |
|
|
@printf 'running ... ' |
| 934 |
|
|
@\$(EXECUTABLE) > \$@ |
| 935 |
|
|
|
| 936 |
|
|
clean: |
| 937 |
|
|
-rm -rf *.o *.f *.p ${RMFILES} work.{pc,pcl} |
| 938 |
|
|
Clean: |
| 939 |
|
|
@make clean |
| 940 |
|
|
@make cleanlinks |
| 941 |
|
|
-rm -f Makefile.bak |
| 942 |
|
|
CLEAN: |
| 943 |
|
|
@make Clean |
| 944 |
|
|
-find \$(EXEDIR) -name "*.meta" -exec rm {} \; |
| 945 |
|
|
-find \$(EXEDIR) -name "*.data" -exec rm {} \; |
| 946 |
|
|
-find \$(EXEDIR) -name "fort.*" -exec rm {} \; |
| 947 |
|
|
-rm -f \$(EXECUTABLE) |
| 948 |
|
|
|
| 949 |
|
|
makefile: |
| 950 |
|
|
${0} $argv |
| 951 |
|
|
cleanlinks: |
| 952 |
|
|
-find . -type l -exec rm {} \; |
| 953 |
|
|
|
| 954 |
|
|
# The normal chain of rules is ( .F - .f - .o ) |
| 955 |
|
|
.F.f: |
| 956 |
|
|
\$(CPP) \$(DEFINES) \$(INCLUDES) > \$@ |
| 957 |
|
|
.f.o: |
| 958 |
|
|
\$(FC) \$(FFLAGS) \$(FOPTIM) -c \$< |
| 959 |
|
|
.c.o: |
| 960 |
|
|
\$(CC) \$(CFLAGS) -c \$< |
| 961 |
|
|
|
| 962 |
|
|
# Special exceptions that use the ( .F - .p - .f - .o ) rule-chain |
| 963 |
|
|
.F.p: |
| 964 |
|
|
\$(CPP) \$(DEFINES) \$(INCLUDES) > \$@ |
| 965 |
|
|
.p.f: |
| 966 |
|
|
\$(KPP) \$(KFLAGS1)\$@ \$(KFLAGS2) \$< |
| 967 |
|
|
EOF |
| 968 |
|
|
|
| 969 |
|
|
# Make list of "exceptions" that need ".p" files |
| 970 |
|
|
foreach sf ($KPPFILES) |
| 971 |
|
|
set fname=( ${sf:t} ) |
| 972 |
|
|
echo "${fname:r}.f: ${fname:r}.p" >> ${mfile} |
| 973 |
|
|
end |
| 974 |
|
|
foreach sf ($NOOPTFILES) |
| 975 |
|
|
set fname=( ${sf:t} ) |
| 976 |
|
|
echo "${fname:r}.o: ${fname:r}.f" >> ${mfile} |
| 977 |
|
|
echo ' $(FC) $(FFLAGS) $(NOOPTFLAGS) -c $<' >> ${mfile} |
| 978 |
|
|
end |
| 979 |
|
|
echo "" >> ${mfile} |
| 980 |
|
|
|
| 981 |
|
|
# Add rules for links |
| 982 |
|
|
cat srclinks.tmp >> ${mfile} |
| 983 |
|
|
rm -f srclinks.tmp |
| 984 |
|
|
|
| 985 |
|
|
echo "" >> ${mfile} |
| 986 |
|
|
echo "# DO NOT DELETE" >> ${mfile} |
| 987 |
|
|
|
| 988 |
|
|
exit |