/[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.5 - (show annotations) (download)
Thu Sep 29 16:08:14 2011 UTC (12 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
move to unsupported/ (has been merged into linux_amd64_gfortran)

1 #!/bin/bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_gfortran+mpi_generic,v 1.4 2011/08/21 17:34:15 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 NOOPTFILES="$NOOPTFILES ini_masks_etc.F"
60 CFLAGS="$FOPTIM -fPIC"
61 else
62 # Try to follow IEEE-754
63 FFLAGS="$FFLAGS -Waliasing -Wampersand -Wsurprising -Wline-truncation"
64 FOPTIM='-O0'
65 CFLAGS="$FOPTIM -fPIC"
66 # to get plenty of warnings :
67 # FFLAGS="$FFLAGS -Wconversion -Wimplicit-interface -Wunused-labels"
68 # more checking (to use with testreport, put DEVEL option in IEEE section):
69 # FOPTIM="$FOPTIM -g -ffpe-trap=invalid,zero,overflow -fbounds-check"
70 fi
71 F90FLAGS=$FFLAGS
72 F90OPTIM=$FOPTIM
73
74 if [ "x$NETCDF_ROOT" != x ] ; then
75 INCLUDEDIR="${NETCDF_ROOT}/include"
76 INCLUDES="-I${NETCDF_ROOT}/include"
77 LIBDIR="${NETCDF_ROOT}/lib"
78 LIBS="-L${NETCDF_ROOT}/lib"
79 elif [ "x$NETCDF_HOME" != x ]; then
80 INCLUDEDIR="${NETCDF_HOME}/include"
81 INCLUDES="-I${NETCDF_HOME}/include"
82 LIBDIR="${NETCDF_HOME}/lib"
83 LIBS="-L${NETCDF_HOME}/lib"
84 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
85 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
86 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
87 INCLUDEDIR="${NETCDF_INC}"
88 INCLUDES="-I${NETCDF_INC}"
89 LIBDIR="${NETCDF_LIB}"
90 LIBS="-L${NETCDF_LIB}"
91 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
92 INCLUDEDIR="${NETCDF_INCDIR}"
93 INCLUDES="-I${NETCDF_INCDIR}"
94 LIBDIR="${NETCDF_LIBDIR}"
95 LIBS="-L${NETCDF_LIBDIR}"
96 elif test -d /usr/include/netcdf-3 ; then
97 INCLUDES='-I/usr/include/netcdf-3'
98 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
99 elif test -d /usr/include/netcdf ; then
100 INCLUDES='-I/usr/include/netcdf'
101 elif test -d /usr/local/netcdf ; then
102 INCLUDES='-I/usr/local/netcdf/include'
103 LIBS='-L/usr/local/netcdf/lib'
104 elif test -d /usr/local/include/netcdf.inc ; then
105 INCLUDES='-I/usr/local/include'
106 LIBS='-L/usr/local/lib64'
107 fi
108
109 if [ -n "$MPI_INC_DIR" ]; then
110 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
111 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
112 MPIINCLUDEDIR="$MPI_INC_DIR"
113 MPI_HEADER_FILES='mpif.h mpiof.h'
114 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
115 fi

  ViewVC Help
Powered by ViewVC 1.1.22