1 |
#!/bin/bash |
2 |
# |
3 |
# $Header: $ |
4 |
# $Name: $ |
5 |
# |
6 |
|
7 |
# Tested with gcc-gfortran v4.0.x as shipped with Fedora Core 4. |
8 |
# It fixes the ' \' versus ' &' terminator problem but some |
9 |
# namelist problems remain. The biggest seems to be the inability |
10 |
# of current gfortran versions to support namelist syntax such as: |
11 |
# |
12 |
# fields(1,1) = 'UVELSLT ','VVELSLT ','WVELSLT ', |
13 |
# |
14 |
# which results in run-time errors. |
15 |
|
16 |
# This optfile is nearly identical to linux_ia32_gfortran since it |
17 |
# just invokes the LAM compiler-wrappers as shipped with LAM for |
18 |
# Fedora Core 4 which, in spite of its "mpif77" name, is actually |
19 |
# a wrapper for gfortran. |
20 |
|
21 |
FC=mpif77 |
22 |
CC=mpicc |
23 |
DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4 -DNML_TERMINATOR' |
24 |
CPP='cpp -traditional -P' |
25 |
NOOPTFLAGS='-O0' |
26 |
|
27 |
if test "x$IEEE" = x ; then |
28 |
# No need for IEEE-754 |
29 |
# "warning: -Wuninitialized is not supported without -O" |
30 |
FFLAGS='-Wunused' |
31 |
FOPTIM='-O3 -malign-double -funroll-loops' |
32 |
else |
33 |
# Try to follow IEEE-754 |
34 |
has_sse2=f |
35 |
grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t |
36 |
if test "x$has_sse2" = xt ; then |
37 |
FFLAGS='-Wunused -mfpmath=sse -msse -msse2' |
38 |
else |
39 |
FFLAGS='-Wunused -ffloat-store' |
40 |
fi |
41 |
# echo 'FFLAGS="'$FFLAGS'"' |
42 |
FOPTIM='-O0 -malign-double' |
43 |
fi |
44 |
|
45 |
if test -d /usr/include/netcdf-3 ; then |
46 |
INCLUDES='-I/usr/include/netcdf-3' |
47 |
LIBS='-L/usr/lib/netcdf-3' |
48 |
elif test -d /usr/include/netcdf ; then |
49 |
INCLUDES='-I/usr/include/netcdf' |
50 |
elif test -d /usr/local/netcdf ; then |
51 |
INCLUDES='-I/usr/local/netcdf/include' |
52 |
LIBS='-L/usr/local/netcdf/lib' |
53 |
fi |