-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare.sh
More file actions
44 lines (38 loc) · 1.2 KB
/
Copy pathprepare.sh
File metadata and controls
44 lines (38 loc) · 1.2 KB
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
CURRENT_DIR=$(pwd)
export SPACK_PATH=${CURRENT_DIR}/spack-1.2.0/
set -e
if [ -d "${SPACK_PATH}" ]; then
echo "It is recommended to remove any old spack installation ${SPACK_PATH} before running this script."
echo "${SPACK_PATH} detected, continue anyway? [YyNn]"
read ignore_existing
if [[ $ignore_existing == y* ]]; then
echo "Using existing ${SPACK_PATH}"
else
exit 1
fi
else
wget https://github.com/spack/spack/releases/download/v1.2.0/spack-1.2.0.tar.gz
tar -xf spack-1.2.0.tar.gz
rm spack-1.2.0.tar.gz
fi
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
. ${SPACK_PATH}/share/spack/setup-env.sh
spack compiler find
if [[ "$OSTYPE" == "darwin"* ]]; then
COMPILER='apple-clang@14:'
else
AVAILABLE_COMPILERS=$(spack compilers | grep "gcc@1[1-9]" || true)
if [ -z "${AVAILABLE_COMPILERS}" ]
then
echo "A gcc compiler with a version of at least 11 was not found. Installing compiler"
spack install gcc@11
spack load gcc@11
spack compiler find
spack unload gcc@11
fi
COMPILER='gcc@11:'
fi
spack env create ddc-env
spack env activate ddc-env
spack add ddc@0.15.0 +fft +splines +pdi +tests
spack install