/[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.6 - (hide annotations) (download)
Fri Apr 13 14:57:33 2012 UTC (12 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint64
Changes since 1.5: +3 -1 lines
reduce optimisation for seaice_evp.F (was getting NaNs)

1 ce107 1.1 #!/bin/bash
2     #
3 jmc 1.6 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_open64,v 1.5 2012/04/01 20:56:21 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 jmc 1.5 #FOPTIM='-Ofast -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2'
59     FOPTIM='-O3 -OPT:Ofast:roundoff=1:IEEE_arithmetic=3 -ffast-math -LNO:fusion=2'
60 jmc 1.3 #- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2:
61 jmc 1.5 #FOPTIM='-O3 -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2'
62 jmc 1.6 NOOPTFLAGS='-O3 -OPT:roundoff=1:IEEE_arithmetic=2 -LNO:fusion=2'
63     NOOPTFILES='seaice_evp.F'
64 ce107 1.1 else
65 jmc 1.2 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
66     FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
67     else #- development/check options:
68     FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
69     FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
70     fi
71 ce107 1.1 fi
72    
73     F90FLAGS=$FFLAGS
74     F90OPTIM=$FOPTIM
75 jmc 1.2 CFLAGS='-O0 -m64 -fPIC'
76 ce107 1.1 GSLLIB='-lgsl -lgslcblas'
77    
78 jmc 1.4 INCLUDEDIRS=''
79     INCLUDES=''
80     LIBS=''
81    
82 ce107 1.1 if [ "x$NETCDF_ROOT" != x ] ; then
83     INCLUDEDIR="${NETCDF_ROOT}/include"
84     INCLUDES="-I${NETCDF_ROOT}/include"
85     LIBDIR="${NETCDF_ROOT}/lib"
86     LIBS="-L${NETCDF_ROOT}/lib"
87     elif [ "x$NETCDF_HOME" != x ]; then
88     INCLUDEDIR="${NETCDF_HOME}/include"
89     INCLUDES="-I${NETCDF_HOME}/include"
90     LIBDIR="${NETCDF_HOME}/lib"
91     LIBS="-L${NETCDF_HOME}/lib"
92     elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
93     NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
94     NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
95     INCLUDEDIR="${NETCDF_INC}"
96     INCLUDES="-I${NETCDF_INC}"
97     LIBDIR="${NETCDF_LIB}"
98     LIBS="-L${NETCDF_LIB}"
99     elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
100     INCLUDEDIR="${NETCDF_INCDIR}"
101     INCLUDES="-I${NETCDF_INCDIR}"
102     LIBDIR="${NETCDF_LIBDIR}"
103     LIBS="-L${NETCDF_LIBDIR}"
104     elif test -d /usr/include/netcdf-3 ; then
105     INCLUDES='-I/usr/include/netcdf-3'
106     LIBS='-L/usr/lib64/netcdf-3 -lnetcdf_g77'
107     elif test -d /usr/include/netcdf ; then
108     INCLUDES='-I/usr/include/netcdf'
109     elif test -d /usr/local/netcdf ; then
110     INCLUDES='-I/usr/local/netcdf/include'
111     LIBS='-L/usr/local/netcdf/lib'
112     elif test -d /usr/local/include/netcdf.inc ; then
113     INCLUDES='-I/usr/local/include'
114     LIBS='-L/usr/local/lib64'
115     fi
116    
117 jmc 1.4 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
118     INCLUDES="$INCLUDES -I$MPI_INC_DIR"
119     INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
120     MPIINCLUDEDIR="$MPI_INC_DIR"
121     MPI_HEADER_FILES='mpif.h mpiof.h'
122     MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
123     fi
124    

  ViewVC Help
Powered by ViewVC 1.1.22