| 1 |
#!/bin/bash |
| 2 |
# |
| 3 |
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_ifort+mpi_beagle,v 1.8 2011/08/12 23:09:08 jmc Exp $ |
| 4 |
# $Name: $ |
| 5 |
# |
| 6 |
# These are the build options used with the Intel 10.x compiler for |
| 7 |
# testing on Beagle. |
| 8 |
# |
| 9 |
# Use after |
| 10 |
# |
| 11 |
# module add darwin |
| 12 |
# module add mitgcm |
| 13 |
# |
| 14 |
# (tested with darwin/20090605 mitgcm/20090605, i.e., |
| 15 |
# intel/10.0.025 mx/1.0 netcdf/3.6.2/intel-10.0.025 mpich-mx/1.2.7..7/intel-10.0.025) |
| 16 |
# |
| 17 |
# These modules set FFLAGS, CFLAGS and CPPFLAGS for mpich and netcdf. |
| 18 |
# |
| 19 |
# The SGE -V option for exporting environment variables may also be |
| 20 |
# helpful if you encounter missing-library problems. Or, |
| 21 |
# alternatively, one may choose to link with one of the intel |
| 22 |
# "-static" or "-i-static" flags. |
| 23 |
|
| 24 |
FC='mpif77' |
| 25 |
CC='mpicc' |
| 26 |
F90C='mpif90 -fixed -c ' |
| 27 |
LINK='mpif77' |
| 28 |
for path in $(echo "$CPATH" | sed 's/:/ /g'); do |
| 29 |
CPPFLAGS="$CPPFLAGS -I$path" |
| 30 |
done |
| 31 |
INCLUDES="$CPPFLAGS" |
| 32 |
# for static linkage: |
| 33 |
#LIBS="$LDFLAGS -static" |
| 34 |
# for dynamic linkage: |
| 35 |
LIBS="$LDFLAGS -shared-intel" |
| 36 |
|
| 37 |
|
| 38 |
# -DIFORT turns on ifort-specific declarations in darwin (RAND is not an intrinsic) |
| 39 |
DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4 -DIFORT' |
| 40 |
CPP='cpp -traditional -P' |
| 41 |
EXTENDED_SRC_FLAG='-132' |
| 42 |
GET_FC_VERSION="--version" |
| 43 |
#OMPFLAG='-openmp' |
| 44 |
|
| 45 |
NOOPTFILES='mds_byteswapr8.F mds_byteswapr4.F mds_byteswapi4.F mom_calc_ke.F mon_ke.F' |
| 46 |
|
| 47 |
if test "x$IEEE" = x ; then |
| 48 |
# No need for IEEE-754 |
| 49 |
NOOPTFLAGS='-O2' |
| 50 |
# use this for exact checkpointing (slightly slower): |
| 51 |
FOPTIM='-O2 -pc64 -mieee-fp -align' |
| 52 |
# use this for flighty faster execution but with roundoff errors in checkpointing: |
| 53 |
# FOPTIM='-O2 -align' |
| 54 |
# ifort options: |
| 55 |
# -132 fixed-form line length is 132 characters |
| 56 |
# -r8 REAL is REAL*8 |
| 57 |
# -i4 INTEGER is INTEGER*4 |
| 58 |
# -w95 don't warn about use of Fortran 95 extensions |
| 59 |
# -W0 disable all warning messages |
| 60 |
# -WB turns a compile-time bounds check error into a warning |
| 61 |
# -xT optimize for Intel Core2 and Xeon 51xx |
| 62 |
# -fno-alias don't assume aliasing (assume that different variables DON'T refer to the same memory location) |
| 63 |
# -assume byterecl record length in OPEN statements is in bytes |
| 64 |
# -convert big_endian binary files contain big-endian data |
| 65 |
# -shared-intel avoids static library mismatch (?) |
| 66 |
FFLAGS="$FFLAGS -w95 -W0 -WB -xT -fno-alias -assume byterecl -convert big_endian" |
| 67 |
else |
| 68 |
# Try to follow IEEE-754 |
| 69 |
NOOPTFLAGS='-O0' |
| 70 |
# -CB check bounds |
| 71 |
# FOPTIM='-O0 -noalign -CA -CB -CU -CV -CS' |
| 72 |
FOPTIM='-O0 -noalign' |
| 73 |
# -pc64 round floating point values to 64 bits |
| 74 |
# one could also try |
| 75 |
# -mp maintain precision |
| 76 |
FFLAGS="$FFLAGS -pc64 -w95 -W0 -WB -xT -fno-alias -assume byterecl -convert big_endian" |
| 77 |
fi |
| 78 |
#- might want to use '-r8' for fizhi pkg: |
| 79 |
#FFLAGS="$FFLAGS -r8" |
| 80 |
|
| 81 |
F90FLAGS=$FFLAGS |
| 82 |
F90OPTIM=$FOPTIM |
| 83 |
|
| 84 |
NOOPTFILES=$NOOPTFILES' mds_byteswap.F' |