3 |
# $Header$ |
# $Header$ |
4 |
# $Name$ |
# $Name$ |
5 |
# |
# |
6 |
|
# tested on faulks with gcc-g77 v3.4.6 (with FC 6) |
7 |
|
# tested with MPI on (old) aces cluster (gcc-g77 3.3.3, FC 2), using: |
8 |
|
# module add mpich/gnu |
9 |
|
# export MPI_INC_DIR=/usr/local/pkg/mpich/mpich-gcc/include |
10 |
|
|
11 |
|
if test "x$MPI" = xtrue ; then |
12 |
|
CC='mpicc' |
13 |
|
FC='mpif77' |
14 |
|
LINK=$FC |
15 |
|
else |
16 |
|
CC='gcc' |
17 |
|
FC='g77' |
18 |
|
LINK=$FC |
19 |
|
fi |
20 |
|
|
21 |
FC=g77 |
DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4 -DNML_EXTENDED_F77' |
|
CC=gcc |
|
|
DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4' |
|
22 |
CPP='cpp -traditional -P' |
CPP='cpp -traditional -P' |
23 |
|
EXTENDED_SRC_FLAG='-ffixed-line-length-132' |
24 |
|
GET_FC_VERSION="--version" |
25 |
|
|
26 |
NOOPTFLAGS='-O0' |
NOOPTFLAGS='-O0' |
27 |
|
NOOPTFILES='' |
28 |
|
|
29 |
if test "x$IEEE" = x ; then |
has_sse2=f |
30 |
# No need for IEEE-754 |
grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t |
31 |
FFLAGS='-Wimplicit -Wunused -Wuninitialized' |
if test "x$has_sse2" = xt ; then |
32 |
FOPTIM='-O3 -malign-double -funroll-loops' |
FFLAGS="$FFLAGS -Wimplicit -Wunused -mfpmath=sse -msse -msse2" |
33 |
else |
else |
34 |
# Try to follow IEEE-754 |
FFLAGS="$FFLAGS -Wimplicit -Wunused -ffloat-store" |
35 |
FFLAGS='-Wimplicit -Wunused -ffloat-store' |
fi |
36 |
|
|
37 |
|
if test "x$IEEE" = x ; then #- with optimisation: |
38 |
|
#FOPTIM='-O3 -malign-double -funroll-loops' |
39 |
|
#- note(jmc): |
40 |
|
# -O3 is not always faster than -O2 ; sse & sse2 are faster ; |
41 |
|
# Problems with "-funroll-loops" for some set-up, e.g. tutorial_held_suarez_cs |
42 |
|
FOPTIM='-O3 -malign-double' |
43 |
|
else #- no optimisation + IEEE : |
44 |
FOPTIM='-O0 -malign-double' |
FOPTIM='-O0 -malign-double' |
45 |
fi |
fi |
46 |
|
|
47 |
|
CFLAGS="-O0" |
48 |
|
GSLINC='' |
49 |
|
GSLLIB='-lgsl -lgslcblas' |
50 |
|
PAPIINC='-I/usr/local/pkg/papi/papi-3.0.8.1/p4/include' |
51 |
|
PAPILIB='-L/usr/local/pkg/papi/papi-3.0.8.1/p4/lib -lpapi' |
52 |
|
|
53 |
|
INCLUDEDIRS='' |
54 |
|
INCLUDES='' |
55 |
|
LIBS='' |
56 |
|
|
57 |
if test -d /usr/include/netcdf-3 ; then |
if test -d /usr/include/netcdf-3 ; then |
58 |
INCLUDES='-I/usr/include/netcdf-3' |
INCLUDES='-I/usr/include/netcdf-3' |
59 |
LIBS='-L/usr/lib/netcdf-3' |
if test -d /usr/lib/netcdf-3 ; then |
60 |
|
if test -f /usr/lib/netcdf-3/libnetcdf_g77.a ; then |
61 |
|
LIBS='-L/usr/lib/netcdf-3 -lnetcdf_g77' |
62 |
|
else |
63 |
|
LIBS='-L/usr/lib/netcdf-3' |
64 |
|
fi |
65 |
|
fi |
66 |
elif test -d /usr/include/netcdf ; then |
elif test -d /usr/include/netcdf ; then |
67 |
INCLUDES='-I/usr/include/netcdf' |
INCLUDES='-I/usr/include/netcdf' |
68 |
|
elif test -d /usr/local/netcdf ; then |
69 |
|
INCLUDES='-I/usr/local/netcdf/include' |
70 |
|
LIBS='-L/usr/local/netcdf/lib' |
71 |
fi |
fi |
72 |
|
|
73 |
|
if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then |
74 |
|
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
75 |
|
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
76 |
|
# MPIINCLUDEDIR="$MPI_INC_DIR" |
77 |
|
# MPI_HEADER_FILES='mpif.h mpiof.h' |
78 |
|
# MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h' |
79 |
|
fi |