/[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.13 - (hide annotations) (download)
Thu Jul 7 22:46:44 2011 UTC (12 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63a, checkpoint63
Changes since 1.12: +3 -6 lines
update comments

1 edhill 1.1 #!/bin/bash
2 jmc 1.7
3 jmc 1.13 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_gfortran,v 1.12 2010/12/15 17:08:25 jmc Exp $
4 edhill 1.1 # $Name: $
5 jmc 1.7
6 jmc 1.5 # Tested with gcc-gfortran v4.1.x as shipped with Fedora Core 6,7,8
7     # with gcc-gfortran v4.3.x as shipped with Fedora Core 9,10
8 edhill 1.1
9 jmc 1.7 # OpenMP : Tested on dickens with gcc-gfortran v4.3.2 as shipped with FC 10
10 jmc 1.13 # and on baudelaire with gcc-gfortran v4.4.5 as shipped with FC 13
11     # also on danton with gcc-gfortran v4.5.1 as shipped with FC 14
12 jmc 1.7 #-------
13 jmc 1.10 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
14 jmc 1.7 # and generally, needs to increase the thread stack-size:
15     # - sh,bash:
16     # > export OMP_NUM_THREADS=2
17     # > export GOMP_STACKSIZE=400m
18     # - csh,tcsh:
19     # > setenv OMP_NUM_THREADS 2
20     # > setenv GOMP_STACKSIZE 400m
21     #-------
22 edhill 1.1
23     FC=gfortran
24 ce107 1.2 F90C=gfortran
25 edhill 1.1 CC=gcc
26 ce107 1.2 DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
27 edhill 1.1 CPP='cpp -traditional -P'
28     NOOPTFLAGS='-O0'
29 jmc 1.4 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
30 jmc 1.12 GET_FC_VERSION="--version"
31 jmc 1.7 OMPFLAG='-fopenmp'
32 edhill 1.1
33 ce107 1.2 if test "x$DEVEL" != x ; then
34     FFLAGS='-g -Wall -W -ffpe-trap=invalid,zero,overflow -fbounds-check'
35     else
36     FFLAGS=''
37     fi
38    
39     # Requires gfortran from 2006 onwards for -fconvert=big-endian
40     FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
41 jmc 1.10 # for big objects:
42     FFLAGS="$FFLAGS -fPIC"
43 ce107 1.2
44 edhill 1.1 if test "x$IEEE" = x ; then
45     # No need for IEEE-754
46 ce107 1.3 FOPTIM='-O3 -funroll-loops'
47 edhill 1.1 else
48     # Try to follow IEEE-754
49 jahn 1.6 # these may also be useful, but require specific gfortran versions:
50     # -Wnonstd-intrinsics for gfortran <= 4.3
51     # -Wintrinsics-std for gfortran >= 4.4
52 jmc 1.10 # -Wno-tabs for gfortran >= 4.3
53 jahn 1.6 FFLAGS="$FFLAGS -Waliasing -Wampersand -Wsurprising -Wline-truncation"
54 jmc 1.5 # to get plenty of warnings :
55     # FFLAGS="$FFLAGS -Wconversion -Wimplicit-interface -Wunused-labels"
56 ce107 1.2 FOPTIM='-O0'
57 jmc 1.5 # for automatic testing with testreport (but no relation with IEEE arithmetic):
58     FOPTIM="$FOPTIM -g -ffpe-trap=invalid,zero,overflow -fbounds-check"
59 edhill 1.1 fi
60 ce107 1.2 F90FLAGS=$FFLAGS
61     F90OPTIM=$FOPTIM
62 jmc 1.10 CFLAGS='-O0 -fPIC'
63 ce107 1.2
64     if [ "x$NETCDF_ROOT" != x ] ; then
65     INCLUDEDIR="${NETCDF_ROOT}/include"
66     INCLUDES="-I${NETCDF_ROOT}/include"
67     LIBDIR="${NETCDF_ROOT}/lib"
68     LIBS="-L${NETCDF_ROOT}/lib"
69     elif [ "x$NETCDF_HOME" != x ]; then
70     INCLUDEDIR="${NETCDF_HOME}/include"
71     INCLUDES="-I${NETCDF_HOME}/include"
72     LIBDIR="${NETCDF_HOME}/lib"
73     LIBS="-L${NETCDF_HOME}/lib"
74     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
75     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
76     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
77     INCLUDEDIR="${NETCDF_INC}"
78     INCLUDES="-I${NETCDF_INC}"
79     LIBDIR="${NETCDF_LIB}"
80     LIBS="-L${NETCDF_LIB}"
81     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
82     INCLUDEDIR="${NETCDF_INCDIR}"
83     INCLUDES="-I${NETCDF_INCDIR}"
84     LIBDIR="${NETCDF_LIBDIR}"
85     LIBS="-L${NETCDF_LIBDIR}"
86     elif test -d /usr/include/netcdf-3 ; then
87 edhill 1.1 INCLUDES='-I/usr/include/netcdf-3'
88     LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
89     elif test -d /usr/include/netcdf ; then
90     INCLUDES='-I/usr/include/netcdf'
91     elif test -d /usr/local/netcdf ; then
92     INCLUDES='-I/usr/local/netcdf/include'
93     LIBS='-L/usr/local/netcdf/lib'
94 ce107 1.2 elif test -d /usr/local/include/netcdf.inc ; then
95     INCLUDES='-I/usr/local/include'
96     LIBS='-L/usr/local/lib64'
97 edhill 1.1 fi

  ViewVC Help
Powered by ViewVC 1.1.22