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

Diff of /MITgcm/tools/build_options/linux_ia32_ifort

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

revision 1.16 by jmc, Sun Mar 21 17:58:17 2010 UTC revision 1.17 by jmc, Tue Sep 6 22:15:55 2011 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  #  
3  # $Header$  # $Header$
4  # $Name$  # $Name$
5    
6  #  Ed Hill  # Build options for the intel fortran compiler - version 9.0 (and earlier) -
7  #  #            on Linux IA32 platform
8  #  tested on faulks, 20030818  
9    #  tested on faulks (FC.6), with OpenMP, using:
10    #      (sh, bash):  source /usr/local/pkg/intel/intel_fc_90/bin/ifortvars.sh
11    #      (csh,tcsh):  source /usr/local/pkg/intel/intel_fc_90/bin/ifortvars.csh
12    #   [was also tested on hugo (FC.4, FC.9), eddy (FC.5)]
13    #  and on aces-grid cluster, with OpenMP, using:
14    #       module add ifc/9.0.021 icc/9.0.021 intel/9.0
15    #       module add netcdf/3.6.1/icc
16    
17    # MPI : Tested on aces-grid cluster, using:
18    #  a) default intel (v8.1) and default mpich/intel:
19    #       module add mpich/intel
20    #       module add netcdf/3.6.1/icc
21    #   e.g.(sh,bash):
22    #       export MPI_INC_DIR='/usr/local/pkg/mpich/mpich-intel/include'
23    #   (and run using: mpirun -machinefile my_list_of_nodes)
24  #  #
25  #  Build options for the intel 8.0 fortran compiler  #  b) intel v9.0 and mpich2-intel (+ OpenMPI or not) using, in this order:
26  #  the compiler is now called ifort (not ifc) and it appears to  #       module add ifc/9.0.021 icc/9.0.021 intel/9.0
27  #  need -DWORDLENGTH=1 and not -DWORDLENGTH=4 (which is what ifc 6.0) used to have.  #       module add mpich2/1.0.3/intel
28  #  ph: use ifort compiler options -convert big_endian -assume byterecl  #       module add netcdf/3.6.1/icc
29    #       module add mpiexec             (<-- to run with mpiexec)
30  FC=ifort  #   e.g.(sh,bash):
31  F90C=ifort  #       export MPI_INC_DIR='/usr/local/pkg/mpich2/mpich2-1.0.3/intel/include'
32  LINK='ifort -static'  #   (and run using mpiexec)
33    
34    # OpenMP : not working well with version earlier than v.9
35    #-------
36    # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
37    #    and generally, needs to increase the stack-size:
38    #   -  sh,bash:
39    #     > export OMP_NUM_THREADS=2
40    #     > export KMP_STACKSIZE=400m
41    #   - csh,tcsh:
42    #     > setenv OMP_NUM_THREADS 2
43    #     > setenv KMP_STACKSIZE 400m
44    #-------
45    
46    if test "x$MPI" = xtrue ; then
47      CC='mpicc'
48      FC='mpif77'
49      F90C=$FC
50     #F90C='mpif90'
51      LINK=$FC
52    else
53      CC='icc'
54      FC='ifort'
55      F90C=$FC
56      LINK="$FC -i-static"
57    fi
58    
59  DEFINES='-DWORDLENGTH=4'  DEFINES='-DWORDLENGTH=4'
60  CPP='cpp  -traditional -P'  CPP='cpp  -traditional -P'
61  F90FIXEDFORMAT='-fixed -Tf'  F90FIXEDFORMAT='-fixed -Tf'
62  EXTENDED_SRC_FLAG='-132'  EXTENDED_SRC_FLAG='-132'
63  #OMPFLAG='-openmp'  GET_FC_VERSION="--version"
64    OMPFLAG='-openmp'
65    
66  ###INCLUDES='-I/ocean/data4/ce107/netcdf-3.6.1/Linux-i686-intel8/include'  NOOPTFLAGS='-O0'
67  ###LIBS='-L/ocean/data4/ce107/netcdf-3.6.1/Linux-i686-intel8/lib -lnetcdf'  NOOPTFILES=''
68  INCLUDES='-I/usr/local/pkg/netcdf/include'  
69  LIBS='-L/usr/local/pkg/netcdf/lib -lnetcdf'  FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl"
70    #- might want to use '-r8' for fizhi pkg:
71  #  Note that the -mp switch is for ieee "maintain precision" and is  #FFLAGS="$FFLAGS -r8"
72  #  roughly equivalent to -ieee  
73  if test "x$IEEE" = x ; then  if test "x$IEEE" = x ; then     #- with optimisation:
     FOPTIM='-O3 -align'  
