/[MITgcm]/MITgcm/tools/build_options/linux_amd64_ifort
ViewVC logotype

Annotation of /MITgcm/tools/build_options/linux_amd64_ifort

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


Revision 1.8 - (hide annotations) (download)
Mon Sep 12 16:58:50 2011 UTC (12 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63h, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63c
Changes since 1.7: +46 -25 lines
merge linux_amd64_ifort+mpi_generic into this standard optfile

1 ce107 1.1 #!/bin/bash
2 jmc 1.5 #
3 jmc 1.8 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_ifort+mpi_generic,v 1.3 2010/04/20 20:04:06 jmc Exp $
4     # $Name: $
5 jmc 1.5 #
6 ce107 1.3 # Composed and tested by ce107 on ross/weddell (Opteron system)
7     # Should work fine on EM64T and other AMD64 compatible Intel systems
8     # a) Processor specific flags:
9     # 1) for more speed on Core2 processors replace -xW with -xT
10     # 2) for more speed on Pentium4 based EM64T processors replaces -xW with -xP
11     # b) For more speed, provided your data size doesn't exceed 2GB you can
12     # remove -fPIC which carries a performance penalty of 2-6%.
13     # c) Provided that the libraries you link to are compiled with -fPIC this
14     # optfile should work.
15     # d) You can replace -fPIC with -mcmodel=medium which may perform faster
16 jmc 1.5 # than -fPIC and still support data sizes over 2GB per process but all
17 jmc 1.6 # the libraries you link to must be compiled with -fPIC or -mcmodel=medium
18 jmc 1.5 # e) Changed from -O3 to -O2 to avoid buggy Intel v.10 compilers. Speed
19 ce107 1.4 # impact appears to be minimal.
20 jmc 1.8 #
21     # MPI : DON'T FORGET to set environment variable MPI_INC_DIR to the include
22     # directory of your MPI implementation
23 jmc 1.5
24     #-------
25     # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
26     # and generally, needs to increase the stack-size:
27     # - sh,bash:
28     # > export OMP_NUM_THREADS=2
29     # > export KMP_STACKSIZE=400m
30     # - csh,tcsh:
31     # > setenv OMP_NUM_THREADS 2
32     # > setenv KMP_STACKSIZE 400m
33 jmc 1.8 # NOTE: with MPI+OpenMP, need to set KMP_STACKSIZE in ~/.tcshrc (but curiously,
34     # works without OMP_NUM_THREADS in ~/.tcshrc).
35 jmc 1.5 #-------
36    
37 jmc 1.8 if test "x$MPI" = xtrue ; then
38     CC=mpicc
39     FC=mpif77
40     F90C=mpif90
41     LINK="$F90C -i-dynamic -no-ipo"
42     else
43     CC=icc
44     FC=ifort
45     F90C=ifort
46     LINK="$F90C -i-dynamic -no-ipo"
47     fi
48 ce107 1.1
49     DEFINES='-DWORDLENGTH=4'
50 jmc 1.8 CPP='cpp -traditional -P'
51 ce107 1.1 F90FIXEDFORMAT='-fixed -Tf'
52 jmc 1.5 EXTENDED_SRC_FLAG='-132'
53 jmc 1.8 GET_FC_VERSION="--version"
54 jmc 1.5 OMPFLAG='-openmp'
55 ce107 1.1
56 jmc 1.8 NOOPTFLAGS='-O0 -g'
57 ce107 1.1 NOOPTFILES=''
58    
59 jmc 1.8 FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl -fPIC"
60     FFLAGS="$FFLAGS -fPIC"
61 jmc 1.5 #- might want to use '-r8' for fizhi pkg:
62     #FFLAGS="$FFLAGS -r8"
63 ce107 1.1
64 jmc 1.8 if test "x$IEEE" = x ; then #- with optimisation:
65 ce107 1.4 FOPTIM='-O2 -align -xW -ip'
66 ce107 1.1 else
67 jmc 1.8 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
68     # "-mp" is for ieee "maintain precision"
69     FOPTIM='-O0 -noalign -xW -ip -mp'
70     else #- development/check options:
71     FFLAGS="$FFLAGS -warn all -warn nounused"
72     FOPTIM="-fpe0 -fpstkchk -fpmodel except -check all -ftrapuv"
73     FOPTIM="$FOPTIM -O0 -noalign -g -traceback"
74     fi
75 ce107 1.1 fi
76 jmc 1.8
77 ce107 1.1 F90FLAGS=$FFLAGS
78     F90OPTIM=$FOPTIM
79 jmc 1.8 CFLAGS='-O0 -ip -fPIC'
80    
81     INCLUDEDIRS=''
82     INCLUDES=''
83     LIBS=''
84 ce107 1.1
85     if [ "x$NETCDF_ROOT" != x ] ; then
86     INCLUDEDIRS="${NETCDF_ROOT}/include"
87     INCLUDES="-I${NETCDF_ROOT}/include"
88     LIBS="-L${NETCDF_ROOT}/lib"
89     elif [ "x$NETCDF_HOME" != x ]; then
90     INCLUDEDIRS="${NETCDF_HOME}/include"
91     INCLUDES="-I${NETCDF_HOME}/include"
92     LIBS="-L${NETCDF_HOME}/lib"
93     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
94     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
95     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
96     INCLUDEDIRS="${NETCDF_INC}"
97     INCLUDES="-I${NETCDF_INC}"
98     LIBS="-L${NETCDF_LIB}"
99     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
100     INCLUDEDIRS="${NETCDF_INCDIR}"
101     INCLUDES="-I${NETCDF_INCDIR}"
102     LIBS="-L${NETCDF_LIBDIR}"
103     elif test -d /usr/include/netcdf-3 ; then
104     INCLUDEDIRS='/usr/include/netcdf-3'
105     INCLUDES='-I/usr/include/netcdf-3'
106     LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
107     elif test -d /usr/include/netcdf ; then
108     INCLUDEDIRS='/usr/include/netcdf'
109     INCLUDES='-I/usr/include/netcdf'
110     elif test -d /usr/local/netcdf ; then
111     INCLUDEDIRS='/usr/include/netcdf/include'
112     INCLUDES='-I/usr/local/netcdf/include'
113     LIBS='-L/usr/local/netcdf/lib'
114     elif test -d /usr/local/include/netcdf.inc ; then
115     INCLUDEDIRS='/usr/local/include'
116     INCLUDES='-I/usr/local/include'
117     LIBS='-L/usr/local/lib64'
118     fi
119 jmc 1.8
120     if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
121     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
122     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
123     MPIINCLUDEDIR="$MPI_INC_DIR"
124     MPI_HEADER_FILES='mpif.h mpiof.h'
125     MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
126     fi

  ViewVC Help
Powered by ViewVC 1.1.22