Back to home page

MITgcm

 
 

    


Warning, /tools/build_options/unsupported/linux_ia32_gfortran+mpi_generic 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
1335f9f461 Jean*0001 #!/bin/bash
                0002 #
                0003 #
                0004 #  Build options for the gfortran compiler with a generic MPI
                0005 #
                0006 # DON'T FORGET to set environment variable MPI_INC_DIR to the include
                0007 # directory of your MPI implementation
                0008 #
                0009 #  It fixes the ' \' versus ' &' terminator problem ;
                0010 #  some namelist problems remain with old version (The biggest seems 
                0011 #     to be the inability to support namelist syntax such as:
                0012 #     fields(1,1) = 'UVELSLT ','VVELSLT ','WVELSLT ',
                0013 #      which results in run-time errors).
                0014 
                0015 
                0016 FC=${FC:=mpif77 -m32}
                0017 F90C=${F90C:=mpif90 -m32}
                0018 CC=${CC:=mpicc -m32}
                0019 
                0020 DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4 -DNML_TERMINATOR'
                0021 CPP='cpp -traditional -P'
                0022 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
                0023 OMPFLAG='-fopenmp'
                0024 
                0025 NOOPTFLAGS='-O0'
                0026 NOOPTFILES=''
                0027 
                0028 INCLUDEDIRS=''
                0029 INCLUDES=''
                0030 LIBS=''
                0031 
                0032 if test "x$DEVEL" != x ; then
                0033     FFLAGS='-g -Wall -W -ffpe-trap=invalid,zero,overflow -fbounds-check'
                0034 else
                0035     FFLAGS=''
                0036 fi
                0037 
                0038 # Requires gfortran from 2006 onwards for -fconvert=big-endian
                0039 FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
                0040 #- otherwise, switch to the home-made byte-swap:
                0041 #DEFINES="-D_BYTESWAPIO $DEFINES"
                0042 
                0043 if test "x$IEEE" = x ; then
                0044     #  No need for IEEE-754
                0045     FOPTIM='-O3 -funroll-loops'
                0046 else
                0047     #  Try to follow IEEE-754
                0048     has_sse2=f
                0049     grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1  &&  has_sse2=t
                0050     if test "x$has_sse2" = xt ; then
                0051         FOPTIM='-O0 -mfpmath=sse -msse -msse2'
                0052     else
                0053         FOPTIM='-O0 -ffloat-store'
                0054     fi
                0055 fi
                0056 #  version 4.3.0 has problems with option "-malign-double" ;
                0057 #  may want to put it back with older/newer version (when it works)
                0058 #FOPTIM="$FOPTIM -malign-double"
                0059 F90FLAGS=$FFLAGS
                0060 F90OPTIM=$FOPTIM
                0061 CFLAGS=$FOPTIM
                0062 
                0063 if [ "x$NETCDF_ROOT" != x ] ; then
                0064     INCLUDEDIR="${NETCDF_ROOT}/include"
                0065     INCLUDES="-I${NETCDF_ROOT}/include"
                0066     LIBDIR="${NETCDF_ROOT}/lib"
                0067     LIBS="-L${NETCDF_ROOT}/lib"
                0068 elif [ "x$NETCDF_HOME" != x ]; then
                0069     INCLUDEDIR="${NETCDF_HOME}/include"
                0070     INCLUDES="-I${NETCDF_HOME}/include"
                0071     LIBDIR="${NETCDF_HOME}/lib"
                0072     LIBS="-L${NETCDF_HOME}/lib"
                0073 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
                0074     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
                0075     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
                0076     INCLUDEDIR="${NETCDF_INC}"
                0077     INCLUDES="-I${NETCDF_INC}"
                0078     LIBDIR="${NETCDF_LIB}"
                0079     LIBS="-L${NETCDF_LIB}"
                0080 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
                0081     INCLUDEDIR="${NETCDF_INCDIR}"
                0082     INCLUDES="-I${NETCDF_INCDIR}"
                0083     LIBDIR="${NETCDF_LIBDIR}"
                0084     LIBS="-L${NETCDF_LIBDIR}"
                0085 elif test -d /usr/include/netcdf-3 ; then
                0086     INCLUDES='-I/usr/include/netcdf-3'
                0087     LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
                0088 elif test -d /usr/include/netcdf ; then
                0089     INCLUDES='-I/usr/include/netcdf'
                0090 elif test -d /usr/local/netcdf ; then
                0091     INCLUDES='-I/usr/local/netcdf/include'
                0092     LIBS='-L/usr/local/netcdf/lib'
                0093 elif test -d /usr/local/include/netcdf.inc ; then
                0094     INCLUDES='-I/usr/local/include'
                0095     LIBS='-L/usr/local/lib64'
                0096 fi
                0097 
                0098 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
                0099 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
                0100 MPIINCLUDEDIR="$MPI_INC_DIR"
                0101 MPI_HEADER_FILES='mpif.h mpiof.h'
                0102 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'