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

Contents of /MITgcm/tools/build_options/linux_amd64_gfortran+mth

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


Revision 1.3 - (show annotations) (download)
Thu Apr 16 19:05:07 2009 UTC (15 years ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
merge linux_amd64_gfortran+mth into linux_amd64_gfortran
merge linux_ia32_ifort.v9+mth & linux_ia32_ifort+authors_v9
      into linux_ia32_ifort+authors
renamed linux_ia32_ifort.aces+mth to linux_ia32_ifort.aces
      and move OpenMP compiler option in OMPFLAG

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

  ViewVC Help
Powered by ViewVC 1.1.22