Warning, /tools/build_options/linux_amd64_ifort10- is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit 825ce6f8 on 2019-12-16 22:38:48 UTC
9a89d9d72b Cons*0001 #!/bin/bash
85e2682b36 Jean*0002 #
825ce6f863 Jean*0003 # Build options for version 10 and older of intel compiler on Linux AMD64 platform
85e2682b36 Jean*0004 #
a3f2016fc4 Cons*0005 # Composed and tested by ce107 on ross/weddell (Opteron system)
0006 # Should work fine on EM64T and other AMD64 compatible Intel systems
0007 # a) Processor specific flags:
0008 # 1) for more speed on Core2 processors replace -xW with -xT
0009 # 2) for more speed on Pentium4 based EM64T processors replaces -xW with -xP
0010 # b) For more speed, provided your data size doesn't exceed 2GB you can
0011 # remove -fPIC which carries a performance penalty of 2-6%.
0012 # c) Provided that the libraries you link to are compiled with -fPIC this
0013 # optfile should work.
0014 # d) You can replace -fPIC with -mcmodel=medium which may perform faster
85e2682b36 Jean*0015 # than -fPIC and still support data sizes over 2GB per process but all
6671a7cbbe Jean*0016 # the libraries you link to must be compiled with -fPIC or -mcmodel=medium
85e2682b36 Jean*0017 # e) Changed from -O3 to -O2 to avoid buggy Intel v.10 compilers. Speed
f5ea4039ff Cons*0018 # impact appears to be minimal.
3cdfd8d4ad Jean*0019 #
0020 # MPI : DON'T FORGET to set environment variable MPI_INC_DIR to the include
0021 # directory of your MPI implementation
85e2682b36 Jean*0022
0023 #-------
0024 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
0025 # and generally, needs to increase the stack-size:
0026 # - sh,bash:
0027 # > export OMP_NUM_THREADS=2
0028 # > export KMP_STACKSIZE=400m
0029 # - csh,tcsh:
0030 # > setenv OMP_NUM_THREADS 2
0031 # > setenv KMP_STACKSIZE 400m
3cdfd8d4ad Jean*0032 # NOTE: with MPI+OpenMP, need to set KMP_STACKSIZE in ~/.tcshrc (but curiously,
0033 # works without OMP_NUM_THREADS in ~/.tcshrc).
85e2682b36 Jean*0034 #-------
0035
3cdfd8d4ad Jean*0036 if test "x$MPI" = xtrue ; then
0037 CC=mpicc
0038 FC=mpif77
0039 F90C=mpif90
0040 LINK="$F90C -i-dynamic -no-ipo"
0041 else
0042 CC=icc
0043 FC=ifort
0044 F90C=ifort
0045 LINK="$F90C -i-dynamic -no-ipo"
0046 fi
9a89d9d72b Cons*0047
0048 DEFINES='-DWORDLENGTH=4'
3cdfd8d4ad Jean*0049 CPP='cpp -traditional -P'
9a89d9d72b Cons*0050 F90FIXEDFORMAT='-fixed -Tf'
85e2682b36 Jean*0051 EXTENDED_SRC_FLAG='-132'
3cdfd8d4ad Jean*0052 GET_FC_VERSION="--version"
85e2682b36 Jean*0053 OMPFLAG='-openmp'
9a89d9d72b Cons*0054
3cdfd8d4ad Jean*0055 NOOPTFLAGS='-O0 -g'
9a89d9d72b Cons*0056 NOOPTFILES=''
0057
5c41bebacc Jean*0058 FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl"
3cdfd8d4ad Jean*0059 FFLAGS="$FFLAGS -fPIC"
85e2682b36 Jean*0060 #- might want to use '-r8' for fizhi pkg:
0061 #FFLAGS="$FFLAGS -r8"
9a89d9d72b Cons*0062
3cdfd8d4ad Jean*0063 if test "x$IEEE" = x ; then #- with optimisation:
f5ea4039ff Cons*0064 FOPTIM='-O2 -align -xW -ip'
9a89d9d72b Cons*0065 else
3cdfd8d4ad Jean*0066 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
0067 # "-mp" is for ieee "maintain precision"
0068 FOPTIM='-O0 -noalign -xW -ip -mp'
0069 else #- development/check options:
0070 FFLAGS="$FFLAGS -warn all -warn nounused"
0071 FOPTIM="-fpe0 -fpstkchk -fpmodel except -check all -ftrapuv"
0072 FOPTIM="$FOPTIM -O0 -noalign -g -traceback"
0073 fi
9a89d9d72b Cons*0074 fi
3cdfd8d4ad Jean*0075
9a89d9d72b Cons*0076 F90FLAGS=$FFLAGS
0077 F90OPTIM=$FOPTIM
3cdfd8d4ad Jean*0078 CFLAGS='-O0 -ip -fPIC'
0079
0080 INCLUDEDIRS=''
0081 INCLUDES=''
0082 LIBS=''
9a89d9d72b Cons*0083
0084 if [ "x$NETCDF_ROOT" != x ] ; then
0085 INCLUDEDIRS="${NETCDF_ROOT}/include"
0086 INCLUDES="-I${NETCDF_ROOT}/include"
0087 LIBS="-L${NETCDF_ROOT}/lib"
0088 elif [ "x$NETCDF_HOME" != x ]; then
0089 INCLUDEDIRS="${NETCDF_HOME}/include"
0090 INCLUDES="-I${NETCDF_HOME}/include"
0091 LIBS="-L${NETCDF_HOME}/lib"
0092 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
0093 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
0094 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
0095 INCLUDEDIRS="${NETCDF_INC}"
0096 INCLUDES="-I${NETCDF_INC}"
0097 LIBS="-L${NETCDF_LIB}"
0098 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
0099 INCLUDEDIRS="${NETCDF_INCDIR}"
0100 INCLUDES="-I${NETCDF_INCDIR}"
0101 LIBS="-L${NETCDF_LIBDIR}"
0102 elif test -d /usr/include/netcdf-3 ; then
0103 INCLUDEDIRS='/usr/include/netcdf-3'
0104 INCLUDES='-I/usr/include/netcdf-3'
0105 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
0106 elif test -d /usr/include/netcdf ; then
0107 INCLUDEDIRS='/usr/include/netcdf'
0108 INCLUDES='-I/usr/include/netcdf'
0109 elif test -d /usr/local/netcdf ; then
0110 INCLUDEDIRS='/usr/include/netcdf/include'
0111 INCLUDES='-I/usr/local/netcdf/include'
0112 LIBS='-L/usr/local/netcdf/lib'
0113 elif test -d /usr/local/include/netcdf.inc ; then
0114 INCLUDEDIRS='/usr/local/include'
0115 INCLUDES='-I/usr/local/include'
0116 LIBS='-L/usr/local/lib64'
0117 fi
3cdfd8d4ad Jean*0118
0119 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
0120 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
0121 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
15978f0412 Jean*0122 #- used for parallel (MPI) DIVA
3cdfd8d4ad Jean*0123 MPIINCLUDEDIR="$MPI_INC_DIR"
15978f0412 Jean*0124 #MPI_HEADER_FILES='mpif.h mpiof.h'
3cdfd8d4ad Jean*0125 fi