/[MITgcm]/MITgcm/tools/build_options/linux_ia32_ifort10.1+mpi_generic
ViewVC logotype

Annotation of /MITgcm/tools/build_options/linux_ia32_ifort10.1+mpi_generic

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Tue Feb 16 23:56:02 2010 UTC (14 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62c
rename "_generic_mpi" -> "+mpi_generic" (like other "+mpi" optfile)
 but keep the former optfile for few weeks for smooth transition

1 jmc 1.1 #!/bin/bash
2     #
3     # $Header: $
4     # $Name: $
5     #
6     # Constantinos Evangelinos
7     #
8     # Build options for the intel 10.1 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     F90FIXEDFORMAT='-fixed -Tf'
21     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     FFLAGS='-r8 -i4 -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     else
33     FFLAGS='-r8 -i4 -W0 -WB -convert big_endian -assume byterecl'
34     fi
35    
36     if test "x$GENERIC" != x ; then
37     PROCF=-axSOTPNWK
38     else
39     has_sse4a=f
40     has_sse4=f
41     has_ssse3=f
42     has_sse3=f
43     has_sse2=f
44     has_sse=f
45     is_opteron=f
46     is_pentiumm=f
47     grep flags /proc/cpuinfo | grep " sse4a " > /dev/null 2>&1 && has_sse4a=t
48     grep flags /proc/cpuinfo | grep " sse4 " > /dev/null 2>&1 && has_sse4=t
49     grep flags /proc/cpuinfo | grep " sse3 " > /dev/null 2>&1 && has_ssse3=t
50     grep flags /proc/cpuinfo | grep " sse3 " > /dev/null 2>&1 && has_sse3=t
51     grep flags /proc/cpuinfo | grep " sse2 " > /dev/null 2>&1 && has_sse2=t
52     grep flags /proc/cpuinfo | grep " sse " > /dev/null 2>&1 && has_sse=t
53     grep "model name" /proc/cpuinfo | grep " Opteron" > /dev/null 2>&1 && is_opteron=t
54     grep "model name" /proc/cpuinfo | grep " Phenom" > /dev/null 2>&1 && is_opteron=t
55     grep "model name" /proc/cpuinfo | grep " Athlon 64" > /dev/null 2>&1 && is_opteron=t
56     grep "model name" /proc/cpuinfo | grep " Pentium(R) M" > /dev/null 2>&1 && is_pentiumm=t
57     if test "x$has_sse4a" = xt ; then
58     PROCF=-xO
59     elif test "x$has_sse4" = xt ; then
60     PROCF=-xS
61     elif test "x$has_ssse3" = xt ; then
62     PROCF=-xT
63     elif test "x$has_sse3" = xt ; then
64     if test "x$is_opteron" = xt ; then
65     PROCF=-xO
66     else
67     PROCF=-xP
68     fi
69     elif test "x$has_sse2" = xt ; then
70     if test "x$is_pentiumm" = xt ; then
71     PROCF=-xB
72     elif test "x$is_opteron" = xt ; then
73     PROCF=-xW
74     else
75     PROCF=-xN
76     fi
77     elif test "x$has_sse" = xt ; then
78     PROCF=-xK
79     fi
80     fi
81     # Note that the -mp switch is for ieee "maintain precision" and is
82     # roughly equivalent to -ieee
83     if test "x$IEEE" = x ; then
84     FOPTIM="-O3 -align -ip -opt-streaming-stores auto $PROCF"
85     else
86     if test "x$DEVEL" != x ; then
87     FOPTIM="$PROCF"
88     else
89     FOPTIM="-O0 -mp -noalign $PROCF"
90     fi
91     fi
92     F90FLAGS=$FFLAGS
93     F90OPTIM=$FOPTIM
94     CFLAGS="-O2 -ip $PROCF"
95    
96     if [ "x$NETCDF_ROOT" != x ] ; then
97     INCLUDEDIRS="${NETCDF_ROOT}/include"
98     INCLUDES="-I${NETCDF_ROOT}/include"
99     LIBS="-L${NETCDF_ROOT}/lib"
100     elif [ "x$NETCDF_HOME" != x ]; then
101     INCLUDEDIRS="${NETCDF_HOME}/include"
102     INCLUDES="-I${NETCDF_HOME}/include"
103     LIBS="-L${NETCDF_HOME}/lib"
104     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
105     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
106     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
107     INCLUDEDIRS="${NETCDF_INC}"
108     INCLUDES="-I${NETCDF_INC}"
109     LIBS="-L${NETCDF_LIB}"
110     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
111     INCLUDEDIRS="${NETCDF_INCDIR}"
112     INCLUDES="-I${NETCDF_INCDIR}"
113     LIBS="-L${NETCDF_LIBDIR}"
114     elif test -d /usr/include/netcdf-3 ; then
115     INCLUDEDIRS='/usr/include/netcdf-3'
116     INCLUDES='-I/usr/include/netcdf-3'
117     LIBS='-L/usr/lib/netcdf-3'
118     elif test -d /usr/local/pkg/netcdf ; then
119     INCLUDEDIRS='/usr/local/pkg/netcdf/include'
120     INCLUDES='-I/usr/local/pkg/netcdf/include'
121     LIBS='-L/usr/local/pkg/netcdf/lib'
122     elif test -d /usr/include/netcdf ; then
123     INCLUDEDIRS='/usr/include/netcdf'
124     INCLUDES='-I/usr/include/netcdf'
125     elif test -d /usr/local/netcdf ; then
126     INCLUDEDIRS='/usr/include/netcdf/include'
127     INCLUDES='-I/usr/local/netcdf/include'
128     LIBS='-L/usr/local/netcdf/lib'
129     elif test -f /usr/local/include/netcdf.inc ; then
130     INCLUDEDIRS='/usr/local/include'
131     INCLUDES='-I/usr/local/include'
132     LIBS='-L/usr/local/lib'
133     fi
134    
135     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
136     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
137     MPIINCLUDEDIR="$MPI_INC_DIR"
138     MPI_HEADER_FILES='mpif.h mpiof.h'
139     MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'

  ViewVC Help
Powered by ViewVC 1.1.22