Back to home page

MITgcm

 
 

    


Warning, /tools/build_options/linux_ia32_ifort11 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
6c257dab34 Cons*0001 #!/bin/bash
                0002 #
85e2682b36 Jean*0003 #
6c257dab34 Cons*0004 #  Constantinos Evangelinos
                0005 #
b495b8e5c2 Jean*0006 #  Build options for the intel 11 fortran compiler (with/without MPI)
                0007 #
                0008 #  with MPI : need to set environment variable MPI_INC_DIR to the include
                0009 #             directory of your MPI implementation
6c257dab34 Cons*0010 
85e2682b36 Jean*0011 #-------
                0012 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
                0013 #    and generally, needs to increase the stack-size:
                0014 #   -  sh,bash:
                0015 #     > export OMP_NUM_THREADS=2
                0016 #     > export KMP_STACKSIZE=400m
                0017 #   - csh,tcsh:
                0018 #     > setenv OMP_NUM_THREADS 2
b495b8e5c2 Jean*0019 #     > setenv KMP_STACKSIZE 400m
85e2682b36 Jean*0020 #-------
                0021 
b495b8e5c2 Jean*0022 if test "x$MPI" = xtrue ; then
                0023   CC=${CC:=mpicc}
                0024   FC=${FC:=mpif77}
                0025   F90C=${F90C:=mpif90}
                0026   LINK="$F90C -shared-intel"
                0027 else
                0028   CC=icc
                0029   FC=ifort
                0030   F90C=ifort
                0031   LINK=$FC
                0032 fi
6c257dab34 Cons*0033 
                0034 DEFINES='-DWORDLENGTH=4'
                0035 CPP='cpp  -traditional -P'
85e2682b36 Jean*0036 F90FIXEDFORMAT='-fixed -Tf'
6c257dab34 Cons*0037 EXTENDED_SRC_FLAG='-132'
85e2682b36 Jean*0038 OMPFLAG='-openmp'
6c257dab34 Cons*0039 
                0040 NOOPTFLAGS='-O0 -g'
                0041 NOOPTFILES=''
                0042 
b495b8e5c2 Jean*0043 FFLAGS="$FFLAGS -convert big_endian -assume byterecl"
85e2682b36 Jean*0044 #- might want to use '-r8' for fizhi pkg:
                0045 #FFLAGS="$FFLAGS -r8"
6c257dab34 Cons*0046 
                0047 if test "x$GENERIC" != x ; then
b495b8e5c2 Jean*0048     PROCF='-mia32 -axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2'
6c257dab34 Cons*0049 else
                0050     PROCF=-xHost
                0051 fi
b495b8e5c2 Jean*0052 
                0053 if test "x$DEVEL" = x ; then
                0054     FFLAGS="$FFLAGS -W0 -WB"
                0055 else
                0056     FFLAGS="$FFLAGS -O0 -g -debug all -debug-parameters all -noalign -fp-stack-check -check all -fpe0 -traceback -ftrapuv -fp-model strict -warn all"
                0057 fi
                0058 
6c257dab34 Cons*0059 #  Note that the -mp switch is for ieee "maintain precision" and is
                0060 #  roughly equivalent to -ieee
b495b8e5c2 Jean*0061 if test "x$IEEE" = x ; then     #- with optimisation:
6c257dab34 Cons*0062     FOPTIM="-O2 -align -ip -opt-streaming-stores auto $PROCF"
                0063 else
b495b8e5c2 Jean*0064   if test "x$DEVEL" = x ; then  #- no optimisation + IEEE :
                0065     FOPTIM="-O0 -fp-model source -noalign $PROCF"
                0066   else                          #- development/check options:
                0067     FOPTIM="$PROCF"
                0068   fi
6c257dab34 Cons*0069 fi
b495b8e5c2 Jean*0070 
6c257dab34 Cons*0071 F90FLAGS=$FFLAGS
                0072 F90OPTIM=$FOPTIM
b495b8e5c2 Jean*0073 CFLAGS="-O0 $PROCF"
                0074 
                0075 INCLUDEDIRS=''
                0076 INCLUDES=''
                0077 LIBS=''
6c257dab34 Cons*0078 
                0079 if [ "x$NETCDF_ROOT" != x ] ; then
                0080     INCLUDEDIRS="${NETCDF_ROOT}/include"
                0081     INCLUDES="-I${NETCDF_ROOT}/include"
                0082     LIBS="-L${NETCDF_ROOT}/lib"
                0083 elif [ "x$NETCDF_HOME" != x ]; then
                0084     INCLUDEDIRS="${NETCDF_HOME}/include"
                0085     INCLUDES="-I${NETCDF_HOME}/include"
                0086     LIBS="-L${NETCDF_HOME}/lib"
                0087 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
                0088     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
                0089     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
                0090     INCLUDEDIRS="${NETCDF_INC}"
                0091     INCLUDES="-I${NETCDF_INC}"
                0092     LIBS="-L${NETCDF_LIB}"
                0093 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
                0094     INCLUDEDIRS="${NETCDF_INCDIR}"
                0095     INCLUDES="-I${NETCDF_INCDIR}"
                0096     LIBS="-L${NETCDF_LIBDIR}"
                0097 elif test -d /usr/include/netcdf-3 ; then
                0098     INCLUDEDIRS='/usr/include/netcdf-3'
                0099     INCLUDES='-I/usr/include/netcdf-3'
                0100     LIBS='-L/usr/lib/netcdf-3'
                0101 elif test -d /usr/local/pkg/netcdf ; then
                0102     INCLUDEDIRS='/usr/local/pkg/netcdf/include'
                0103     INCLUDES='-I/usr/local/pkg/netcdf/include'
                0104     LIBS='-L/usr/local/pkg/netcdf/lib'
                0105 elif test -d /usr/include/netcdf ; then
                0106     INCLUDEDIRS='/usr/include/netcdf'
                0107     INCLUDES='-I/usr/include/netcdf'
                0108 elif test -d /usr/local/netcdf ; then
                0109     INCLUDEDIRS='/usr/include/netcdf/include'
                0110     INCLUDES='-I/usr/local/netcdf/include'
                0111     LIBS='-L/usr/local/netcdf/lib'
                0112 elif test -f /usr/local/include/netcdf.inc ; then
                0113     INCLUDEDIRS='/usr/local/include'
                0114     INCLUDES='-I/usr/local/include'
                0115     LIBS='-L/usr/local/lib'
                0116 fi
                0117 
b495b8e5c2 Jean*0118 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
                0119     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
                0120     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
15978f0412 Jean*0121     #- used for parallel (MPI) DIVA
b495b8e5c2 Jean*0122     MPIINCLUDEDIR="$MPI_INC_DIR"
15978f0412 Jean*0123    #MPI_HEADER_FILES='mpif.h mpiof.h'
b495b8e5c2 Jean*0124 fi