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

Contents of /MITgcm/tools/build_options/linux_ia32_gfortran_generic_mpi

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


Revision 1.2 - (show annotations) (download)
Wed Jul 15 05:18:45 2009 UTC (14 years, 9 months ago) by ce107
Branch: MAIN
CVS Tags: checkpoint62c, checkpoint62b, checkpoint62a, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint62, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.1: +5 -4 lines
Fixed -openmp to -fopenmp to avoid embarassing outcome.

1 #!/bin/bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia32_gfortran_generic_mpi,v 1.1 2009/06/22 23:13:30 ce107 Exp $
4 # $Name: $
5 #
6 # Build options for the gfortran compiler with a generic MPI
7 #
8 # DON'T FORGET to set environment variable MPI_INC_DIR to the include
9 # directory of your MPI implementation
10 #
11 # It fixes the ' \' versus ' &' terminator problem ;
12 # some namelist problems remain with old version (The biggest seems
13 # to be the inability to support namelist syntax such as:
14 # fields(1,1) = 'UVELSLT ','VVELSLT ','WVELSLT ',
15 # which results in run-time errors).
16
17
18 FC=${FC:=mpif77 -m32}
19 F90C=${F90C:=mpif90 -m32}
20 CC=${CC:=mpicc -m32}
21
22 DEFINES='-DALLOW_USE_MPI -DALWAYS_USE_MPI -DWORDLENGTH=4 -DNML_TERMINATOR'
23 CPP='cpp -traditional -P'
24 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
25 OMPFLAG='-fopenmp'
26
27 NOOPTFLAGS='-O0'
28 NOOPTFILES=''
29
30 INCLUDEDIRS=''
31 INCLUDES=''
32 LIBS=''
33
34 if test "x$DEVEL" != x ; then
35 FFLAGS='-g -Wall -W -ffpe-trap=invalid,zero,overflow -fbounds-check'
36 else
37 FFLAGS=''
38 fi
39
40 # Requires gfortran from 2006 onwards for -fconvert=big-endian
41 FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
42 #- otherwise, switch to the home-made byte-swap:
43 #DEFINES="-D_BYTESWAPIO $DEFINES"
44
45 if test "x$IEEE" = x ; then
46 # No need for IEEE-754
47 FOPTIM='-O3 -funroll-loops'
48 else
49 # Try to follow IEEE-754
50 has_sse2=f
51 grep flags /proc/cpuinfo | grep sse2 > /dev/null 2>&1 && has_sse2=t
52 if test "x$has_sse2" = xt ; then
53 FOPTIM='-O0 -mfpmath=sse -msse -msse2'
54 else
55 FOPTIM='-O0 -ffloat-store'
56 fi
57 fi
58 # version 4.3.0 has problems with option "-malign-double" ;
59 # may want to put it back with older/newer version (when it works)
60 #FOPTIM="$FOPTIM -malign-double"
61 F90FLAGS=$FFLAGS
62 F90OPTIM=$FOPTIM
63 CFLAGS=$FOPTIM
64
65 if [ "x$NETCDF_ROOT" != x ] ; then
66 INCLUDEDIR="${NETCDF_ROOT}/include"
67 INCLUDES="-I${NETCDF_ROOT}/include"
68 LIBDIR="${NETCDF_ROOT}/lib"
69 LIBS="-L${NETCDF_ROOT}/lib"
70 elif [ "x$NETCDF_HOME" != x ]; then
71 INCLUDEDIR="${NETCDF_HOME}/include"
72 INCLUDES="-I${NETCDF_HOME}/include"
73 LIBDIR="${NETCDF_HOME}/lib"
74 LIBS="-L${NETCDF_HOME}/lib"
75 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
76 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
77 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
78 INCLUDEDIR="${NETCDF_INC}"
79 INCLUDES="-I${NETCDF_INC}"
80 LIBDIR="${NETCDF_LIB}"
81 LIBS="-L${NETCDF_LIB}"
82 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
83 INCLUDEDIR="${NETCDF_INCDIR}"
84 INCLUDES="-I${NETCDF_INCDIR}"
85 LIBDIR="${NETCDF_LIBDIR}"
86 LIBS="-L${NETCDF_LIBDIR}"
87 elif test -d /usr/include/netcdf-3 ; then
88 INCLUDES='-I/usr/include/netcdf-3'
89 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
90 elif test -d /usr/include/netcdf ; then
91 INCLUDES='-I/usr/include/netcdf'
92 elif test -d /usr/local/netcdf ; then
93 INCLUDES='-I/usr/local/netcdf/include'
94 LIBS='-L/usr/local/netcdf/lib'
95 elif test -d /usr/local/include/netcdf.inc ; then
96 INCLUDES='-I/usr/local/include'
97 LIBS='-L/usr/local/lib64'
98 fi
99
100 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
101 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
102 MPIINCLUDEDIR="$MPI_INC_DIR"
103 MPI_HEADER_FILES='mpif.h mpiof.h'
104 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'

  ViewVC Help
Powered by ViewVC 1.1.22