2 |
# |
# |
3 |
# $Header$ |
# $Header$ |
4 |
# $Name$ |
# $Name$ |
5 |
|
|
6 |
|
# Build options for version 11 and newer of intel compiler on Linux AMD64 platform |
7 |
|
# Author: Constantinos Evangelinos |
8 |
|
|
9 |
|
# Tested on baudelaire (FC 13) with intel compiler v.11.1.073 (20100806) |
10 |
# |
# |
11 |
# Constantinos Evangelinos |
# OpenMP : tested on danton (FC 14) using intel compiler v.11.1.046 (20090630) |
12 |
|
# and also v.12.0.4 (20110427) |
13 |
# |
# |
14 |
# Build options for the intel 11 fortran compiler |
# MPI : Tested on danton (FC 14), with and without OpenMP, using |
15 |
|
# intel compiler v.11.1.046 (20090630) and also v.12.0.4 (20110427) |
16 |
|
# ==> DON'T FORGET to set environment variable MPI_INC_DIR to the include |
17 |
|
# directory of your MPI implementation |
18 |
|
|
19 |
#------- |
#------- |
20 |
# run with OpenMP: needs to set environment var. OMP_NUM_THREADS |
# run with OpenMP: needs to set environment var. OMP_NUM_THREADS |
25 |
# - csh,tcsh: |
# - csh,tcsh: |
26 |
# > setenv OMP_NUM_THREADS 2 |
# > setenv OMP_NUM_THREADS 2 |
27 |
# > setenv KMP_STACKSIZE 400m |
# > setenv KMP_STACKSIZE 400m |
28 |
|
# NOTE, MPI+OpenMP: might need to set KMP_STACKSIZE in ~/.tcshrc |
29 |
|
# (but curiously, works without OMP_NUM_THREADS in ~/.tcshrc). |
30 |
#------- |
#------- |
31 |
|
|
32 |
FC=ifort |
if test "x$MPI" = xtrue ; then |
33 |
F90C=ifort |
CC=${CC:=mpicc} |
34 |
CC=icc |
FC=${FC:=mpif77} |
35 |
LINK=ifort |
F90C=${F90C:=mpif90} |
36 |
|
LINK="$F90C -shared-intel -no-ipo" |
37 |
|
else |
38 |
|
CC=icc |
39 |
|
FC=ifort |
40 |
|
F90C=ifort |
41 |
|
LINK=ifort |
42 |
|
fi |
43 |
|
|
44 |
DEFINES='-DWORDLENGTH=4' |
DEFINES='-DWORDLENGTH=4' |
45 |
CPP='cpp -traditional -P' |
CPP='cpp -traditional -P' |
46 |
F90FIXEDFORMAT='-fixed -Tf' |
F90FIXEDFORMAT='-fixed -Tf' |
47 |
EXTENDED_SRC_FLAG='-132' |
EXTENDED_SRC_FLAG='-132' |
48 |
GET_FC_VERSION="--version" |
GET_FC_VERSION="--version" |
51 |
NOOPTFLAGS='-O0 -g' |
NOOPTFLAGS='-O0 -g' |
52 |
NOOPTFILES='' |
NOOPTFILES='' |
53 |
|
|
|
INCLUDEDIRS='' |
|
|
INCLUDES='' |
|
|
LIBS='' |
|
|
|
|
|
if test "x$DEVEL" != x ; then |
|
|
FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian -assume byterecl -O0 -g -debug all -debug-parameters all -noalign -fp-stack-check -check all -fpe0 -traceback -ftrapuv -fp-model strict -warn all" |
|
|
else |
|
|
FFLAGS="$FFLAGS -m64 -fPIC -W0 -WB -convert big_endian -assume byterecl" |
|
|
fi |
|
|
#- might want to use '-r8' for fizhi pkg: |
|
|
#FFLAGS="$FFLAGS -r8" |
|
|
|
|
54 |
if test "x$GENERIC" != x ; then |
if test "x$GENERIC" != x ; then |
55 |
PROCF=-axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2 |
PROCF=-axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2 |
56 |
else |
else |
57 |
PROCF=-xHost |
PROCF=-xHost |
58 |
fi |
fi |
59 |
# Note that the -mp switch is for ieee "maintain precision" and is |
|
60 |
# roughly equivalent to -ieee |
FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian -assume byterecl" |
61 |
# Note the addition of -g to circumvent bug with Intel 11. |
#- might want to use '-r8' for fizhi pkg: |
62 |
if test "x$IEEE" = x ; then |
#FFLAGS="$FFLAGS -r8" |
63 |
|
|
64 |
|
if test "x$IEEE" = x ; then #- with optimisation: |
65 |
FOPTIM="-O2 -align -ip -opt-streaming-stores auto $PROCF" |
FOPTIM="-O2 -align -ip -opt-streaming-stores auto $PROCF" |
66 |
else |
else |
67 |
if test "x$DEVEL" != x ; then |
if test "x$DEVEL" = x ; then #- no optimisation + IEEE : |
68 |
FOPTIM="$PROCF" |
FOPTIM="-O0 -fp-model source -noalign $PROCF" |
69 |
else |
else #- development/check options: |
70 |
FOPTIM="-O0 -fp-model source -noalign $PROCF" |
#FFLAGS="$FFLAGS -debug all -debug-parameters all -fp-model strict" |
71 |
fi |
FOPTIM="-O0 -noalign -g -traceback $PROCF" |
72 |
|
NOOPTFLAGS=$FOPTIM |
73 |
|
NOOPTFILES='adread_adwrite.F mdsio_rw_field.F mdsio_rw_slice.F' |
74 |
|
NOOPTFILES="$NOOPTFILES mdsio_readvector.F mdsio_writevector.F" |
75 |
|
FOPTIM="$FOPTIM -warn all -warn nounused" |
76 |
|
FOPTIM="$FOPTIM -fpe0 -ftz -fp-stack-check -check all -ftrapuv" |
77 |
|
fi |
78 |
fi |
fi |
79 |
|
|
80 |
F90FLAGS=$FFLAGS |
F90FLAGS=$FFLAGS |
81 |
F90OPTIM=$FOPTIM |
F90OPTIM=$FOPTIM |
82 |
CFLAGS="-O2 -ip -m64 -fPIC $PROCF" |
CFLAGS="-O0 -ip -m64 -fPIC $PROCF" |
83 |
|
|
84 |
|
INCLUDEDIRS='' |
85 |
|
INCLUDES='' |
86 |
|
LIBS='' |
87 |
|
|
88 |
if [ "x$NETCDF_ROOT" != x ] ; then |
if [ "x$NETCDF_ROOT" != x ] ; then |
89 |
INCLUDEDIRS="${NETCDF_ROOT}/include" |
INCLUDEDIRS="${NETCDF_ROOT}/include" |
124 |
LIBS='-L/usr/local/lib64 -L/usr/local/lib' |
LIBS='-L/usr/local/lib64 -L/usr/local/lib' |
125 |
fi |
fi |
126 |
|
|
127 |
|
if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then |
128 |
|
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
129 |
|
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
130 |
|
MPIINCLUDEDIR="$MPI_INC_DIR" |
131 |
|
MPI_HEADER_FILES='mpif.h mpiof.h' |
132 |
|
MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h' |
133 |
|
fi |