-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path00_compilations_parameters.sh
executable file
·181 lines (136 loc) · 4.51 KB
/
00_compilations_parameters.sh
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/bin/bash
#########################
# LOAD MODULES #
#########################
# module load pgi/17.9/64
# module load openmpi/pgi-19.9/4.0.3rc1/64
EMC_WITH="--with-emc"
if [[ $HOSTNAME == *"rhea"* ]]; then
module purge
module load gcc/4.8.5 openmpi/3.1.4
CUDA_WITH="--with-cuda=cuda8"
elif [[ $HOSTNAME == *"login"* ]] || [[ $HOSTNAME == *"batch"* ]]; then
module purge
module load xl spectrum-mpi cuda cmake boost
# NVIDIA Tesla V100
CUDA_WITH="--with-cuda=cuda8"
# Traverse and EMC that is compile with netcdf
elif [[ ( $HOSTNAME == *"traverse"* ) && ( $EMC_WITH == "--with-emc" ) ]]; then
module purge
module load anaconda3
module load gcc-toolset/10
module load openmpi/gcc/4.1.1/64
module load hdf5/gcc/1.10.6 netcdf/gcc/hdf5-1.10.6/4.7.3
module load cudatoolkit/11.1
# NVIDIA Tesla V100
CUDA_WITH="--with-cuda=cuda9"
# NETCDF SETUP
NETCDF_WITH="--with-netcdf"
NETCDF_INC="${NETCDFDIR}/include"
NETCDF_LIBS="-L${NETCDFDIR}/lib"
FCFLAGS="-lnetcdff ${FCFLAGS}"
# Only traverse
elif [[ $HOSTNAME == *"traverse"* ]]; then
module purge
module load anaconda3
module load openmpi/gcc
module load cudatoolkit
conda activate gf
# NVIDIA Tesla V100
CUDA_WITH="--with-cuda=cuda9"
elif [[ $HOSTNAME == *"tiger"* ]]; then
module purge
module load openmpi/gcc cudatoolkit/10.2
# NVIDIA P100
CUDA_WITH="--with-cuda=cuda8"
# DELLA and EMC that is compile with netcdf
elif [[ ( $HOSTNAME == *"della-gpu"* ) && ( $EMC_WITH == "--with-emc" ) ]]; then
module purge
#module load anaconda3/2021.11
module load gcc/8 openmpi/gcc/4.1.2 cudatoolkit/11.7
module load hdf5/gcc/1.10.6 netcdf/gcc/hdf5-1.10.6/4.7.4
# NVIDIA Ampere A100
CUDA_WITH="--with-cuda=cuda11"
# NETCDF SETUP
NETCDF_WITH="--with-netcdf"
NETCDF_INC="${NETCDFDIR}/include"
NETCDF_LIBS="-L${NETCDFDIR}/lib"
FCFLAGS="-lnetcdff ${FCFLAGS}"
elif [[ $HOSTNAME == *"della-gpu"* ]]; then
module purge
module load anaconda3/2021.11
conda activate gf
# NVIDIA A100E
CUDA_WITH="--with-cuda=cuda11"
else
echo "HOST: ${HOSTNAME} not recognized."
fi
#########################
# DIRECOTRIES INFOS #
#########################
ROOT_DIR=$(pwd)
PACKAGES="${ROOT_DIR}/packages"
PATH_CUDA=$(which nvcc)
ASDF_DIR="${PACKAGES}/asdf-library"
ADIOS_DIR="${PACKAGES}/adios"
HDF5_DIR="${PACKAGES}/hdf5"
#########################
# Green Function stuff #
#########################
export RECIPROCAL=True
export FORWARD_TEST=True
#########################
# Compilation variables #
#########################
# C/C++ compiler
CC=gcc
CXX=g++
MPICC=$(which mpicc)
# Fortran compiler
FC=gfortran
MPIFC=mpif90
# Compiler flags the CFLAG "-std=c++11" avoids the '''error: identifier "__ieee128" is undefined'''
# gfortran ifort effect
# ------------------------------------------------------
# -g -g Stores the code inside the binary
# -O0 -O0 Disables optimisation
# -fbacktrace -traceback More informative stack trace
# -Wall -warn all Enable all compile time warnings
# -fcheck=all -check all Enable run time checks
CFLAGS=""
#FCFLAGS="-g -O0 -fbacktrace -Wall -fcheck=all"
FCFLAGS="${FCFLAGS} -g -O0 -fbacktrace"
# CUDA (here CUDA 5 because my GPU cannot support more, poor boy)
CUDA_LIB="${PATH_CUDA/bin\/nvcc/lib64}"
# SPECFEM
SPECFEM_DIR="${ROOT_DIR}/specfem3d_globe"
SPECFEM_LINK="[email protected]:SPECFEM/specfem3d_globe.git"
SPECFEM_BRANCH="devel"
# HDF5
HDF5_LINK="https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.gz"
HDF5_DESTDIR="${HDF5_DIR}/build"
HDF5_FC="${HDF5_DESTDIR}/bin/h5pfc"
HDF5_CC="${HDF5_DESTDIR}/bin/h5pcc"
MPIFC_HDF5=$HDF5_FC
export PATH=$PATH:${HDF5_DESTDIR}/bin
# ASDF
ASDF_LINK="https://github.com/SeismicData/asdf-library.git"
ASDF_DESTDIR="${ASDF_DIR}/build"
ASDF_WITH="" #--with-asdf"
ASDF_LIBS="-L${ASDF_DESTDIR}/usr/local/lib64 -lasdf"
# ADIOS
ADIOS_VERSION="2"
ADIOS_BUILD="${PACKAGES}/adios-build"
ADIOS_INSTALL="${PACKAGES}/adios-install"
# ADIOS version specific things
if [ $ADIOS_VERSION == "2" ]
then
ADIOS_WITH="--with-adios2"
ADIOS_CONFIG="${ADIOS_INSTALL}/bin/adios2_config"
ADIOS_LINK="https://github.com/ornladios/ADIOS2.git"
else
ADIOS_WITH="--with-adios"
ADIOS_CONFIG="${ADIOS_INSTALL}/bin/adios_config"
ADIOS_LINK="http://users.nccs.gov/~pnorbert/adios-1.13.1.tar.gz"
fi
export PATH=$PATH:${ADIOS_INSTALL}/bin