1 |
#!/bin/bash |
2 |
# |
3 |
# $Header: /u/gcmpack/MITgcm/tools/build_options/linux_ia64_cray_ollie,v 1.4 2016/06/02 08:57:20 mlosch Exp $ |
4 |
# $Name: $ |
5 |
|
6 |
# Tested on cray CS400 ollie.awi.de |
7 |
# <https://swrepo1.awi.de/plugins/mediawiki/wiki/hpc/index.php/Main_Page> |
8 |
# module load craype-broadwell |
9 |
# module load PrgEnv-cray |
10 |
# module swap mvapich2_cce cray-impi |
11 |
# module load intel/impi-5.1.3 |
12 |
|
13 |
FC='ftn' |
14 |
CC='cc' |
15 |
|
16 |
FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X ## _" |
17 |
DEFINES='-DWORDLENGTH=4 ' |
18 |
CPP='cpp -traditional -P' |
19 |
EXTENDED_SRC_FLAG='-Mextend' |
20 |
OMPFLAG='-homp' |
21 |
GET_FC_VERSION="-V" |
22 |
RMFILES='*.lst' |
23 |
|
24 |
NOOPTFLAGS="-O1" |
25 |
NOOPTFILES='' |
26 |
|
27 |
FFLAGS="$FFLAGS -h byteswapio" |
28 |
if test "$OMP" = true ; then |
29 |
# for some reason this solves a problem with an unexpected |
30 |
# "expectStatus=20" when using OpenMP with hyperthreads |
31 |
NOOPTFILES="${NOOPTFILES} diagnostics_switch_onoff.F mon_init.F mon_set_iounit.F" |
32 |
else |
33 |
FFLAGS="$FFLAGS -hnoomp" |
34 |
fi |
35 |
# source file listing with compiler messages: |
36 |
#FFLAGS="$FFLAGS -rm" |
37 |
#FFLAGS="$FFLAGS -Wl,--whole-archive,-lhugetlbfs,--no-whole-archive -Wl,-Ttext-segment=0x20000000,-zmax-page-size=0x20000000 " |
38 |
|
39 |
if test "x$IEEE" = x ; then #- with optimisation: |
40 |
# this is the default |
41 |
# FOPTIM='-O2' |
42 |
# more aggressive |
43 |
FOPTIM="-O ipa3 -hfp3 -O3 " |
44 |
else |
45 |
NOOPTFLAGS="-O0" |
46 |
if test "x$DEVEL" = x ; then #- no optimisation + IEEE : |
47 |
FOPTIM="-O0 -hfp0" |
48 |
# -fltconsistency |
49 |
else #- development/check options: |
50 |
FOPTIM="-O0 -hfp0" |
51 |
FOPTIM="$FOPTIM -g -hfp0 -Rbc" |
52 |
# -r[list_ opt] produces a source listing file *.lst, -rm produces a |
53 |
# listing with loopmark information and much more, not needed |
54 |
# for simple tests |
55 |
# -hmsgs -hnegmsgs writes a lot of optimisation messages to stderr |
56 |
#FOPTIM="$FOPTIM -rm -hmsgs -hnegmsgs" |
57 |
fi |
58 |
fi |
59 |
|
60 |
F90FLAGS=$FFLAGS |
61 |
F90OPTIM=$FOPTIM |
62 |
CFLAGS="-O0 $MCMODEL" |
63 |
|
64 |
# after "module load intel/impi-5.1.3", I_MPI_ROOT should be available |
65 |
#MPI_INC_DIR=" -I/opt/cray/mvapich2_cce/1.9/CRAY/83/include" |
66 |
#MPI_INC_DIR="-I${INCLUDE_PATH_X86_64}" |
67 |
MPI_INC_DIR=${I_MPI_ROOT}/include64 |
68 |
if test -n ${MPI_INC_DIR} ; then |
69 |
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
70 |
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
71 |
#- used for parallel (MPI) DIVA |
72 |
# MPIINCLUDEDIR="$MPI_INC_DIR" |
73 |
# MPI_HEADER_FILES='mpif.h mpiof.h' |
74 |
fi |