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

Annotation of /MITgcm/tools/build_options/linux_ia32_gfortran

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


Revision 1.8 - (hide annotations) (download)
Fri May 14 21:59:32 2010 UTC (14 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63a, checkpoint63, checkpoint62g, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.7: +3 -3 lines
remove lib64 from this linux_ia32 optfile

1 edhill 1.1 #!/bin/bash
2     #
3 jmc 1.8 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia32_gfortran,v 1.7 2010/02/19 22:23:22 jmc Exp $
4 edhill 1.1 # $Name: $
5     #
6    
7 jmc 1.5 # Tested with gcc-gfortran v4.1.1 on FC5, FC6, FC8, using flags
8     # formally for gcc-gfortran 4.3*
9     # + with gcc-gfortran v4.3.0 on FC9
10     # It fixes the ' \' versus ' &' terminator problem ;
11 jmc 1.7 # some namelist problems remain with old version (The biggest seems
12 jmc 1.5 # to be the inability to support namelist syntax such as:
13 edhill 1.2 # fields(1,1) = 'UVELSLT ','VVELSLT ','WVELSLT ',
14 jmc 1.5 # which results in run-time errors).
15 edhill 1.1
16 jmc 1.7 #-------
17     # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
18     # and generally, needs to increase the thread stack-size:
19     # - sh,bash:
20     # > export OMP_NUM_THREADS=2
21     # > export GOMP_STACKSIZE=400m
22     # - csh,tcsh:
23     # > setenv OMP_NUM_THREADS 2
24     # > setenv GOMP_STACKSIZE 400m
25     #-------
26 edhill 1.1
27     FC=gfortran
28 jmc 1.5 F90C=gfortran
29 edhill 1.1 CC=gcc
30 jmc 1.5 DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
31     CPP='cpp -traditional -P'
32 edhill 1.1 NOOPTFLAGS='-O0'
33 jmc 1.6 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
34 jmc 1.7 OMPFLAG='-fopenmp'
35 edhill 1.1
36 jmc 1.5 if test "x$DEVEL" != x ; then
37     FFLAGS='-g -Wall -W -ffpe-trap=invalid,zero,overflow -fbounds-check'
38     else
39     FFLAGS=''
40     fi
41    
42     # Requires gfortran from 2006 onwards for -fconvert=big-endian
43     FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
44     #- otherwise, switch to the home-made byte-swap:
45     #DEFINES="-D_BYTESWAPIO $DEFINES"
46    
47 edhill 1.1 if test "x$IEEE" = x ; then
48     # No need for IEEE-754
49 jmc 1.5 FOPTIM='-O3 -funroll-loops'
50 edhill 1.1 else
51     # Try to follow IEEE-754
52     has_sse2=f
53     grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t
54     if test "x$has_sse2" = xt ; then
55 jmc 1.5 FOPTIM='-O0 -mfpmath=sse -msse -msse2'
56 edhill 1.1 else
57 jmc 1.5 FOPTIM='-O0 -ffloat-store'
58 edhill 1.1 fi
59     fi
60 jmc 1.5 # version 4.3.0 has problems with option "-malign-double" ;
61     # may want to put it back with older/newer version (when it works)
62     #FOPTIM="$FOPTIM -malign-double"
63     F90FLAGS=$FFLAGS
64     F90OPTIM=$FOPTIM
65     CFLAGS=$FOPTIM
66    
67     if [ "x$NETCDF_ROOT" != x ] ; then
68     INCLUDEDIR="${NETCDF_ROOT}/include"
69     INCLUDES="-I${NETCDF_ROOT}/include"
70     LIBDIR="${NETCDF_ROOT}/lib"
71     LIBS="-L${NETCDF_ROOT}/lib"
72     elif [ "x$NETCDF_HOME" != x ]; then
73     INCLUDEDIR="${NETCDF_HOME}/include"
74     INCLUDES="-I${NETCDF_HOME}/include"
75     LIBDIR="${NETCDF_HOME}/lib"
76     LIBS="-L${NETCDF_HOME}/lib"
77     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
78     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
79     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
80     INCLUDEDIR="${NETCDF_INC}"
81     INCLUDES="-I${NETCDF_INC}"
82     LIBDIR="${NETCDF_LIB}"
83     LIBS="-L${NETCDF_LIB}"
84     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
85     INCLUDEDIR="${NETCDF_INCDIR}"
86     INCLUDES="-I${NETCDF_INCDIR}"
87     LIBDIR="${NETCDF_LIBDIR}"
88     LIBS="-L${NETCDF_LIBDIR}"
89     elif test -d /usr/include/netcdf-3 ; then
90 edhill 1.1 INCLUDES='-I/usr/include/netcdf-3'
91 jmc 1.8 LIBS='-L/usr/lib/netcdf-3'
92 edhill 1.1 elif test -d /usr/include/netcdf ; then
93     INCLUDES='-I/usr/include/netcdf'
94     elif test -d /usr/local/netcdf ; then
95     INCLUDES='-I/usr/local/netcdf/include'
96     LIBS='-L/usr/local/netcdf/lib'
97 jmc 1.5 elif test -d /usr/local/include/netcdf.inc ; then
98     INCLUDES='-I/usr/local/include'
99 jmc 1.8 LIBS='-L/usr/local/lib'
100 edhill 1.1 fi

  ViewVC Help
Powered by ViewVC 1.1.22