/[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.2 - (show annotations) (download)
Wed Aug 17 14:53:19 2011 UTC (12 years, 9 months ago) by jmc
Branch: MAIN
Changes since 1.1: +35 -17 lines
more standard version to work on new acesgrid cluster: (remove MAKEDEPEND spec,
 add working OpenMP options, clean-up IEEE & DEVEL cases, add EXTENDED_SRC_FLAG
 and GET_FC_VERSION)

1 #!/bin/bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_open64,v 1.1 2007/11/26 19:18:46 ce107 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
11 #-------
12 # run with OpenMP: needs to set environment var. OMP_NUM_THREADS
13 # and generally, needs to increase the thread stack-size:
14 # - sh,bash:
15 # > export OMP_NUM_THREADS=2
16 # > export OMP_SLAVE_STACK_SIZE=400m
17 # - csh,tcsh:
18 # > setenv OMP_NUM_THREADS 2
19 # > setenv OMP_SLAVE_STACK_SIZE 400m
20 #-------
21
22 CC=opencc
23 FC=openf90
24 LINK=openf90
25
26 DEFINES='-DWORDLENGTH=4'
27 CPP='cpp -traditional -P'
28 EXTENDED_SRC_FLAG='-extend-source'
29 GET_FC_VERSION="--version"
30 OMPFLAG='-openmp'
31 #OMPFLAG='-openmp -OPT:early_mp=ON'
32
33 NOOPTFLAGS='-O0 -g'
34 NOOPTFILES=''
35
36 FFLAGS="$FFLAGS -m64 -fPIC -convert big_endian"
37 #- might want to use '-r8' for fizhi pkg:
38 #FFLAGS="$FFLAGS -r8"
39
40 if test "x$IEEE" = x ; then #- with optimisation:
41 FOPTIM='-O3 -LNO:fusion=2 -OPT:roundoff=1:IEEE_arithmetic=3' # -funsafe-math-optimizations'
42 else
43 if test "x$DEVEL" = x ; then #- no optimisation + IEEE :
44 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
45 else #- development/check options:
46 FFLAGS="$FFLAGS -ffortran-bounds-check -trapuv -g"
47 FOPTIM='-O0 -OPT:roundoff=0:IEEE_arithmetic=1 -fmath-errno -fno-fast-math'
48 fi
49 fi
50
51 F90FLAGS=$FFLAGS
52 F90OPTIM=$FOPTIM
53 CFLAGS='-O0 -m64 -fPIC'
54 GSLLIB='-lgsl -lgslcblas'
55
56 if [ "x$NETCDF_ROOT" != x ] ; then
57 INCLUDEDIR="${NETCDF_ROOT}/include"
58 INCLUDES="-I${NETCDF_ROOT}/include"
59 LIBDIR="${NETCDF_ROOT}/lib"
60 LIBS="-L${NETCDF_ROOT}/lib"
61 elif [ "x$NETCDF_HOME" != x ]; then
62 INCLUDEDIR="${NETCDF_HOME}/include"
63 INCLUDES="-I${NETCDF_HOME}/include"
64 LIBDIR="${NETCDF_HOME}/lib"
65 LIBS="-L${NETCDF_HOME}/lib"
66 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
67 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
68 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
69 INCLUDEDIR="${NETCDF_INC}"
70 INCLUDES="-I${NETCDF_INC}"
71 LIBDIR="${NETCDF_LIB}"
72 LIBS="-L${NETCDF_LIB}"
73 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
74 INCLUDEDIR="${NETCDF_INCDIR}"
75 INCLUDES="-I${NETCDF_INCDIR}"
76 LIBDIR="${NETCDF_LIBDIR}"
77 LIBS="-L${NETCDF_LIBDIR}"
78 elif test -d /usr/include/netcdf-3 ; then
79 INCLUDES='-I/usr/include/netcdf-3'
80 LIBS='-L/usr/lib64/netcdf-3 -lnetcdf_g77'
81 elif test -d /usr/include/netcdf ; then
82 INCLUDES='-I/usr/include/netcdf'
83 elif test -d /usr/local/netcdf ; then
84 INCLUDES='-I/usr/local/netcdf/include'
85 LIBS='-L/usr/local/netcdf/lib'
86 elif test -d /usr/local/include/netcdf.inc ; then
87 INCLUDES='-I/usr/local/include'
88 LIBS='-L/usr/local/lib64'
89 fi

  ViewVC Help
Powered by ViewVC 1.1.22