1 |
jmc |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
jmc |
1.2 |
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia32_ifort11+mpi_generic,v 1.1 2010/02/16 23:56:03 jmc Exp $ |
4 |
jmc |
1.1 |
# $Name: $ |
5 |
|
|
# |
6 |
|
|
# Constantinos Evangelinos |
7 |
|
|
# |
8 |
|
|
# Build options for the intel 11 fortran compiler with a generic MPI |
9 |
|
|
# |
10 |
|
|
# DON'T FORGET to set environment variable MPI_INC_DIR to the include |
11 |
|
|
# directory of your MPI implementation |
12 |
|
|
|
13 |
|
|
FC=${FC:=mpif77} |
14 |
|
|
F90C=${F90C:=mpif90} |
15 |
|
|
CC=${CC:=mpicc} |
16 |
|
|
LINK="$F90C -shared-intel -no-ipo" |
17 |
|
|
|
18 |
|
|
DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4' |
19 |
|
|
CPP='cpp -traditional -P' |
20 |
jmc |
1.2 |
F90FIXEDFORMAT='-fixed -Tf' |
21 |
jmc |
1.1 |
EXTENDED_SRC_FLAG='-132' |
22 |
|
|
|
23 |
|
|
NOOPTFLAGS='-O0 -g' |
24 |
|
|
NOOPTFILES='' |
25 |
|
|
|
26 |
|
|
INCLUDEDIRS='' |
27 |
|
|
INCLUDES='' |
28 |
|
|
LIBS='' |
29 |
|
|
|
30 |
|
|
if test "x$DEVEL" != x ; then |
31 |
jmc |
1.2 |
FFLAGS="$FFLAGS -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" |
32 |
jmc |
1.1 |
else |
33 |
jmc |
1.2 |
FFLAGS="$FFLAGS -W0 -WB -convert big_endian -assume byterecl" |
34 |
jmc |
1.1 |
fi |
35 |
jmc |
1.2 |
#- might want to use '-r8' for fizhi pkg: |
36 |
|
|
#FFLAGS="$FFLAGS -r8" |
37 |
jmc |
1.1 |
|
38 |
|
|
if test "x$GENERIC" != x ; then |
39 |
|
|
PROCF=-mia32 -axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2 |
40 |
|
|
else |
41 |
|
|
PROCF=-xHost |
42 |
|
|
fi |
43 |
|
|
# Note that the -mp switch is for ieee "maintain precision" and is |
44 |
|
|
# roughly equivalent to -ieee |
45 |
|
|
if test "x$IEEE" = x ; then |
46 |
|
|
FOPTIM="-O2 -align -ip -opt-streaming-stores auto $PROCF" |
47 |
|
|
else |
48 |
|
|
if test "x$DEVEL" != x ; then |
49 |
|
|
FOPTIM="$PROCF" |
50 |
|
|
else |
51 |
|
|
FOPTIM="-O0 -fp-model source -noalign $PROCF" |
52 |
|
|
fi |
53 |
|
|
fi |
54 |
|
|
F90FLAGS=$FFLAGS |
55 |
|
|
F90OPTIM=$FOPTIM |
56 |
|
|
CFLAGS="-O2 -ip $PROCF" |
57 |
|
|
|
58 |
|
|
if [ "x$NETCDF_ROOT" != x ] ; then |
59 |
|
|
INCLUDEDIRS="${NETCDF_ROOT}/include" |
60 |
|
|
INCLUDES="-I${NETCDF_ROOT}/include" |
61 |
|
|
LIBS="-L${NETCDF_ROOT}/lib" |
62 |
|
|
elif [ "x$NETCDF_HOME" != x ]; then |
63 |
|
|
INCLUDEDIRS="${NETCDF_HOME}/include" |
64 |
|
|
INCLUDES="-I${NETCDF_HOME}/include" |
65 |
|
|
LIBS="-L${NETCDF_HOME}/lib" |
66 |
|
|
elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then |
67 |
|
|
NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'` |
68 |
|
|
NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'` |
69 |
|
|
INCLUDEDIRS="${NETCDF_INC}" |
70 |
|
|
INCLUDES="-I${NETCDF_INC}" |
71 |
|
|
LIBS="-L${NETCDF_LIB}" |
72 |
|
|
elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then |
73 |
|
|
INCLUDEDIRS="${NETCDF_INCDIR}" |
74 |
|
|
INCLUDES="-I${NETCDF_INCDIR}" |
75 |
|
|
LIBS="-L${NETCDF_LIBDIR}" |
76 |
|
|
elif test -d /usr/include/netcdf-3 ; then |
77 |
|
|
INCLUDEDIRS='/usr/include/netcdf-3' |
78 |
|
|
INCLUDES='-I/usr/include/netcdf-3' |
79 |
|
|
LIBS='-L/usr/lib/netcdf-3' |
80 |
|
|
elif test -d /usr/local/pkg/netcdf ; then |
81 |
|
|
INCLUDEDIRS='/usr/local/pkg/netcdf/include' |
82 |
|
|
INCLUDES='-I/usr/local/pkg/netcdf/include' |
83 |
|
|
LIBS='-L/usr/local/pkg/netcdf/lib' |
84 |
|
|
elif test -d /usr/include/netcdf ; then |
85 |
|
|
INCLUDEDIRS='/usr/include/netcdf' |
86 |
|
|
INCLUDES='-I/usr/include/netcdf' |
87 |
|
|
elif test -d /usr/local/netcdf ; then |
88 |
|
|
INCLUDEDIRS='/usr/include/netcdf/include' |
89 |
|
|
INCLUDES='-I/usr/local/netcdf/include' |
90 |
|
|
LIBS='-L/usr/local/netcdf/lib' |
91 |
|
|
elif test -f /usr/local/include/netcdf.inc ; then |
92 |
|
|
INCLUDEDIRS='/usr/local/include' |
93 |
|
|
INCLUDES='-I/usr/local/include' |
94 |
|
|
LIBS='-L/usr/local/lib' |
95 |
|
|
fi |
96 |
|
|
|
97 |
|
|
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
98 |
|
|
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
99 |
|
|
MPIINCLUDEDIR="$MPI_INC_DIR" |
100 |
|
|
MPI_HEADER_FILES='mpif.h mpiof.h' |
101 |
|
|
MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h' |