/[MITgcm]/MITgcm/tools/build_options/linux_amd64_gfortran+mpi_generic
ViewVC logotype

Contents of /MITgcm/tools/build_options/linux_amd64_gfortran+mpi_generic

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


Revision 1.2 - (show annotations) (download)
Sat Dec 25 18:25:56 2010 UTC (13 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint63a, checkpoint63
Changes since 1.1: +31 -13 lines
add -fPIC ; add comments on how to use it on baudelaire

1 #!/bin/bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_gfortran+mpi_generic,v 1.1 2010/02/16 23:56:02 jmc Exp $
4 # $Name: $
5 #
6
7 # Tested with gcc-gfortran v4.1.x on FC5, FC6, FC8, using flags
8 # formally for gcc-gfortran 4.3*
9 # + with gcc-gfortran v4.3.x on FC9, FC10
10 # + with gcc-gfortran v4.4.x on FC11,FC12,FC13
11 #
12 # on baudelaire.csail.mit.edu (FC13), uses:
13 # export MPI_GCC_DIR=/srv/software/gcc/gcc-packages/gcc-4.4.5/mpich2/mpich2-1.3
14 # export MPI_INC_DIR=$MPI_GCC_DIR/include
15 # export PATH=$MPI_GCC_DIR/bin:$PATH
16 #
17 #-------
18 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
19 # and generally, needs to increase the thread stack-size:
20 # - sh,bash:
21 # > export OMP_NUM_THREADS=2
22 # > export GOMP_STACKSIZE=400m
23 # - csh,tcsh:
24 # > setenv OMP_NUM_THREADS 2
25 # > setenv GOMP_STACKSIZE 400m
26 #-------
27
28 FC=${FC:=mpif77}
29 F90C=${F90C:=mpif90}
30 CC=${CC:=mpicc}
31
32 DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
33 CPP='cpp -traditional -P'
34 EXTENDED_SRC_FLAG='-ffixed-line-length-132'
35 GET_FC_VERSION="--version"
36 OMPFLAG='-fopenmp'
37
38 NOOPTFLAGS='-O0'
39 NOOPTFILES=''
40
41 INCLUDEDIRS=''
42 INCLUDES=''
43 LIBS=''
44
45 if test "x$DEVEL" != x ; then
46 FFLAGS='-g -Wall -W -ffpe-trap=invalid,zero,overflow -fbounds-check'
47 else
48 FFLAGS=''
49 fi
50
51 # Requires gfortran from 2006 onwards for -fconvert=big-endian
52 FFLAGS="$FFLAGS -fconvert=big-endian -fimplicit-none"
53 # for big objects:
54 FFLAGS="$FFLAGS -fPIC"
55
56 if test "x$IEEE" = x ; then
57 # No need for IEEE-754
58 FOPTIM='-O3 -funroll-loops'
59 CFLAGS="$FOPTIM -fPIC"
60 else
61 # Try to follow IEEE-754
62 FFLAGS="$FFLAGS -Waliasing -Wampersand -Wsurprising -Wline-truncation"
63 FOPTIM='-O0'
64 CFLAGS="$FOPTIM -fPIC"
65 # to get plenty of warnings :
66 # FFLAGS="$FFLAGS -Wconversion -Wimplicit-interface -Wunused-labels"
67 # more checking (to use with testreport, put DEVEL option in IEEE section):
68 # FOPTIM="$FOPTIM -g -ffpe-trap=invalid,zero,overflow -fbounds-check"
69 fi
70 F90FLAGS=$FFLAGS
71 F90OPTIM=$FOPTIM
72
73 if [ "x$NETCDF_ROOT" != x ] ; then
74 INCLUDEDIR="${NETCDF_ROOT}/include"
75 INCLUDES="-I${NETCDF_ROOT}/include"
76 LIBDIR="${NETCDF_ROOT}/lib"
77 LIBS="-L${NETCDF_ROOT}/lib"
78 elif [ "x$NETCDF_HOME" != x ]; then
79 INCLUDEDIR="${NETCDF_HOME}/include"
80 INCLUDES="-I${NETCDF_HOME}/include"
81 LIBDIR="${NETCDF_HOME}/lib"
82 LIBS="-L${NETCDF_HOME}/lib"
83 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
84 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
85 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
86 INCLUDEDIR="${NETCDF_INC}"
87 INCLUDES="-I${NETCDF_INC}"
88 LIBDIR="${NETCDF_LIB}"
89 LIBS="-L${NETCDF_LIB}"
90 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
91 INCLUDEDIR="${NETCDF_INCDIR}"
92 INCLUDES="-I${NETCDF_INCDIR}"
93 LIBDIR="${NETCDF_LIBDIR}"
94 LIBS="-L${NETCDF_LIBDIR}"
95 elif test -d /usr/include/netcdf-3 ; then
96 INCLUDES='-I/usr/include/netcdf-3'
97 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
98 elif test -d /usr/include/netcdf ; then
99 INCLUDES='-I/usr/include/netcdf'
100 elif test -d /usr/local/netcdf ; then
101 INCLUDES='-I/usr/local/netcdf/include'
102 LIBS='-L/usr/local/netcdf/lib'
103 elif test -d /usr/local/include/netcdf.inc ; then
104 INCLUDES='-I/usr/local/include'
105 LIBS='-L/usr/local/lib64'
106 fi
107
108 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
109 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
110 MPIINCLUDEDIR="$MPI_INC_DIR"
111 MPI_HEADER_FILES='mpif.h mpiof.h'
112 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'

  ViewVC Help
Powered by ViewVC 1.1.22