1 |
edhill |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
edhill |
1.3 |
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia32_gfortran,v 1.2 2005/06/17 22:38:18 edhill Exp $ |
4 |
edhill |
1.1 |
# $Name: $ |
5 |
|
|
# |
6 |
|
|
|
7 |
edhill |
1.2 |
# 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 |
edhill |
1.1 |
|
16 |
|
|
|
17 |
|
|
FC=gfortran |
18 |
|
|
CC=gcc |
19 |
edhill |
1.2 |
DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4 -DNML_TERMINATOR' |
20 |
edhill |
1.1 |
CPP='cpp -traditional -P' |
21 |
|
|
NOOPTFLAGS='-O0' |
22 |
|
|
|
23 |
|
|
if test "x$IEEE" = x ; then |
24 |
|
|
# No need for IEEE-754 |
25 |
edhill |
1.3 |
# "warning: -Wuninitialized is not supported without -O" |
26 |
|
|
FFLAGS='-Wunused' |
27 |
edhill |
1.1 |
FOPTIM='-O3 -malign-double -funroll-loops' |
28 |
|
|
else |
29 |
|
|
# Try to follow IEEE-754 |
30 |
|
|
has_sse2=f |
31 |
|
|
grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t |
32 |
|
|
if test "x$has_sse2" = xt ; then |
33 |
edhill |
1.3 |
FFLAGS='-Wunused -mfpmath=sse -msse -msse2' |
34 |
edhill |
1.1 |
else |
35 |
edhill |
1.3 |
FFLAGS='-Wunused -ffloat-store' |
36 |
edhill |
1.1 |
fi |
37 |
|
|
# echo 'FFLAGS="'$FFLAGS'"' |
38 |
|
|
FOPTIM='-O0 -malign-double' |
39 |
|
|
fi |
40 |
|
|
|
41 |
|
|
if test -d /usr/include/netcdf-3 ; then |
42 |
|
|
INCLUDES='-I/usr/include/netcdf-3' |
43 |
|
|
LIBS='-L/usr/lib/netcdf-3' |
44 |
|
|
elif test -d /usr/include/netcdf ; then |
45 |
|
|
INCLUDES='-I/usr/include/netcdf' |
46 |
|
|
elif test -d /usr/local/netcdf ; then |
47 |
|
|
INCLUDES='-I/usr/local/netcdf/include' |
48 |
|
|
LIBS='-L/usr/local/netcdf/lib' |
49 |
|
|
fi |
50 |
|
|
|