/[MITgcm]/MITgcm/tools/build_options/linux_amd64_gfortran
ViewVC logotype

Annotation of /MITgcm/tools/build_options/linux_amd64_gfortran

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (hide annotations) (download)
Wed Mar 25 15:17:47 2009 UTC (15 years, 1 month ago) by jmc
Branch: MAIN
Changes since 1.3: +2 -1 lines
add EXTENDED_SRC_FLAG

1 edhill 1.1 #!/bin/bash
2     #
3 jmc 1.4 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_gfortran,v 1.3 2007/08/20 20:31:00 ce107 Exp $
4 edhill 1.1 # $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    
17     FC=gfortran
18 ce107 1.2 F90C=gfortran
19 edhill 1.1 CC=gcc
20 ce107 1.2 DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
21 edhill 1.1 CPP='cpp -traditional -P'
22     NOOPTFLAGS='-O0'
23 jmc 1.4 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
24 edhill 1.1
25 ce107 1.2 if test "x$DEVEL" != x ; then
26     FFLAGS='-g -Wall -W -ffpe-trap=invalid,zero,overflow -fbounds-check'
27     else
28     FFLAGS=''
29     fi
30    
31     # Requires gfortran from 2006 onwards for -fconvert=big-endian
32     FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
33    
34 edhill 1.1 if test "x$IEEE" = x ; then
35     # No need for IEEE-754
36 ce107 1.3 FOPTIM='-O3 -funroll-loops'
37 edhill 1.1 else
38     # Try to follow IEEE-754
39 ce107 1.2 FOPTIM='-O0'
40 edhill 1.1 fi
41 ce107 1.2 F90FLAGS=$FFLAGS
42     F90OPTIM=$FOPTIM
43     CFLAGS=$FOPTIM
44    
45     if [ "x$NETCDF_ROOT" != x ] ; then
46     INCLUDEDIR="${NETCDF_ROOT}/include"
47     INCLUDES="-I${NETCDF_ROOT}/include"
48     LIBDIR="${NETCDF_ROOT}/lib"
49     LIBS="-L${NETCDF_ROOT}/lib"
50     elif [ "x$NETCDF_HOME" != x ]; then
51     INCLUDEDIR="${NETCDF_HOME}/include"
52     INCLUDES="-I${NETCDF_HOME}/include"
53     LIBDIR="${NETCDF_HOME}/lib"
54     LIBS="-L${NETCDF_HOME}/lib"
55     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
56     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
57     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
58     INCLUDEDIR="${NETCDF_INC}"
59     INCLUDES="-I${NETCDF_INC}"
60     LIBDIR="${NETCDF_LIB}"
61     LIBS="-L${NETCDF_LIB}"
62     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
63     INCLUDEDIR="${NETCDF_INCDIR}"
64     INCLUDES="-I${NETCDF_INCDIR}"
65     LIBDIR="${NETCDF_LIBDIR}"
66     LIBS="-L${NETCDF_LIBDIR}"
67     elif test -d /usr/include/netcdf-3 ; then
68 edhill 1.1 INCLUDES='-I/usr/include/netcdf-3'
69     LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
70     elif test -d /usr/include/netcdf ; then
71     INCLUDES='-I/usr/include/netcdf'
72     elif test -d /usr/local/netcdf ; then
73     INCLUDES='-I/usr/local/netcdf/include'
74     LIBS='-L/usr/local/netcdf/lib'
75 ce107 1.2 elif test -d /usr/local/include/netcdf.inc ; then
76     INCLUDES='-I/usr/local/include'
77     LIBS='-L/usr/local/lib64'
78 edhill 1.1 fi

  ViewVC Help
Powered by ViewVC 1.1.22