-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.levante.gcc
executable file
·127 lines (102 loc) · 2.92 KB
/
configure.levante.gcc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#! /bin/bash
#
set -eu
set -o history
#_______________________________________________________________________________
#
function banner {
typeset line
line=______________________________________________________________________
echo
echo $line
echo
echo "$*"
echo $line
echo
}
#_______________________________________________________________________________
#
banner "Configuration for levante.dkrz.de with GCC - GCC 6 or newer is required."
#_______________________________________________________________________________
#
this_script=${0}
extpar_dir=$(cd ${this_script%/*} && pwd)
#_______________________________________________________________________________
#
banner "Define system specific environment"
source $MODULESHOME/init/bash
module purge
module load git
module load python3/2022.01-gcc-11.2.0
module load cdo/2.0.5-gcc-11.2.0
module load gcc/11.2.0-gcc-11.2.0
SWROOT="/sw/spack-levante"
CC=gcc
CPPFLAGS=""
CFLAGS="-Wall -pedantic -O3 -g"
FC=gfortran
FCFLAGS="-cpp -Wall -pedantic -fbacktrace -O3 -g -fopenmp -ffree-line-length-256"
LDFLAGS=""
LIBS=""
BUILD_LIBS="-L${SWROOT}/hdf5-1.12.1-kxfaux/lib -lhdf5_hl -lhdf5"
EXTRA_CONFIG_ARGS="--enable-rpaths "
EXTRA_CONFIG_ARGS+="--enable-openmp "
EXTRA_CONFIG_ARGS+="--with-netcdf-fortran=${SWROOT}/netcdf-fortran-4.5.3-jlxcfz "
EXTRA_CONFIG_ARGS+="--with-netcdf=${SWROOT}/netcdf-c-4.8.1-6qheqr "
EXTRA_CONFIG_ARGS+="--with-cdi=bundled"
#_______________________________________________________________________________
#
gcc_version=$(gcc --version | awk 'NR==1{print $3}')
gfortran_version=$(gfortran --version | awk 'NR==1{print $4}')
echo "Software tree installation ${SWROOT}"
echo
echo "C compiler : ${gcc_version}"
echo "C compiler flags : ${CFLAGS}"
echo "C preprocessor flags : ${CPPFLAGS}"
echo
echo "Fortran compiler : ${gfortran_version}"
echo "Fortran compiler flags: ${FCFLAGS}"
echo
echo "Configureflags:"
for extra_arg in ${EXTRA_CONFIG_ARGS}
do
echo " $extra_arg"
done
#_______________________________________________________________________________
#
banner "Configure ..."
"${extpar_dir}/configure" \
CC="${CC}" \
CFLAGS="${CFLAGS}" \
CPPFLAGS="${CPPFLAGS}" \
FC="${FC}" \
FCFLAGS="${FCFLAGS}" \
LDFLAGS="${LDFLAGS}" \
LIBS="${LIBS}" \
BUILD_LIBS="${BUILD_LIBS}" \
${EXTRA_CONFIG_ARGS} \
"$@"
banner "Run make ..."
echo "Modules used during configuration"
echo
if [[ -e modules.env ]]
then
rm -f modules.env
fi
while read module_command
do
echo " ${module_command}"
echo "${module_command}" >> modules.env
done < <(history | awk '/^[ ]*[0-9]+[ ]+module/{$1=""; print $0}')
echo
echo "To be compatible with the configure environment run:"
echo
echo "source modules.env"
echo
echo "in your terminal, where the make command will be run."
echo
#_______________________________________________________________________________
#
exit
#_______________________________________________________________________________
#