74      F90OPTIM='-O3'      F90OPTIM='-O3'
75        FOPTIM='-O3 -align'
76  #P3 FOPTIM=$FOPTIM' -tpp6 -xWKM'  #P3 FOPTIM=$FOPTIM' -tpp6 -xWKM'
77  #P4 FOPTIM=$FOPTIM' -tpp7 -xWKM'  #P4 FOPTIM=$FOPTIM' -tpp7 -xWKM'
     FFLAGS="$FFLAGS -w95 -W0 -WB -convert big_endian -assume byterecl"  
78  else  else
79        F90OPTIM='-O0'
80      if test "x$DEVEL" = x ; then  #- no optimisation + IEEE :
81       #  "-mp" is for ieee "maintain precision"
82      FOPTIM='-O0 -noalign'      FOPTIM='-O0 -noalign'
83      F90OPTIM='-O0 -g'     #FFLAGS="$FFLAGS -mp"
84      FFLAGS="$FFLAGS -w95 -W0 -WB -xN -pc64 -convert big_endian -assume byterecl"    else                          #- development/check options:
85     #FFLAGS="$FFLAGS -mp -w95 -W0 -WB"     #FOPTIM='-O0 -noalign -CB -CU -CV'
86        FOPTIM='-O0 -noalign -check all'
87        FFLAGS="$FFLAGS -xN -pc64"
88        NOOPTFILES='mds_byteswapr8.F mds_byteswapr4.F mds_byteswapi4.F'
89        NOOPTFILES=$NOOPTFILES' mitcplr_char2real.F mitcplr_real2char.F'
90        NOOPTFILES=$NOOPTFILES' mitcplr_char2int.F mitcplr_int2char.F mds_byteswap.F'
91      fi
92  fi  fi
 #- might want to use '-r8' for fizhi pkg:  
 #FFLAGS="$FFLAGS -r8"  
93    
94  F90FLAGS=$FFLAGS  F90FLAGS=$FFLAGS
95    #F90OPTIM=$FOPTIM
96    
97    INCLUDEDIRS=''
98    INCLUDES=''
99    LIBS=''
100    
101    if [ "x$NETCDF_ROOT" != x ] ; then
102        INCLUDEDIR="${NETCDF_ROOT}/include"
103        INCLUDES="-I${NETCDF_ROOT}/include"
104        LIBDIR="${NETCDF_ROOT}/lib"
105        LIBS="-L${NETCDF_ROOT}/lib"
106    elif [ "x$NETCDF_HOME" != x ]; then
107        INCLUDEDIR="${NETCDF_HOME}/include"
108        INCLUDES="-I${NETCDF_HOME}/include"
109        LIBDIR="${NETCDF_HOME}/lib"
110        LIBS="-L${NETCDF_HOME}/lib"
111    elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
112        NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
113        NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
114        INCLUDEDIR="${NETCDF_INC}"
115        INCLUDES="-I${NETCDF_INC}"
116        LIBDIR="${NETCDF_LIB}"
117        LIBS="-L${NETCDF_LIB}"
118    elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
119        INCLUDEDIR="${NETCDF_INCDIR}"
120        INCLUDES="-I${NETCDF_INCDIR}"
121        LIBDIR="${NETCDF_LIBDIR}"
122        LIBS="-L${NETCDF_LIBDIR}"
123    elif test -d /usr/include/netcdf-3 ; then
124        INCLUDES='-I/usr/include/netcdf-3'
125        LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
126    elif test -d /usr/include/netcdf ; then
127        INCLUDES='-I/usr/include/netcdf'
128    elif test -d /usr/local/netcdf ; then
129        INCLUDES='-I/usr/local/netcdf/include'
130        LIBS='-L/usr/local/netcdf/lib'
131    elif test -d /usr/local/include/netcdf.inc ; then
132        INCLUDES='-I/usr/local/include'
133        LIBS='-L/usr/local/lib64'
134    fi
135    
136    if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
137        INCLUDES="$INCLUDES -I$MPI_INC_DIR"
138        INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
139    #   MPIINCLUDEDIR="$MPI_INC_DIR"
140    #   MPI_HEADER_FILES='mpif.h mpiof.h'
141    #   MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
142    fi

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.22