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

Contents of /MITgcm/tools/build_options/linux_amd64_open64

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


Revision 1.5 - (show annotations) (download)
Sun Apr 1 20:56:21 2012 UTC (12 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63l
Changes since 1.4: +4 -3 lines
replace "-Ofast" with "-O3 -OPT:Ofast -ffast-math" (=> do not use "-ipa").

1 #!/bin/bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_open64,v 1.4 2011/08/19 22:48:06 jmc Exp $
4 # $Name: $
5 #
6 # 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 # 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
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
30 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
40 DEFINES='-DWORDLENGTH=4'
41 CPP='cpp -traditional -P'
42 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 NOOPTFILES=''
49
50 FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian"
51 #- might want to use '-r8' for fizhi pkg:
52 #FFLAGS="$FFLAGS -r8"
53
54 if test "x$IEEE" = x ; then #- with optimisation:
55 #- 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 -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 #- high optimisation (-O3), might find Pb with few S/R; fully safe: switch to -O2:
61 #FOPTIM='-O3 -OPT:roundoff=1:IEEE_arithmetic=3 -LNO:fusion=2'
62 else
63 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
64 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
65 else #- development/check options:
66 FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
67 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
68 fi
69 fi
70
71 F90FLAGS=$FFLAGS
72 F90OPTIM=$FOPTIM
73 CFLAGS='-O0 -m64 -fPIC'
74 GSLLIB='-lgsl -lgslcblas'
75
76 INCLUDEDIRS=''
77 INCLUDES=''
78 LIBS=''
79
80 if [ "x$NETCDF_ROOT" != x ] ; then
81 INCLUDEDIR="${NETCDF_ROOT}/include"
82 INCLUDES="-I${NETCDF_ROOT}/include"
83 LIBDIR="${NETCDF_ROOT}/lib"
84 LIBS="-L${NETCDF_ROOT}/lib"
85 elif [ "x$NETCDF_HOME" != x ]; then
86 INCLUDEDIR="${NETCDF_HOME}/include"
87 INCLUDES="-I${NETCDF_HOME}/include"
88 LIBDIR="${NETCDF_HOME}/lib"
89 LIBS="-L${NETCDF_HOME}/lib"
90 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
91 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
92 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
93 INCLUDEDIR="${NETCDF_INC}"
94 INCLUDES="-I${NETCDF_INC}"
95 LIBDIR="${NETCDF_LIB}"
96 LIBS="-L${NETCDF_LIB}"
97 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
98 INCLUDEDIR="${NETCDF_INCDIR}"
99 INCLUDES="-I${NETCDF_INCDIR}"
100 LIBDIR="${NETCDF_LIBDIR}"
101 LIBS="-L${NETCDF_LIBDIR}"
102 elif test -d /usr/include/netcdf-3 ; then
103 INCLUDES='-I/usr/include/netcdf-3'
104 LIBS='-L/usr/lib64/netcdf-3 -lnetcdf_g77'
105 elif test -d /usr/include/netcdf ; then
106 INCLUDES='-I/usr/include/netcdf'
107 elif test -d /usr/local/netcdf ; then
108 INCLUDES='-I/usr/local/netcdf/include'
109 LIBS='-L/usr/local/netcdf/lib'
110 elif test -d /usr/local/include/netcdf.inc ; then
111 INCLUDES='-I/usr/local/include'
112 LIBS='-L/usr/local/lib64'
113 fi
114
115 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
116 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
117 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
118 MPIINCLUDEDIR="$MPI_INC_DIR"
119 MPI_HEADER_FILES='mpif.h mpiof.h'
120 MPI_HEADER_FILES_INC='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'
121 fi

  ViewVC Help
Powered by ViewVC 1.1.22