1 |
heimbach |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
|
|
# Composed and tested by ce107 on ross/weddell (Opteron system) |
4 |
|
|
# Should work fine on EM64T and other AMD64 compatible Intel systems |
5 |
|
|
# a) Processor specific flags: |
6 |
|
|
# 1) for more speed on Core2 processors replace -xW with -xT |
7 |
|
|
# 2) for more speed on Pentium4 based EM64T processors replaces -xW with -xP |
8 |
|
|
# b) For more speed, provided your data size doesn't exceed 2GB you can |
9 |
|
|
# remove -fPIC which carries a performance penalty of 2-6%. |
10 |
|
|
# c) Provided that the libraries you link to are compiled with -fPIC this |
11 |
|
|
# optfile should work. |
12 |
|
|
# d) You can replace -fPIC with -mcmodel=medium which may perform faster |
13 |
|
|
# then -fPIC and still support data sizes over 2GB per process but all |
14 |
|
|
# the libraries you link to myst be compiled with -fPIC or -mcmodel=medium |
15 |
|
|
# e) Changed from -O3 to -O2 to avoid buggy Intel v.10 compilers. Speed |
16 |
|
|
# impact appears to be minimal. |
17 |
|
|
# |
18 |
|
|
# DON'T FORGET to set environment variable MPI_INC_DIR to the include |
19 |
|
|
# directory of your MPI implementation |
20 |
|
|
|
21 |
|
|
FC=ifort |
22 |
|
|
F90C=ifort |
23 |
|
|
CC=icc |
24 |
|
|
F90FIXEDFORMAT='-fixed -Tf' |
25 |
|
|
DEFINES='-DWORDLENGTH=4' |
26 |
|
|
LINK='ifort -static' |
27 |
|
|
CPP='cpp -traditional -P' |
28 |
|
|
|
29 |
|
|
NOOPTFLAGS='-O0 -g -m64 -fPIC' |
30 |
|
|
NOOPTFILES='' |
31 |
|
|
|
32 |
|
|
INCLUDEDIRS='' |
33 |
|
|
INCLUDES='' |
34 |
|
|
LIBS='' |
35 |
|
|
|
36 |
|
|
if test "x$DEVEL" != x ; then |
37 |
|
|
FFLAGS='-132 -r8 -i4 -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC -O0 -g -noalign -fpstkchk -check all -fpe0 -traceback -ftrapuv -fpmodel except -warn all' |
38 |
|
|
else |
39 |
|
|
FFLAGS='-132 -r8 -i4 -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC' |
40 |
|
|
fi |
41 |
|
|
|
42 |
|
|
# Note that the -mp switch is for ieee "maintain precision" and is |
43 |
|
|
# roughly equivalent to -ieee |
44 |
|
|
if test "x$IEEE" = x ; then |
45 |
|
|
# No need for IEEE-754 |
46 |
|
|
FOPTIM='-O2 -align' |
47 |
|
|
else |
48 |
|
|
# Try to follow IEEE-754 |
49 |
dfer |
1.2 |
FOPTIM='-O0 -noalign -mp' |
50 |
heimbach |
1.1 |
fi |
51 |
|
|
F90FLAGS=$FFLAGS |
52 |
|
|
F90OPTIM=$FOPTIM |
53 |
|
|
CFLAGS='-O2 -ip -fPIC' |
54 |
|
|
|
55 |
|
|
if [ "x$NETCDF_ROOT" != x ] ; then |
56 |
|
|
INCLUDEDIRS="${NETCDF_ROOT}/include" |
57 |
|
|
INCLUDES="-I${NETCDF_ROOT}/include" |
58 |
|
|
LIBS="-L${NETCDF_ROOT}/lib" |
59 |
|
|
elif [ "x$NETCDF_HOME" != x ]; then |
60 |
|
|
INCLUDEDIRS="${NETCDF_HOME}/include" |
61 |
|
|
INCLUDES="-I${NETCDF_HOME}/include" |
62 |
|
|
LIBS="-L${NETCDF_HOME}/lib" |
63 |
|
|
elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then |
64 |
|
|
NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'` |
65 |
|
|
NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'` |
66 |
|
|
INCLUDEDIRS="${NETCDF_INC}" |
67 |
|
|
INCLUDES="-I${NETCDF_INC}" |
68 |
|
|
LIBS="-L${NETCDF_LIB}" |
69 |
|
|
elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then |
70 |
|
|
INCLUDEDIRS="${NETCDF_INCDIR}" |
71 |
|
|
INCLUDES="-I${NETCDF_INCDIR}" |
72 |
|
|
LIBS="-L${NETCDF_LIBDIR}" |
73 |
|
|
elif test -d /usr/include/netcdf-3 ; then |
74 |
|
|
INCLUDEDIRS='/usr/include/netcdf-3' |
75 |
|
|
INCLUDES='-I/usr/include/netcdf-3' |
76 |
|
|
LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3' |
77 |
|
|
elif test -d /usr/include/netcdf ; then |
78 |
|
|
INCLUDEDIRS='/usr/include/netcdf' |
79 |
|
|
INCLUDES='-I/usr/include/netcdf' |
80 |
|
|
elif test -d /usr/local/netcdf ; then |
81 |
|
|
INCLUDEDIRS='/usr/include/netcdf/include' |
82 |
|
|
INCLUDES='-I/usr/local/netcdf/include' |
83 |
|
|
LIBS='-L/usr/local/netcdf/lib' |
84 |
|
|
elif test -d /usr/local/include/netcdf.inc ; then |
85 |
|
|
INCLUDEDIRS='/usr/local/include' |
86 |
|
|
INCLUDES='-I/usr/local/include' |
87 |
|
|
LIBS='-L/usr/local/lib64' |
88 |
|
|
fi |
89 |
|
|
|