1 |
#!/bin/bash |
#!/bin/bash |
2 |
# |
# |
3 |
# composed and tested by ce107 on ross/weddell |
# Composed and tested by ce107 on ross/weddell (Opteron system) |
4 |
# for more speed on Core2 processors replace -xW with -xT |
# Should work fine on EM64T and other AMD64 compatible Intel systems |
5 |
# for more speed on Pentium4 based EM64T processors replaces -xW with -xP |
# 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 |
# DON'T FORGET to set environment variable MPI_INC_DIR to the include |
19 |
# directory of your MPI implementation |
# directory of your MPI implementation |
21 |
FC=mpif77 |
FC=mpif77 |
22 |
F90C=mpif90 |
F90C=mpif90 |
23 |
CC=mpicc |
CC=mpicc |
24 |
LINK='mpif90 -i-static -no-ipo' |
LINK='mpif90 -i-dynamic -no-ipo' |
25 |
|
|
26 |
DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4' |
DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4' |
27 |
CPP='cpp -traditional -P' |
CPP='cpp -traditional -P' |
44 |
# roughly equivalent to -ieee |
# roughly equivalent to -ieee |
45 |
if test "x$IEEE" = x ; then |
if test "x$IEEE" = x ; then |
46 |
# No need for IEEE-754 |
# No need for IEEE-754 |
47 |
FOPTIM='-O3 -align -xW -ip' |
FOPTIM='-O2 -align -xW -ip' |
48 |
else |
else |
49 |
# Try to follow IEEE-754 |
# Try to follow IEEE-754 |
50 |
FOPTIM='-O2 -align -xW -ip -mp' |
FOPTIM='-O2 -align -xW -ip -mp' |
51 |
fi |
fi |
52 |
F90FLAGS=$FFLAGS |
F90FLAGS=$FFLAGS |
53 |
F90OPTIM=$FOPTIM |
F90OPTIM=$FOPTIM |
54 |
CFLAGS='-O3 -ip -fPIC' |
CFLAGS='-O2 -ip -fPIC' |
55 |
|
|
56 |
if [ "x$NETCDF_ROOT" != x ] ; then |
if [ "x$NETCDF_ROOT" != x ] ; then |
57 |
INCLUDEDIRS="${NETCDF_ROOT}/include" |
INCLUDEDIRS="${NETCDF_ROOT}/include" |