1 |
#!/bin/bash |
2 |
# |
3 |
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_ifort+mpi_beagle,v 1.1 2008/08/06 21:54:56 jahn 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 |
INCLUDES="$CPPFLAGS" |
29 |
|
30 |
# -DIFORT turns on ifort-specific declarations in darwin (RAND is not an intrinsic) |
31 |
DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4 -DIFORT' |
32 |
CPP='cpp -traditional -P' |
33 |
|
34 |
NOOPTFILES='mds_byteswapr8.F mds_byteswapr4.F mds_byteswapi4.F mom_calc_ke.F' |
35 |
|
36 |
if test "x$IEEE" = x ; then |
37 |
# No need for IEEE-754 |
38 |
NOOPTFLAGS='-O2' |
39 |
FOPTIM='-O3 -align' |
40 |
# ifort options: |
41 |
# -132 fixed-form line length is 132 characters |
42 |
# -r8 REAL is REAL*8 |
43 |
# -i4 INTEGER is INTEGER*4 |
44 |
# -w95 don't warn about use of Fortran 95 extensions |
45 |
# -W0 disable all warning messages |
46 |
# -WB turns a compile-time bounds check error into a warning |
47 |
# -xT optimize for Intel Core2 and Xeon 51xx |
48 |
# -fno-alias don't assume aliasing (assume that different variables DON'T refer to the same memory location) |
49 |
# -assume byterecl record length in OPEN statements is in bytes |
50 |
# -convert big_endian binary files contain big-endian data |
51 |
# -shared-intel avoids static library mismatch (?) |
52 |
FFLAGS="$FFLAGS -132 -r8 -i4 -w95 -W0 -WB -xT -fno-alias -assume byterecl -convert big_endian -shared-intel" |
53 |
else |
54 |
# Try to follow IEEE-754 |
55 |
NOOPTFLAGS='-O0' |
56 |
# -CB check bounds |
57 |
# FOPTIM='-O0 -noalign -CA -CB -CU -CV -CS' |
58 |
FOPTIM='-O0 -noalign' |
59 |
# -pc64 round floating point values to 64 bits |
60 |
# one could also try |
61 |
# -mp maintain precision |
62 |
FFLAGS="$FFLAGS -pc64 -132 -r8 -i4 -w95 -W0 -WB -xT -fno-alias -assume byterecl -convert big_endian -shared-intel" |
63 |
fi |
64 |
F90FLAGS=$FFLAGS |
65 |
F90OPTIM=$FOPTIM |
66 |
|
67 |
NOOPTFILES=$NOOPTFILES' mitcplr_char2real.F mitcplr_real2char.F' |
68 |
NOOPTFILES=$NOOPTFILES' mitcplr_char2int.F mitcplr_int2char.F mds_byteswap.F' |