/[MITgcm]/MITgcm/tools/build_options/linux_ia32_gfortran4.4
ViewVC logotype

Annotation of /MITgcm/tools/build_options/linux_ia32_gfortran4.4

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


Revision 1.1 - (hide annotations) (download)
Mon Apr 12 03:55:54 2010 UTC (14 years ago) by ce107
Branch: MAIN
CVS Tags: checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint63
Optfile for Gfortran with auto-vectorization (SIMDization) since v. 4.4

1 ce107 1.1 #!/bin/bash
2     #
3     # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia32_gfortran,v 1.7 2010/02/19 22:23:22 jmc Exp $
4     # $Name: $
5     #
6    
7     # 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     # some namelist problems remain with old version (The biggest seems
12     # to be the inability to support namelist syntax such as:
13     # fields(1,1) = 'UVELSLT ','VVELSLT ','WVELSLT ',
14     # which results in run-time errors).
15    
16     #-------
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    
27     FC=gfortran
28     F90C=gfortran
29     CC=gcc
30     DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
31     CPP='cpp -traditional -P'
32     NOOPTFLAGS='-O0'
33     EXTENDED_SRC_FLAG='-ffixed-line-length-132'
34     OMPFLAG='-fopenmp'
35    
36     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     has_sse2=f
48     grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t
49     if test "x$IEEE" = x ; then
50     # No need for IEEE-754
51     if test "x$has_sse2" = xt ; then
52     FOPTIM='-O3 -funroll-loops -ftree-vectorize -msse -msse2'
53     else
54     FOPTIM='-O3 -funroll-loops'
55     fi
56     else
57     # Try to follow IEEE-754
58     has_sse2=f
59     grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t
60     if test "x$has_sse2" = xt ; then
61     FOPTIM='-O0 -ftree-vectorize -mfpmath=sse -msse -msse2'
62     else
63     FOPTIM='-O0 -ffloat-store'
64     fi
65     fi
66     # version 4.3.0 has problems with option "-malign-double" ;
67     # may want to put it back with older/newer version (when it works)
68     #FOPTIM="$FOPTIM -malign-double"
69     F90FLAGS=$FFLAGS
70     F90OPTIM=$FOPTIM
71     CFLAGS=$FOPTIM
72    
73     if [ "x$NETCDF_ROOT" != x ] ; then
74     INCLUDEDIR="${NETCDF_ROOT}/include"
75     INCLUDES="-I${NETCDF_ROOT}/include"
76     LIBDIR="${NETCDF_ROOT}/lib"
77     LIBS="-L${NETCDF_ROOT}/lib"
78     elif [ "x$NETCDF_HOME" != x ]; then
79     INCLUDEDIR="${NETCDF_HOME}/include"
80     INCLUDES="-I${NETCDF_HOME}/include"
81     LIBDIR="${NETCDF_HOME}/lib"
82     LIBS="-L${NETCDF_HOME}/lib"
83     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
84     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
85     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
86     INCLUDEDIR="${NETCDF_INC}"
87     INCLUDES="-I${NETCDF_INC}"
88     LIBDIR="${NETCDF_LIB}"
89     LIBS="-L${NETCDF_LIB}"
90     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
91     INCLUDEDIR="${NETCDF_INCDIR}"
92     INCLUDES="-I${NETCDF_INCDIR}"
93     LIBDIR="${NETCDF_LIBDIR}"
94     LIBS="-L${NETCDF_LIBDIR}"
95     elif test -d /usr/include/netcdf-3 ; then
96     INCLUDES='-I/usr/include/netcdf-3'
97     LIBS='-L/usr/lib/netcdf-3'
98     elif test -d /usr/include/netcdf ; then
99     INCLUDES='-I/usr/include/netcdf'
100     elif test -d /usr/local/netcdf ; then
101     INCLUDES='-I/usr/local/netcdf/include'
102     LIBS='-L/usr/local/netcdf/lib'
103     elif test -d /usr/local/include/netcdf.inc ; then
104     INCLUDES='-I/usr/local/include'
105     LIBS='-L/usr/local/lib'
106     fi

  ViewVC Help
Powered by ViewVC 1.1.22