/[MITgcm]/MITgcm_contrib/test_scripts/other/linux_amd64_ifort+mpi_chk
ViewVC logotype

Annotation of /MITgcm_contrib/test_scripts/other/linux_amd64_ifort+mpi_chk

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


Revision 1.4 - (hide annotations) (download)
Mon Jul 11 23:01:59 2011 UTC (14 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
optfile no longer used (use standard one with "-devel" option);
add intel script to set-up compiler environment vaiables

1 jmc 1.1 #!/bin/bash
2     #
3 jmc 1.4 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/linux_amd64_ifort+mpi_chk,v 1.3 2011/06/03 17:59:32 jmc Exp $
4 jmc 1.1 # $Name: $
5 jmc 1.3 #
6     # Adapted from linux_amd64_ifort11+mpi_generic
7     # with specific local path (=MPI_INC_DIR) for MPI
8     # Tested on jmc's laptop with MPI & Multi-Threaded
9     # using intel compiler v.11.1.046 & mpich-1.2.7 (FC.11)
10     # v.12.0.4 & mpich-1.2.7 (FC.14)
11     # (intel compiler & mpich installed in /opt/intel/ )
12 jmc 1.1
13 jmc 1.3 # Build options for the intel 11 fortran compiler with a generic MPI
14     # DON'T FORGET to set environment variable MPI_INC_DIR to the include
15     # directory of your MPI implementation
16 jmc 1.1
17     #-------
18     # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
19     # and generally, needs to increase the stack-size:
20     # - sh,bash:
21     # > export OMP_NUM_THREADS=2
22     # > export KMP_STACKSIZE=400m
23     # - csh,tcsh:
24     # > setenv OMP_NUM_THREADS 2
25     # > setenv KMP_STACKSIZE 400m
26 jmc 1.3 # NOTE: need to set KMP_STACKSIZE in ~/.tcshrc
27     # (but curiously, works without OMP_NUM_THREADS in ~/.tcshrc).
28 jmc 1.1 #-------
29    
30 jmc 1.3 MPI_INC_DIR='/opt/intel/mpich-1.2.7p1/include'
31 jmc 1.1
32 jmc 1.3 FC=${FC:=mpif77}
33     F90C=${F90C:=mpif90}
34     CC=${CC:=mpicc}
35     LINK="$F90C -shared-intel -no-ipo"
36     # -shared-intel replaces -i-dynamic ; -static-intel replaces -i-static
37     #LINK="$F90C -static-intel -no-ipo"
38 jmc 1.1 F90C='mpif90 -fixed'
39    
40     DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4'
41     CPP='cpp -traditional -P'
42     F90FIXEDFORMAT='-fixed -Tf'
43     EXTENDED_SRC_FLAG='-132'
44 jmc 1.2 GET_FC_VERSION="--version"
45 jmc 1.1 OMPFLAG='-openmp'
46    
47 jmc 1.3 NOOPTFLAGS='-O0 -g'
48 jmc 1.1 NOOPTFILES=''
49    
50     INCLUDEDIRS=''
51     INCLUDES=''
52     LIBS=''
53    
54     if test "x$DEVEL" != x ; then
55 jmc 1.3 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"
56 jmc 1.1 else
57 jmc 1.3 FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian -assume byterecl"
58 jmc 1.1 fi
59     #- might want to use '-r8' for fizhi pkg:
60     #FFLAGS="$FFLAGS -r8"
61    
62 jmc 1.3 if test "x$GENERIC" != x ; then
63     PROCF=-axSSE4.2,SSE4.1,SSSE3,SSE3,SSE2
64     else
65     PROCF=-xHost
66     fi
67 jmc 1.1 if test "x$IEEE" = x ; then
68 jmc 1.3 FOPTIM="-O2 -align -ip -opt-streaming-stores auto $PROCF"
69 jmc 1.1 else
70 jmc 1.3 #- for automatic testing with testreport (but no relation with IEEE arithmetic):
71     FOPTIM="-fpe0 -ftz -fp-stack-check -check all -ftrapuv"
72     FOPTIM="$FOPTIM -O0 -noalign -g -traceback $PROCF"
73 jmc 1.1 FFLAGS="$FFLAGS -warn all -warn nounused"
74 jmc 1.3 if test "x$DEVEL" != x ; then
75     FOPTIM="$PROCF"
76     fi
77 jmc 1.1 fi
78     F90FLAGS=$FFLAGS
79     F90OPTIM=$FOPTIM
80 jmc 1.3 CFLAGS="-O0 -ip -m64 -fPIC $PROCF"
81 jmc 1.1
82     if [ "x$NETCDF_ROOT" != x ] ; then
83     INCLUDEDIRS="${NETCDF_ROOT}/include"
84     INCLUDES="-I${NETCDF_ROOT}/include"
85 jmc 1.3 LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_ROOT}/lib"
86 jmc 1.1 elif [ "x$NETCDF_HOME" != x ]; then
87     INCLUDEDIRS="${NETCDF_HOME}/include"
88     INCLUDES="-I${NETCDF_HOME}/include"
89 jmc 1.3 LIBS="-L${NETCDF_ROOT}/lib64 -L${NETCDF_HOME}/lib"
90 jmc 1.1 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
91     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
92     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
93     INCLUDEDIRS="${NETCDF_INC}"
94     INCLUDES="-I${NETCDF_INC}"
95     LIBS="-L${NETCDF_LIB}"
96     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
97     INCLUDEDIRS="${NETCDF_INCDIR}"
98     INCLUDES="-I${NETCDF_INCDIR}"
99     LIBS="-L${NETCDF_LIBDIR}"
100     elif test -d /usr/include/netcdf-3 ; then
101     INCLUDEDIRS='/usr/include/netcdf-3'
102     INCLUDES='-I/usr/include/netcdf-3'
103 jmc 1.3 LIBS='-L/usr/lib64/netcdf-3 -L/usr/lib/netcdf-3'
104     elif test -d /usr/local/pkg/netcdf ; then
105     INCLUDEDIRS='/usr/local/pkg/netcdf/include'
106     INCLUDES='-I/usr/local/pkg/netcdf/include'
107     LIBS='-L/usr/local/pkg-x86_64/netcdf/lib64 -L/usr/local/pkg-x86_64/netcdf/lib -L/usr/local/pkg/netcdf/lib64 -L/usr/local/pkg/netcdf/lib'
108 jmc 1.1 elif test -d /usr/include/netcdf ; then
109     INCLUDEDIRS='/usr/include/netcdf'
110     INCLUDES='-I/usr/include/netcdf'
111     elif test -d /usr/local/netcdf ; then
112     INCLUDEDIRS='/usr/include/netcdf/include'
113     INCLUDES='-I/usr/local/netcdf/include'
114 jmc 1.3 LIBS='-L/usr/local/netcdf/lib64 -L/usr/local/netcdf/lib'
115     elif test -f /usr/local/include/netcdf.inc ; then
116 jmc 1.1 INCLUDEDIRS='/usr/local/include'
117     INCLUDES='-I/usr/local/include'
118 jmc 1.3 LIBS='-L/usr/local/lib64 -L/usr/local/lib'
119 jmc 1.1 fi
120    
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'

  ViewVC Help
Powered by ViewVC 1.1.22