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

Annotation of /MITgcm/tools/build_options/linux_amd64_open64

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


Revision 1.4 - (hide annotations) (download)
Fri Aug 19 22:48:06 2011 UTC (12 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63b, checkpoint63c
Changes since 1.3: +30 -4 lines
modify to also support MPI built (using "genmake2 -mpi")

1 ce107 1.1 #!/bin/bash
2     #
3 jmc 1.4 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_open64,v 1.3 2011/08/18 22:04:49 jmc Exp $
4 ce107 1.1 # $Name: $
5     #
6 jmc 1.2 # Build options for Open64 Compiler on Linux x86-64
7     # first version tested on Fedore Core 4 x86-64 Opteron (Linux batsi)
8     # updated and tested on acesgrid (Fedora Core 15), using:
9     # module load open64 (Version 4.2.4)
10 jmc 1.4 # Also tested with MPI on acesgrid, using:
11     # module load open64 (Version 4.2.4)
12     # and with mpich1:
13     # module load mvapich
14     # or with mpich2:
15     # module load mvapich2
16     # or with openmpi: <== not yet tested
17     # module load openmpi
18 jmc 1.2
19     #-------
20     # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
21     # and generally, needs to increase the thread stack-size:
22     # - sh,bash:
23     # > export OMP_NUM_THREADS=2
24     # > export OMP_SLAVE_STACK_SIZE=400m
25     # - csh,tcsh:
26     # > setenv OMP_NUM_THREADS 2
27     # > setenv OMP_SLAVE_STACK_SIZE 400m
28     #-------
29 ce107 1.1
30 jmc 1.4 if test "x$MPI" = xtrue ; then
31     CC=mpicc
32     FC=mpif90
33     LINK=mpif90
34     else
35     CC=opencc
36     FC=openf90
37     LINK=openf90
38     fi
39 jmc 1.2
40 ce107 1.1 DEFINES='-DWORDLENGTH=4'
41     CPP='cpp -traditional -P'
42 jmc 1.2 EXTENDED_SRC_FLAG='-extend-source'
43     GET_FC_VERSION="--version"
44     OMPFLAG='-openmp'
45     #OMPFLAG='-openmp -OPT:early_mp=ON'
46    
47     NOOPTFLAGS='-O0 -g'
48 ce107 1.1 NOOPTFILES=''
49    
50 jmc 1.2 FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian"
51     #- might want to use '-r8' for fizhi pkg:
52     #FFLAGS="$FFLAGS -r8"
53 ce107 1.1
54 jmc 1.2 if test "x$IEEE" = x ; then #- with optimisation:
55 jmc 1.3 #- full optimisation
56     # ("-Ofast" eqv "-O3 -ipa -OPT:Ofast -fno-math-errno -ffast-math" and "-OPT:Ofast"
57     # eqv to "-OPT:roundoff=2 -OPT:Olimit=0 -OPT:div_split=ON -OPT:alias=typed")
58     FOPTIM='-Ofast -LNO:fusion=2 -OPT:roundoff=1:IEEE_arithmetic=3'
59     #- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2:
60     #FOPTIM='-O3 -LNO:fusion=2 -OPT:roundoff=1:IEEE_arithmetic=3'
61 ce107 1.1 else
62 jmc 1.2 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
63     FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
64     else #- development/check options:
65     FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
66     FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
67     fi
68 ce107 1.1 fi
69    
70     F90FLAGS=$FFLAGS
71     F90OPTIM=$FOPTIM
72 jmc 1.2 CFLAGS='-O0 -m64 -fPIC'
73 ce107 1.1 GSLLIB='-lgsl -lgslcblas'
74    
75 jmc 1.4 INCLUDEDIRS=''
76     INCLUDES=''
77     LIBS=''
78    
79 ce107 1.1 if [ "x$NETCDF_ROOT" != x ] ; then
80     INCLUDEDIR="${NETCDF_ROOT}/include"
81     INCLUDES="-I${NETCDF_ROOT}/include"
82     LIBDIR="${NETCDF_ROOT}/lib"
83     LIBS="-L${NETCDF_ROOT}/lib"
84     elif [ "x$NETCDF_HOME" != x ]; then
85     INCLUDEDIR="${NETCDF_HOME}/include"
86     INCLUDES="-I${NETCDF_HOME}/include"
87     LIBDIR="${NETCDF_HOME}/lib"
88     LIBS="-L${NETCDF_HOME}/lib"
89     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
90     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
91     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
92     INCLUDEDIR="${NETCDF_INC}"
93     INCLUDES="-I${NETCDF_INC}"
94     LIBDIR="${NETCDF_LIB}"
95     LIBS="-L${NETCDF_LIB}"
96     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
97     INCLUDEDIR="${NETCDF_INCDIR}"
98     INCLUDES="-I${NETCDF_INCDIR}"
99     LIBDIR="${NETCDF_LIBDIR}"
100     LIBS="-L${NETCDF_LIBDIR}"
101     elif test -d /usr/include/netcdf-3 ; then
102     INCLUDES='-I/usr/include/netcdf-3'
103     LIBS='-L/usr/lib64/netcdf-3 -lnetcdf_g77'
104     elif test -d /usr/include/netcdf ; then
105     INCLUDES='-I/usr/include/netcdf'
106     elif test -d /usr/local/netcdf ; then
107     INCLUDES='-I/usr/local/netcdf/include'
108     LIBS='-L/usr/local/netcdf/lib'
109     elif test -d /usr/local/include/netcdf.inc ; then
110     INCLUDES='-I/usr/local/include'
111     LIBS='-L/usr/local/lib64'
112     fi
113    
114 jmc 1.4 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
115     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
116     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
117     MPIINCLUDEDIR="$MPI_INC_DIR"
118     MPI_HEADER_FILES='mpif.h mpiof.h'
119     MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
120     fi
121    

  ViewVC Help
Powered by ViewVC 1.1.22