Back to home page

MITgcm

 
 

    


Warning, /tools/build_options/unsupported/linux_ia32_gfortran4.4 is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
ef80fb15ed Cons*0001 #!/bin/bash
                0002 #
                0003 #
                0004 
                0005 #  Tested with gcc-gfortran v4.1.1 on FC5, FC6, FC8, using flags
                0006 #              formally for gcc-gfortran 4.3*
                0007 #       + with gcc-gfortran v4.3.0 on FC9
                0008 #  It fixes the ' \' versus ' &' terminator problem ;
                0009 #  some namelist problems remain with old version (The biggest seems
                0010 #     to be the inability to support namelist syntax such as:
                0011 #     fields(1,1) = 'UVELSLT ','VVELSLT ','WVELSLT ',
                0012 #      which results in run-time errors).
                0013 
                0014 #-------
                0015 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
                0016 #    and generally, needs to increase the thread stack-size:
                0017 #   -  sh,bash:
                0018 #     > export OMP_NUM_THREADS=2
                0019 #     > export GOMP_STACKSIZE=400m
                0020 #   - csh,tcsh:
                0021 #     > setenv OMP_NUM_THREADS 2
                0022 #     > setenv GOMP_STACKSIZE 400m
                0023 #-------
                0024 
                0025 FC=gfortran
                0026 F90C=gfortran
                0027 CC=gcc
                0028 DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
                0029 CPP='cpp -traditional -P'
                0030 NOOPTFLAGS='-O0'
                0031 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
                0032 OMPFLAG='-fopenmp'
                0033 
                0034 if test "x$DEVEL" != x ; then
                0035     FFLAGS='-g -Wall -W -ffpe-trap=invalid,zero,overflow -fbounds-check'
                0036 else
                0037     FFLAGS=''
                0038 fi
                0039 
                0040 # Requires gfortran from 2006 onwards for -fconvert=big-endian
                0041 FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
                0042 #- otherwise, switch to the home-made byte-swap:
                0043 #DEFINES="-D_BYTESWAPIO $DEFINES"
                0044 
                0045 has_sse2=f
                0046 grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1  &&  has_sse2=t
                0047 if test "x$IEEE" = x ; then
                0048     #  No need for IEEE-754
                0049     if test "x$has_sse2" = xt ; then
                0050         FOPTIM='-O3 -funroll-loops -ftree-vectorize -msse -msse2'
                0051     else
                0052         FOPTIM='-O3 -funroll-loops'
                0053     fi
                0054 else
                0055     #  Try to follow IEEE-754
                0056     has_sse2=f
                0057     grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1  &&  has_sse2=t
                0058     if test "x$has_sse2" = xt ; then
                0059         FOPTIM='-O0 -ftree-vectorize -mfpmath=sse -msse -msse2'
                0060     else
                0061         FOPTIM='-O0 -ffloat-store'
                0062     fi
                0063 fi
                0064 #  version 4.3.0 has problems with option "-malign-double" ;
                0065 #  may want to put it back with older/newer version (when it works)
                0066 #FOPTIM="$FOPTIM -malign-double"
                0067 F90FLAGS=$FFLAGS
                0068 F90OPTIM=$FOPTIM
                0069 CFLAGS=$FOPTIM
                0070 
                0071 if [ "x$NETCDF_ROOT" != x ] ; then
                0072     INCLUDEDIR="${NETCDF_ROOT}/include"
                0073     INCLUDES="-I${NETCDF_ROOT}/include"
                0074     LIBDIR="${NETCDF_ROOT}/lib"
                0075     LIBS="-L${NETCDF_ROOT}/lib"
                0076 elif [ "x$NETCDF_HOME" != x ]; then
                0077     INCLUDEDIR="${NETCDF_HOME}/include"
                0078     INCLUDES="-I${NETCDF_HOME}/include"
                0079     LIBDIR="${NETCDF_HOME}/lib"
                0080     LIBS="-L${NETCDF_HOME}/lib"
                0081 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
                0082     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
                0083     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
                0084     INCLUDEDIR="${NETCDF_INC}"
                0085     INCLUDES="-I${NETCDF_INC}"
                0086     LIBDIR="${NETCDF_LIB}"
                0087     LIBS="-L${NETCDF_LIB}"
                0088 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
                0089     INCLUDEDIR="${NETCDF_INCDIR}"
                0090     INCLUDES="-I${NETCDF_INCDIR}"
                0091     LIBDIR="${NETCDF_LIBDIR}"
                0092     LIBS="-L${NETCDF_LIBDIR}"
                0093 elif test -d /usr/include/netcdf-3 ; then
                0094     INCLUDES='-I/usr/include/netcdf-3'
                0095     LIBS='-L/usr/lib/netcdf-3'
                0096 elif test -d /usr/include/netcdf ; then
                0097     INCLUDES='-I/usr/include/netcdf'
                0098 elif test -d /usr/local/netcdf ; then
                0099     INCLUDES='-I/usr/local/netcdf/include'
                0100     LIBS='-L/usr/local/netcdf/lib'
                0101 elif test -d /usr/local/include/netcdf.inc ; then
                0102     INCLUDES='-I/usr/local/include'
                0103     LIBS='-L/usr/local/lib'
                0104 fi