1 |
edhill |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
|
|
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia32_g77,v 1.17 2005/03/25 21:35:28 heimbach Exp $ |
4 |
|
|
# $Name: $ |
5 |
|
|
# |
6 |
|
|
|
7 |
|
|
# This was tested with gcc-gfortran v4.0.0 as shipped in Fedora Core |
8 |
|
|
# 4-test-2. MITgcm successfully compiled but the gfortran-built |
9 |
|
|
# mitgcmuv binary failed to read the "eedata" file. The gfortran |
10 |
|
|
# docs make it clear that there are known NAMELIST bugs in curreent |
11 |
|
|
# versions of gfortran and that users should turn to g77 if their |
12 |
|
|
# code encounters these bugs. Later versions of gfortran will |
13 |
|
|
# supposedly fix the NAMELIST implementation. |
14 |
|
|
|
15 |
|
|
|
16 |
|
|
FC=gfortran |
17 |
|
|
CC=gcc |
18 |
|
|
DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4' |
19 |
|
|
CPP='cpp -traditional -P' |
20 |
|
|
NOOPTFLAGS='-O0' |
21 |
|
|
|
22 |
|
|
if test "x$IEEE" = x ; then |
23 |
|
|
# No need for IEEE-754 |
24 |
|
|
FFLAGS='-Wimplicit -Wunused -Wuninitialized' |
25 |
|
|
FOPTIM='-O3 -malign-double -funroll-loops' |
26 |
|
|
else |
27 |
|
|
# Try to follow IEEE-754 |
28 |
|
|
has_sse2=f |
29 |
|
|
grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t |
30 |
|
|
if test "x$has_sse2" = xt ; then |
31 |
|
|
FFLAGS='-Wimplicit -Wunused -mfpmath=sse -msse -msse2' |
32 |
|
|
else |
33 |
|
|
FFLAGS='-Wimplicit -Wunused -ffloat-store' |
34 |
|
|
fi |
35 |
|
|
# echo 'FFLAGS="'$FFLAGS'"' |
36 |
|
|
FOPTIM='-O0 -malign-double' |
37 |
|
|
fi |
38 |
|
|
|
39 |
|
|
if test -d /usr/include/netcdf-3 ; then |
40 |
|
|
INCLUDES='-I/usr/include/netcdf-3' |
41 |
|
|
LIBS='-L/usr/lib/netcdf-3' |
42 |
|
|
elif test -d /usr/include/netcdf ; then |
43 |
|
|
INCLUDES='-I/usr/include/netcdf' |
44 |
|
|
elif test -d /usr/local/netcdf ; then |
45 |
|
|
INCLUDES='-I/usr/local/netcdf/include' |
46 |
|
|
LIBS='-L/usr/local/netcdf/lib' |
47 |
|
|
fi |
48 |
|
|
|