/[MITgcm]/MITgcm/tools/build_options/linux_amd64_pathf90+mpi
ViewVC logotype

Contents of /MITgcm/tools/build_options/linux_amd64_pathf90+mpi

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


Revision 1.3 - (show annotations) (download)
Fri Aug 19 22:54:04 2011 UTC (12 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
merge linux_amd64_pathf90+mpi into linux_amd64_pathf90
 (allows an MPI built using "genmake2 -mpi")

1 #! /usr/bin/env bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_pathf90+mpi,v 1.2 2011/08/18 22:04:49 jmc Exp $
4 # $Name: $
5 #
6 # Build options for PathScale (EKOPATH) Compiler on Linux x86-64
7 # tested with PathScale version 4.0.10 on acesgrid (Linux 2.6.38.8-35.fc15.x86_64),
8 # using:
9 # module load ekopath
10 # and with mpich1:
11 # module load mvapich1
12 # or with mpich2:
13 # module load mvapich2
14 # or with openmpi
15 # module load openmpi
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 PSC_OMP_STACK_SIZE=400m
23 # - csh,tcsh:
24 # > setenv OMP_NUM_THREADS 2
25 # > setenv PSC_OMP_STACK_SIZE 400m
26 #-------
27
28 CC=mpicc
29 FC=mpif90
30 LINK=mpif90
31
32 DEFINES='-DWORDLENGTH=4'
33 CPP='cpp -traditional -P'
34 EXTENDED_SRC_FLAG='-extend-source'
35 GET_FC_VERSION="--version"
36 OMPFLAG='-openmp'
37 #OMPFLAG='-openmp -OPT:early_mp=ON'
38
39 NOOPTFLAGS='-O0 -g'
40 NOOPTFILES=''
41
42 FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian"
43 #- might want to use '-r8' for fizhi pkg:
44 #FFLAGS="$FFLAGS -r8"
45
46 if test "x$IEEE" = x ; then #- with optimisation:
47 #- full optimisation, trips over MITgcm code because of compiler problems:
48 #FOPTIM='-Ofast -LNO:fusion=2 -funsafe-math-optimizations'
49 #- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2:
50 FOPTIM='-O3 -LNO:fusion=2 -funsafe-math-optimizations'
51 else
52 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
53 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
54 else #- development/check options:
55 FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
56 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
57 fi
58 fi
59
60 F90FLAGS=$FFLAGS
61 F90OPTIM=$FOPTIM
62 CFLAGS='-O0 -m64 -fPIC'
63 GSLLIB='-lgsl -lgslcblas'
64
65 INCLUDEDIRS=''
66 INCLUDES=''
67 LIBS=''
68
69 if [ "x$NETCDF_ROOT" != x ] ; then
70 INCLUDEDIR="${NETCDF_ROOT}/include"
71 INCLUDES="-I${NETCDF_ROOT}/include"
72 LIBDIR="${NETCDF_ROOT}/lib"
73 LIBS="-L${NETCDF_ROOT}/lib"
74 elif [ "x$NETCDF_HOME" != x ]; then
75 INCLUDEDIR="${NETCDF_HOME}/include"
76 INCLUDES="-I${NETCDF_HOME}/include"
77 LIBDIR="${NETCDF_HOME}/lib"
78 LIBS="-L${NETCDF_HOME}/lib"
79 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
80 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
81 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
82 INCLUDEDIR="${NETCDF_INC}"
83 INCLUDES="-I${NETCDF_INC}"
84 LIBDIR="${NETCDF_LIB}"
85 LIBS="-L${NETCDF_LIB}"
86 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
87 INCLUDEDIR="${NETCDF_INCDIR}"
88 INCLUDES="-I${NETCDF_INCDIR}"
89 LIBDIR="${NETCDF_LIBDIR}"
90 LIBS="-L${NETCDF_LIBDIR}"
91 elif test -d /usr/include/netcdf-3 ; then
92 INCLUDES='-I/usr/include/netcdf-3'
93 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
94 elif test -d /usr/include/netcdf ; then
95 INCLUDES='-I/usr/include/netcdf'
96 elif test -d /usr/local/netcdf ; then
97 INCLUDES='-I/usr/local/netcdf/include'
98 LIBS='-L/usr/local/netcdf/lib'
99 elif test -d /usr/local/include/netcdf.inc ; then
100 INCLUDES='-I/usr/local/include'
101 LIBS='-L/usr/local/lib64'
102 fi
103
104 if [ -n "$MPI_INC_DIR" ]; then
105 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
106 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
107 MPIINCLUDEDIR="$MPI_INC_DIR"
108 MPI_HEADER_FILES='mpif.h mpiof.h'
109 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
110 fi

  ViewVC Help
Powered by ViewVC 1.1.22