forked from mitkof6/pyCGM2_docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_btkcore.sh
More file actions
40 lines (30 loc) · 838 Bytes
/
build_btkcore.sh
File metadata and controls
40 lines (30 loc) · 838 Bytes
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
#!/usr/bin/env bash
# build BTKCore from source
set -xeuo pipefail
# install dependencies in case they are missing
# sudo apt-get -y install git cmake swig python3-dev python3-pip
# pip3 install numpy --user
try_clone_checkout() {
url="${1}"
ref="${2}"
dir=$(basename "${url}" | sed 's/.git$//')
echo "${0}: ${dir}: must be built from source for Linux builds"
if [ ! -d "${dir}" ]; then
git clone "${url}"
cd "${dir}"
git checkout "${ref}"
cd -
else
echo "${0}: ${dir}: already exists: skipping clone"
fi
}
try_clone_checkout "https://github.com/mitkof6/BTKCore" "btk_python_setup"
cd BTKCore
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX="../install" \
-DBTK_WRAP_PYTHON="ON" \
-DBUILD_SHARED_LIBS="ON"
make -j$(nproc)
make install