Warning, /tools/build_options/linux_ia32_ifort10.1 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 #
71212a7d0a Jean*0006 # Build options for the intel 10.1 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
0019 # > setenv KMP_STACKSIZE 400m
0020 #-------
0021
71212a7d0a 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
71212a7d0a 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
0048 PROCF=-axSOTPNWK
0049 else
0050 has_sse4a=f
0051 has_sse4=f
0052 has_ssse3=f
0053 has_sse3=f
0054 has_sse2=f
0055 has_sse=f
0056 is_opteron=f
0057 is_pentiumm=f
0058 grep flags /proc/cpuinfo | grep " sse4a " > /dev/null 2>&1 && has_sse4a=t
0059 grep flags /proc/cpuinfo | grep " sse4 " > /dev/null 2>&1 && has_sse4=t
0060 grep flags /proc/cpuinfo | grep " sse3 " > /dev/null 2>&1 && has_ssse3=t
0061 grep flags /proc/cpuinfo | grep " sse3 " > /dev/null 2>&1 && has_sse3=t
0062 grep flags /proc/cpuinfo | grep " sse2 " > /dev/null 2>&1 && has_sse2=t
0063 grep flags /proc/cpuinfo | grep " sse " > /dev/null 2>&1 && has_sse=t
0064 grep "model name" /proc/cpuinfo | grep " Opteron" > /dev/null 2>&1 && is_opteron=t
0065 grep "model name" /proc/cpuinfo | grep " Phenom" > /dev/null 2>&1 && is_opteron=t
0066 grep "model name" /proc/cpuinfo | grep " Athlon 64" > /dev/null 2>&1 && is_opteron=t
0067 grep "model name" /proc/cpuinfo | grep " Pentium(R) M" > /dev/null 2>&1 && is_pentiumm=t
0068 if test "x$has_sse4a" = xt ; then
0069 PROCF=-xO
0070 elif test "x$has_sse4" = xt ; then
0071 PROCF=-xS
0072 elif test "x$has_ssse3" = xt ; then
0073 PROCF=-xT
0074 elif test "x$has_sse3" = xt ; then
0075 if test "x$is_opteron" = xt ; then
0076 PROCF=-xO
0077 else
0078 PROCF=-xP
0079 fi
0080 elif test "x$has_sse2" = xt ; then
0081 if test "x$is_pentiumm" = xt ; then
0082 PROCF=-xB
0083 elif test "x$is_opteron" = xt ; then
0084 PROCF=-xW
0085 else
0086 PROCF=-xN
0087 fi
0088 elif test "x$has_sse" = xt ; then
0089 PROCF=-xK
0090 fi
0091 fi
71212a7d0a Jean*0092
0093 if test "x$DEVEL" = x ; then
0094 FFLAGS="$FFLAGS -W0 -WB"
0095 else
0096 FFLAGS="$FFLAGS -O0 -g -debug all -debug-parameters all -noalign -fp-stack-check -check all -fpe0 -traceback -ftrapuv -fp-model strict -warn all"
0097 fi
0098
6c257dab34 Cons*0099 # Note that the -mp switch is for ieee "maintain precision" and is
0100 # roughly equivalent to -ieee
71212a7d0a Jean*0101 if test "x$IEEE" = x ; then #- with optimisation:
6c257dab34 Cons*0102 FOPTIM="-O3 -align -ip -opt-streaming-stores auto $PROCF"
0103 else
71212a7d0a Jean*0104 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
0105 FOPTIM="-O0 -mp -noalign $PROCF"
0106 else #- development/check options:
0107 FOPTIM="$PROCF"
0108 fi
6c257dab34 Cons*0109 fi
71212a7d0a Jean*0110
6c257dab34 Cons*0111 F90FLAGS=$FFLAGS
0112 F90OPTIM=$FOPTIM
71212a7d0a Jean*0113 CFLAGS="-O0 $PROCF"
0114
0115 INCLUDEDIRS=''
0116 INCLUDES=''
0117 LIBS=''
6c257dab34 Cons*0118
0119 if [ "x$NETCDF_ROOT" != x ] ; then
0120 INCLUDEDIRS="${NETCDF_ROOT}/include"
0121 INCLUDES="-I${NETCDF_ROOT}/include"
0122 LIBS="-L${NETCDF_ROOT}/lib"
0123 elif [ "x$NETCDF_HOME" != x ]; then
0124 INCLUDEDIRS="${NETCDF_HOME}/include"
0125 INCLUDES="-I${NETCDF_HOME}/include"
0126 LIBS="-L${NETCDF_HOME}/lib"
0127 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
0128 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
0129 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
0130 INCLUDEDIRS="${NETCDF_INC}"
0131 INCLUDES="-I${NETCDF_INC}"
0132 LIBS="-L${NETCDF_LIB}"
0133 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
0134 INCLUDEDIRS="${NETCDF_INCDIR}"
0135 INCLUDES="-I${NETCDF_INCDIR}"
0136 LIBS="-L${NETCDF_LIBDIR}"
0137 elif test -d /usr/include/netcdf-3 ; then
0138 INCLUDEDIRS='/usr/include/netcdf-3'
0139 INCLUDES='-I/usr/include/netcdf-3'
0140 LIBS='-L/usr/lib/netcdf-3'
0141 elif test -d /usr/local/pkg/netcdf ; then
0142 INCLUDEDIRS='/usr/local/pkg/netcdf/include'
0143 INCLUDES='-I/usr/local/pkg/netcdf/include'
0144 LIBS='-L/usr/local/pkg/netcdf/lib'
0145 elif test -d /usr/include/netcdf ; then
0146 INCLUDEDIRS='/usr/include/netcdf'
0147 INCLUDES='-I/usr/include/netcdf'
0148 elif test -d /usr/local/netcdf ; then
0149 INCLUDEDIRS='/usr/include/netcdf/include'
0150 INCLUDES='-I/usr/local/netcdf/include'
0151 LIBS='-L/usr/local/netcdf/lib'
0152 elif test -f /usr/local/include/netcdf.inc ; then
0153 INCLUDEDIRS='/usr/local/include'
0154 INCLUDES='-I/usr/local/include'
0155 LIBS='-L/usr/local/lib'
0156 fi
0157
71212a7d0a Jean*0158 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
0159 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
0160 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
15978f0412 Jean*0161 #- used for parallel (MPI) DIVA
71212a7d0a Jean*0162 MPIINCLUDEDIR="$MPI_INC_DIR"
15978f0412 Jean*0163 #MPI_HEADER_FILES='mpif.h mpiof.h'
71212a7d0a Jean*0164 fi