1 |
edhill |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
jmc |
1.9 |
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_g77,v 1.8 2011/05/16 19:03:37 jmc Exp $ |
4 |
edhill |
1.1 |
# $Name: $ |
5 |
|
|
# |
6 |
jmc |
1.9 |
# Build options for g77 compiler (compat-gcc-34-g77) on Linux AMD64 platform |
7 |
|
|
# Tested on Linux 2.4.21-102-smp (x86_64), |
8 |
|
|
# on Fedora Core 8, 10 (e.g.: dickens), 13 (e.g.: baudelaire), |
9 |
|
|
# 14, 15 (e.g.: acesgrid), 17, 19 |
10 |
edhill |
1.1 |
|
11 |
jmc |
1.9 |
CC=gcc34 |
12 |
edhill |
1.1 |
FC=g77 |
13 |
jmc |
1.6 |
DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4 -DNML_EXTENDED_F77' |
14 |
jmc |
1.3 |
EXTENDED_SRC_FLAG='-ffixed-line-length-132' |
15 |
jmc |
1.7 |
GET_FC_VERSION="--version" |
16 |
jmc |
1.6 |
|
17 |
jmc |
1.9 |
NOOPTFLAGS='-O0' |
18 |
|
|
CFLAGS='-O0' |
19 |
|
|
|
20 |
edhill |
1.1 |
# For IEEE, use the "-ffloat-store" option |
21 |
|
|
if test "x$IEEE" = x ; then |
22 |
|
|
FFLAGS='-Wimplicit -Wunused -Wuninitialized' |
23 |
|
|
FOPTIM='-O3 -funroll-loops' |
24 |
|
|
else |
25 |
|
|
FFLAGS='-Wimplicit -Wunused -ffloat-store' |
26 |
jmc |
1.3 |
# FFLAGS="$FFLAGS -g -mfpmath=sse -msse -msse2 -fbounds-check" |
27 |
|
|
FOPTIM='-O0' |
28 |
edhill |
1.1 |
fi |
29 |
jmc |
1.9 |
|
30 |
|
|
#- for big setups, compile & link with "-fPIC" or set memory-model to "medium": |
31 |
|
|
#CFLAGS="$CFLAGS -fPIC" |
32 |
|
|
#FFLAGS="$FFLAGS -fPIC" |
33 |
|
|
#- with FC 19, need to use this without -fPIC (which cancels -mcmodel option): |
34 |
|
|
CFLAGS="$CFLAGS -mcmodel=medium" |
35 |
|
|
FFLAGS="$FFLAGS -mcmodel=medium" |
36 |
edhill |
1.2 |
|
37 |
|
|
if test -d /usr/include/netcdf-3 ; then |
38 |
jmc |
1.4 |
#-- some FedoraCore standard location used to be "netcdf-3" |
39 |
edhill |
1.2 |
INCLUDES='-I/usr/include/netcdf-3' |
40 |
|
|
if test -d /usr/lib64/netcdf-3 ; then |
41 |
|
|
if test -f /usr/lib64/netcdf-3/libnetcdf_g77.a ; then |
42 |
|
|
LIBS='-L/usr/lib64/netcdf-3 -lnetcdf_g77' |
43 |
|
|
else |
44 |
|
|
LIBS='-L/usr/lib64/netcdf-3' |
45 |
|
|
fi |
46 |
|
|
elif test -d /usr/lib/netcdf-3 ; then |
47 |
|
|
if test -f /usr/lib/netcdf-3/libnetcdf_g77.a ; then |
48 |
|
|
LIBS='-L/usr/lib/netcdf-3 -lnetcdf_g77' |
49 |
|
|
else |
50 |
|
|
LIBS='-L/usr/lib/netcdf-3' |
51 |
|
|
fi |
52 |
|
|
fi |
53 |
jmc |
1.8 |
elif test -d /usr/include/netcdf -o -f /usr/include/netcdf.h ; then |
54 |
jmc |
1.4 |
#-- allows a "compat"(gcc 3.4) 2nd version of libs for g77 , next to the |
55 |
|
|
# standard one (for gfortran, gcc 4.x). But uses same include files. |
56 |
jmc |
1.8 |
if test -d /usr/include/netcdf ; then |
57 |
|
|
INCLUDES='-I/usr/include/netcdf' |
58 |
|
|
fi |
59 |
jmc |
1.4 |
if test -d /usr/lib64/netcdf34 ; then |
60 |
|
|
if test -f /usr/lib64/netcdf34/libnetcdf_g77.a ; then |
61 |
|
|
LIBS='-L/usr/lib64/netcdf34 -lnetcdf_g77' |
62 |
|
|
else |
63 |
|
|
LIBS='-L/usr/lib64/netcdf34' |
64 |
|
|
fi |
65 |
|
|
elif test -d /usr/lib/netcdf34 ; then |
66 |
|
|
if test -f /usr/lib/netcdf34/libnetcdf_g77.a ; then |
67 |
|
|
LIBS='-L/usr/lib/netcdf34 -lnetcdf_g77' |
68 |
|
|
else |
69 |
|
|
LIBS='-L/usr/lib/netcdf34' |
70 |
|
|
fi |
71 |
|
|
fi |
72 |
edhill |
1.2 |
elif test -d /usr/local/netcdf ; then |
73 |
|
|
INCLUDES='-I/usr/local/netcdf/include' |
74 |
|
|
LIBS='-L/usr/local/netcdf/lib' |
75 |
|
|
fi |