1 |
#!/bin/bash |
#!/bin/bash |
2 |
# |
# |
3 |
# Composed and tested by ce107 on ross/weddell (Opteron system) |
# $Header$ |
4 |
# Should work fine on EM64T and other AMD64 compatible Intel systems |
# $Name$ |
5 |
# a) Processor specific flags: |
|
6 |
# 1) for more speed on Core2 processors replace -xW with -xT |
# Tested on uv100.awi.de (SGI UV 100, details: |
7 |
# 2) for more speed on Pentium4 based EM64T processors replaces -xW with -xP |
# http://www.sgi.com/products/servers/uv/specs.html) |
8 |
# b) For more speed, provided your data size doesn't exceed 2GB you can |
# a) For more speed, provided your data size does not exceed 2GB you can |
9 |
# remove -fPIC which carries a performance penalty of 2-6%. |
# remove -fPIC which carries a performance penalty of 2-6%. |
10 |
# c) Provided that the libraries you link to are compiled with -fPIC this |
# b) You can replace -fPIC with '-mcmodel=medium -shared-intel' which may |
11 |
# optfile should work. |
# perform faster than -fPIC and still support data sizes over 2GB per |
12 |
# d) You can replace -fPIC with -mcmodel=medium which may perform faster |
# process but all the libraries you link to must be compiled with |
13 |
# then -fPIC and still support data sizes over 2GB per process but all |
# -fPIC or -mcmodel=medium |
14 |
# the libraries you link to myst be compiled with -fPIC or -mcmodel=medium |
# c) flags adjusted for ifort 12.1.0 |
|
# e) Changed from -O3 to -O2 to avoid buggy Intel v.10 compilers. Speed |
|
|
# impact appears to be minimal. |
|
|
# |
|
|
# DON'T FORGET to set environment variable MPI_INC_DIR to the include |
|
|
# directory of your MPI implementation |
|
15 |
|
|
16 |
FC=ifort |
FC=ifort |
17 |
F90C=ifort |
F90C=ifort |
18 |
CC=icc |
CC=icc |
19 |
F90FIXEDFORMAT='-fixed -Tf' |
# requires that all static libraries are available: |
20 |
|
#LINK='ifort -static' |
21 |
|
LINK='ifort' |
22 |
|
# for adjoint runs the default makedepend often cannot handle enough files |
23 |
|
#MAKEDEPEND=tools_xmakedepend |
24 |
|
|
25 |
DEFINES='-DWORDLENGTH=4' |
DEFINES='-DWORDLENGTH=4' |
26 |
LINK='ifort -static' |
CPP='cpp -traditional -P' |
27 |
CPP='cpp -traditional -P' |
F90FIXEDFORMAT='-fixed -Tf' |
28 |
EXTENDED_SRC_FLAG='-132' |
EXTENDED_SRC_FLAG='-132' |
29 |
|
#OMPFLAG='-openmp' |
30 |
|
|
31 |
NOOPTFLAGS='-O0 -g -m64 -fPIC' |
NOOPTFLAGS="-O0 -g -m64" |
32 |
NOOPTFILES='' |
NOOPTFILES='' |
33 |
|
|
34 |
INCLUDEDIRS='' |
MCMODEL='-fPIC' |
35 |
INCLUDES='' |
# for large memory requirements uncomment this line |
36 |
LIBS='' |
#MCMODEL='-mcmodel=medium -shared-intel' |
37 |
|
|
38 |
if test "x$DEVEL" != x ; then |
FFLAGS="$FFLAGS -W0 -WB -convert big_endian -assume byterecl $MCMODEL" |
39 |
FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC -O0 -g -noalign -fpstkchk -check all -fpe0 -traceback -ftrapuv -fpmodel except -warn all" |
#- might want to use '-r8' for fizhi pkg: |
40 |
|
#FFLAGS="$FFLAGS -r8" |
41 |
|
|
42 |
|
if test "x$IEEE" = x ; then #- with optimisation: |
43 |
|
FOPTIM='-O3 -align' |
44 |
|
# does not work when -static does not work |
45 |
|
# FOPTIM='-fast -align' |
46 |
|
# instead you can use |
47 |
|
# FOPTIM='-O3 -ipo -align' |
48 |
else |
else |
49 |
FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC" |
if test "x$DEVEL" = x ; then #- no optimisation + IEEE : |
50 |
|
FOPTIM='-O0 -noalign -fp-model precise' |
51 |
|
# -fltconsistency |
52 |
|
else #- development/check options: |
53 |
|
FOPTIM='-O0 -noalign -fp-model precise' |
54 |
|
FOPTIM="$FOPTIM -g -check all -fpe0 -traceback -ftrapuv -fp-model except -warn all" |
55 |
|
fi |
56 |
fi |
fi |
57 |
|
|
|
# Note that the -mp switch is for ieee "maintain precision" and is |
|
|
# roughly equivalent to -ieee |
|
|
if test "x$IEEE" = x ; then |
|
|
# No need for IEEE-754 |
|
|
FOPTIM='-O2 -align' |
|
|
else |
|
|
# Try to follow IEEE-754 |
|
|
FOPTIM='-O0 -noalign -mp' |
|
|
fi |
|
58 |
F90FLAGS=$FFLAGS |
F90FLAGS=$FFLAGS |
59 |
F90OPTIM=$FOPTIM |
F90OPTIM=$FOPTIM |
60 |
CFLAGS='-O2 -ip -fPIC' |
CFLAGS="-O0 -ip $MCMODEL" |
61 |
|
|
62 |
|
INCLUDEDIRS='' |
63 |
|
INCLUDES='' |
64 |
|
LIBS='' |
65 |
|
|
66 |
if [ "x$NETCDF_ROOT" != x ] ; then |
if [ "x$NETCDF_ROOT" != x ] ; then |
67 |
INCLUDEDIRS="${NETCDF_ROOT}/include" |
INCLUDEDIRS="${NETCDF_ROOT}/include" |
98 |
LIBS='-L/usr/local/lib64' |
LIBS='-L/usr/local/lib64' |
99 |
fi |
fi |
100 |
|
|
101 |
|
if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then |
102 |
|
LIBS="$LIBS -lmpi" |
103 |
|
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
104 |
|
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
105 |
|
#- used for parallel (MPI) DIVA |
106 |
|
MPIINCLUDEDIR="$MPI_INC_DIR" |
107 |
|
#MPI_HEADER_FILES='mpif.h mpiof.h' |
108 |
|
fi |
109 |
|
|