/[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.9 by jmc, Fri Aug 12 23:09:08 2011 UTC revision 1.10 by jmc, Tue Sep 6 23:19:30 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"  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=''
 else  
     FFLAGS=''  
 fi  
40    
41  # Requires gfortran from 2006 onwards for -fconvert=big-endian  # Requires gfortran from 2006 onwards for -fconvert=big-endian
42  FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"  FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
43  #- otherwise, switch to the home-made byte-swap:  #- otherwise, switch to the home-made byte-swap:
44  #DEFINES="-D_BYTESWAPIO $DEFINES"  #DEFINES="-D_BYTESWAPIO $DEFINES"
45    
46  if test "x$IEEE" = x ; then  has_sse2=f
47      #  No need for IEEE-754  grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1  &&  has_sse2=t
48    
49    if test "x$IEEE" = x ; then     #- with optimisation:
50      FOPTIM='-O3 -funroll-loops'      FOPTIM='-O3 -funroll-loops'
51        if test "x$has_sse2" = xt ; then
52           #FOPTIM="$FOPTIM -ftree-vectorize"  # <-- was in optfile gfortran4.4
53            FOPTIM="$FOPTIM -msse -msse2"
54        fi
55  else  else
56      #  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  
57      if test "x$has_sse2" = xt ; then      if test "x$has_sse2" = xt ; then
58          FOPTIM='-O0 -mfpmath=sse -msse -msse2'          FOPTIM='-O0 -mfpmath=sse -msse -msse2'
59      else      else
60          FOPTIM='-O0 -ffloat-store'          FOPTIM='-O0 -ffloat-store'
61      fi      fi
62      else                          #- development/check options:
63        FOPTIM='-O0 -ffloat-store'
64        FOPTIM="$FOPTIM -g -ffpe-trap=invalid,zero,overflow -fbounds-check"
65      fi
66  fi  fi
67  #  version 4.3.0 has problems with option "-malign-double" ;  #  version 4.3.0 has problems with option "-malign-double" ;
68  #  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)
69  #FOPTIM="$FOPTIM -malign-double"  #FOPTIM="$FOPTIM -malign-double"
70  F90FLAGS=$FFLAGS  F90FLAGS=$FFLAGS
71  F90OPTIM=$FOPTIM  F90OPTIM=$FOPTIM
72  CFLAGS=$FOPTIM  CFLAGS='-O0'
73    
74    INCLUDEDIRS=''
75    INCLUDES=''
76    LIBS=''
77    
78  if [ "x$NETCDF_ROOT" != x ] ; then  if [ "x$NETCDF_ROOT" != x ] ; then
79      INCLUDEDIR="${NETCDF_ROOT}/include"      INCLUDEDIR="${NETCDF_ROOT}/include"
# Line 99  elif test -d /usr/local/include/netcdf.i Line 109  elif test -d /usr/local/include/netcdf.i
109      INCLUDES='-I/usr/local/include'      INCLUDES='-I/usr/local/include'
110      LIBS='-L/usr/local/lib'      LIBS='-L/usr/local/lib'
111  fi  fi
112    
113    if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
114        INCLUDES="$INCLUDES -I$MPI_INC_DIR"
115        INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
116        MPIINCLUDEDIR="$MPI_INC_DIR"
117        MPI_HEADER_FILES='mpif.h mpiof.h'
118        MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
119    fi

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.22