-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild_opensim-core
55 lines (47 loc) · 1.42 KB
/
build_opensim-core
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
#!/usr/bin/env bash
set -xeuo pipefail
# install dependencies in case they are missing
sudo apt-get --yes install git cmake cmake-curses-gui \
freeglut3-dev libxi-dev libxmu-dev \
liblapack-dev swig python-dev \
openjdk-8-jdk
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
}
# clone repo
try_clone_checkout "https://github.com/mitkof6/opensim-core.git" "bindings_timestepper"
# build dependencies
cd opensim-core
mkdir build_dependencies
cd build_dependencies
cmake ../dependencies/ \
-DCMAKE_INSTALL_PREFIX='../install/dependencies' \
-DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
# build opensim-core
cd ..
mkdir build_opensim
cd build_opensim
cmake .. \
-DCMAKE_INSTALL_PREFIX="../install/" \
-DCMAKE_BUILD_TYPE=Release \
-DOPENSIM_DEPENDENCIES_DIR="../install/dependencies" \
-DSIMBODY_HOME="../install/dependencies/simbody" \
-DBUILD_PYTHON_WRAPPING=ON \
-DOPENSIM_PYTHON_VERSION=3 \
-DBUILD_API_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DWITH_BTK=ON
make -j$(nproc)
make install