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

Diff of /MITgcm/tools/build_options/linux_ia32_gfortran

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

revision 1.7 by jmc, Fri Feb 19 22:23:22 2010 UTC revision 1.11 by jmc, Thu Sep 8 23:10:15 2011 UTC
# Line 7  Line 7 
7  #  Tested with gcc-gfortran v4.1.1 on FC5, FC6, FC8, using flags  #  Tested with gcc-gfortran v4.1.1 on FC5, FC6, FC8, using flags
8  #              formally for gcc-gfortran 4.3*  #              formally for gcc-gfortran 4.3*
9  #       + with gcc-gfortran v4.3.0 on FC9  #       + with gcc-gfortran v4.3.0 on FC9
 #  It fixes the ' \' versus ' &' terminator problem ;  
 #  some namelist problems remain with old version (The biggest seems  
 #     to be the inability to support namelist syntax such as:  
 #     fields(1,1) = 'UVELSLT ','VVELSLT ','WVELSLT ',  
 #      which results in run-time errors).  
10    
11  #-------  #-------
12  # run with OpenMP: needs to set environment var. OMP_NUM_THREADS  # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
# Line 24  Line 19 
19  #     > setenv GOMP_STACKSIZE 400m  #     > setenv GOMP_STACKSIZE 400m
20  #-------  #-------
21    
22  FC=gfortran  if test "x$MPI" = xtrue ; then
23  F90C=gfortran    CC=${CC:=mpicc -m32}
24  CC=gcc    FC=${FC:=mpif77 -m32}
25      F90C=${F90C:=mpif90 -m32}
26    else
27      CC=gcc
28      FC=gfortran
29      F90C=gfortran
30    fi
31    
32  DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'  DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
33  CPP='cpp -traditional -P'  CPP='cpp -traditional -P'
 NOOPTFLAGS='-O0'  
34  EXTENDED_SRC_FLAG='-ffixed-line-length-132'  EXTENDED_SRC_FLAG='-ffixed-line-length-132'
35    GET_FC_VERSION="--version"
36  OMPFLAG='-fopenmp'  OMPFLAG='-fopenmp'
37    
38  if test "x$DEVEL" != x ; then  NOOPTFLAGS='-O0'
39      FFLAGS='-g -Wall -W -ffpe-trap=invalid,zero,overflow -fbounds-check'  NOOPTFILES=''
40  else  
41      FFLAGS=''  has_sse2=f
42  fi  grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1  &&  has_sse2=t
43    
44  # Requires gfortran from 2006 onwards for -fconvert=big-endian  # Requires gfortran from 2006 onwards for -fconvert=big-endian
45  FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"  FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
46  #- otherwise, switch to the home-made byte-swap:  #- otherwise, switch to the home-made byte-swap:
47  #DEFINES="-D_BYTESWAPIO $DEFINES"  #DEFINES="-D_BYTESWAPIO $DEFINES"
48    
49  if test "x$IEEE" = x ; then  if test "x$IEEE" = x ; then     #- with optimisation:
     #  No need for IEEE-754  
50      FOPTIM='-O3 -funroll-loops'      FOPTIM='-O3 -funroll-loops'
51       #if test "x$has_sse2" = xt ; then
52       #    FOPTIM="$FOPTIM -ftree-vectorize -msse -msse2"  # <-- from optfile gfortran4.4
53       #fi
54  else  else
55      #  Try to follow IEEE-754    if test "x$DEVEL" = x ; then  #- no optimisation + IEEE :
     has_sse2=f  
     grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1  &&  has_sse2=t  
56      if test "x$has_sse2" = xt ; then      if test "x$has_sse2" = xt ; then
57          FOPTIM='-O0 -mfpmath=sse -msse -msse2'          FOPTIM='-O0 -mfpmath=sse -msse -msse2'
58      else      else
59          FOPTIM='-O0 -ffloat-store'          FOPTIM='-O0 -ffloat-store'
60      fi      fi
61      else                          #- development/check options:
62        FOPTIM='-O0 -ffloat-store'
63        FOPTIM="$FOPTIM -g -ffpe-trap=invalid,zero,overflow -fbounds-check"
64      fi
65  fi  fi
66  #  version 4.3.0 has problems with option "-malign-double" ;  #  version 4.3.0 has problems with option "-malign-double" ;
67  #  may want to put it back with older/newer version (when it works)  #  may want to put it back with older/newer version (when it works)
68  #FOPTIM="$FOPTIM -malign-double"  #FOPTIM="$FOPTIM -malign-double"
69  F90FLAGS=$FFLAGS  F90FLAGS=$FFLAGS
70  F90OPTIM=$FOPTIM  F90OPTIM=$FOPTIM
71  CFLAGS=$FOPTIM  CFLAGS='-O0'
72    
73    INCLUDEDIRS=''
74    INCLUDES=''
75    LIBS=''
76    
77  if [ "x$NETCDF_ROOT" != x ] ; then  if [ "x$NETCDF_ROOT" != x ] ; then
78      INCLUDEDIR="${NETCDF_ROOT}/include"      INCLUDEDIR="${NETCDF_ROOT}/include"
# Line 88  elif [ "x$NETCDF_INCDIR" != x -a "x$NETC Line 98  elif [ "x$NETCDF_INCDIR" != x -a "x$NETC
98      LIBS="-L${NETCDF_LIBDIR}"      LIBS="-L${NETCDF_LIBDIR}"
99  elif test -d /usr/include/netcdf-3 ; then  elif test -d /usr/include/netcdf-3 ; then
100      INCLUDES='-I/usr/include/netcdf-3'      INCLUDES='-I/usr/include/netcdf-3'
101      LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'      LIBS='-L/usr/lib/netcdf-3'
102  elif test -d /usr/include/netcdf ; then  elif test -d /usr/include/netcdf ; then
103      INCLUDES='-I/usr/include/netcdf'      INCLUDES='-I/usr/include/netcdf'
104  elif test -d /usr/local/netcdf ; then  elif test -d /usr/local/netcdf ; then
# Line 96  elif test -d /usr/local/netcdf ; then Line 106  elif test -d /usr/local/netcdf ; then
106      LIBS='-L/usr/local/netcdf/lib'      LIBS='-L/usr/local/netcdf/lib'
107  elif test -d /usr/local/include/netcdf.inc ; then  elif test -d /usr/local/include/netcdf.inc ; then
108      INCLUDES='-I/usr/local/include'      INCLUDES='-I/usr/local/include'
109      LIBS='-L/usr/local/lib64'      LIBS='-L/usr/local/lib'
110    fi
111    
112    if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
113        INCLUDES="$INCLUDES -I$MPI_INC_DIR"
114        INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
115        MPIINCLUDEDIR="$MPI_INC_DIR"
116        MPI_HEADER_FILES='mpif.h mpiof.h'
117        MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
118  fi  fi

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22