-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path200-build-heffte
executable file
·69 lines (60 loc) · 1.62 KB
/
200-build-heffte
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
#!/bin/bash -l
#
# IPPL Toolchain Build recipe for Heffte
#
#
P=heffte
V_MAJOR=2
V_MINOR=3
V=${V_MAJOR}.${V_MINOR}.0
V='master'
backend=${backend:-stock}
build_type=${build_type:-$backend}
NJOBS=8
trap "itb_exit" EXIT
mkdir -p "${ITB_SRC_DIR}/$P" && cd "$_" || exit "${ITB_ARG_ERR}"
if [ ! -d $P-$V ]; then
if [ "$V" = "master" ]; then
echo "git clone in $PWD"
git clone https://github.com/icl-utk-edu/heffte.git $P-$V
git checkout f7e72ad
else
echo "get tarfile"
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="https://github.com/icl-utk-edu/heffte/archive/refs/tags/v$V.tar.gz"
SRC_FILE="${ITB_DOWNLOAD_DIR}/${FNAME}"
# download
curl -L \
--output "${SRC_FILE}" \
"${DOWNLOAD_URL}"
tar xvf "${SRC_FILE}"
fi
else
echo "Found existing installation"
fi
cd "$OLDPWD" || exit "${ITB_ARG_ERR}"
CUFFT=${CUFFT:-OFF}
FFTW=${FFTW:-OFF}
MKL=${MKL:-OFF}
if [[ "$backend" == "cufft" || "$build_type" == "cuda" ]]; then
CUFFT=ON
elif [[ "$backend" == "fftw" ]]; then
FFTW=ON
elif [[ "$backend" == "mkl" ]]; then
MKL=ON
fi
mkdir -p "${ITB_SRC_DIR}"/$P/"build_${build_type}" && cd "$_" || exit "${ITB_ARG_ERR}"
cmake \
-DCMAKE_INSTALL_PREFIX="${ITB_PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DHeffte_ENABLE_FFTW="${FFTW}" \
-DFFTW_ROOT="${FFTW_DIR}" \
-DHeffte_ENABLE_CUDA="${CUFFT}" \
-DCUDA_TOOLKIT_ROOT_DIR="${CUDA_DIR}" \
-DHeffte_ENABLE_MKL="${MKL}" \
-DMKL_ROOT="${MKL_DIR}" \
"${ITB_SRC_DIR}"/$P/$P-$V || exit "${ITB_ERR_CONFIGURE}"
# compile & install
make -j ${NJOBS}
make install