4 |
# $Name$ |
# $Name$ |
5 |
# |
# |
6 |
|
|
7 |
# This was tested with gcc-gfortran v4.0.0 as shipped in Fedora Core |
# Tested with gcc-gfortran v4.0.x as shipped with Fedora Core 4. |
8 |
# 4-test-2. MITgcm successfully compiled but the gfortran-built |
# It fixes the ' \' versus ' &' terminator problem but some |
9 |
# mitgcmuv binary failed to read the "eedata" file. The gfortran |
# namelist problems remain. The biggest seems to be the inability |
10 |
# docs make it clear that there are known NAMELIST bugs in curreent |
# of current gfortran versions to support namelist syntax such as: |
11 |
# versions of gfortran and that users should turn to g77 if their |
# |
12 |
# code encounters these bugs. Later versions of gfortran will |
# fields(1,1) = 'UVELSLT ','VVELSLT ','WVELSLT ', |
13 |
# supposedly fix the NAMELIST implementation. |
# |
14 |
|
# which results in run-time errors. |
15 |
|
|
16 |
|
|
17 |
FC=gfortran |
FC=gfortran |
18 |
CC=gcc |
CC=gcc |
19 |
DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4' |
DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4 -DNML_TERMINATOR' |
20 |
|
# CPP='gcc -E -traditional -P -' |
21 |
CPP='cpp -traditional -P' |
CPP='cpp -traditional -P' |
22 |
NOOPTFLAGS='-O0' |
NOOPTFLAGS='-O0' |
23 |
|
|
24 |
if test "x$IEEE" = x ; then |
if test "x$IEEE" = x ; then |
25 |
# No need for IEEE-754 |
# No need for IEEE-754 |
26 |
FFLAGS='-Wimplicit -Wunused -Wuninitialized' |
# "warning: -Wuninitialized is not supported without -O" |
27 |
|
FFLAGS='-Wunused' |
28 |
FOPTIM='-O3 -malign-double -funroll-loops' |
FOPTIM='-O3 -malign-double -funroll-loops' |
29 |
else |
else |
30 |
# Try to follow IEEE-754 |
# Try to follow IEEE-754 |
31 |
has_sse2=f |
has_sse2=f |
32 |
grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t |
grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t |
33 |
if test "x$has_sse2" = xt ; then |
if test "x$has_sse2" = xt ; then |
34 |
FFLAGS='-Wimplicit -Wunused -mfpmath=sse -msse -msse2' |
FFLAGS='-Wunused -mfpmath=sse -msse -msse2' |
35 |
else |
else |
36 |
FFLAGS='-Wimplicit -Wunused -ffloat-store' |
FFLAGS='-Wunused -ffloat-store' |
37 |
fi |
fi |
38 |
# echo 'FFLAGS="'$FFLAGS'"' |
# echo 'FFLAGS="'$FFLAGS'"' |
39 |
FOPTIM='-O0 -malign-double' |
FOPTIM='-O0 -malign-double' |