-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path06-install-gtsam
More file actions
executable file
·32 lines (26 loc) · 918 Bytes
/
06-install-gtsam
File metadata and controls
executable file
·32 lines (26 loc) · 918 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
#!/usr/bin/env bash
install_gtsam () (
set -euxo pipefail
command -v sudo > /dev/null 2>&1 || { apt update && apt install --no-install-recommends -y sudo; }
sudo apt install -y \
build-essential \
cmake \
curl \
libboost-all-dev \
libeigen3-dev \
libtbb2-dev
sudo apt install -qqy jq
local latest=$(curl -sSf https://api.github.com/repos/borglab/gtsam/releases/latest | jq -r '.tag_name')
local tag="${GTSAM_VERSION:-${latest}}"
curl -sSfL https://github.com/borglab/gtsam/archive/refs/tags/${tag}.tar.gz | tar -zx
cmake -S gtsam-${tag} -B gtsam-${tag}/build \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
-DGTSAM_BUILD_TESTS=OFF \
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
-DGTSAM_USE_SYSTEM_EIGEN=ON \
-DGTSAM_WITH_EIGEN_MKL=OFF
cmake --build gtsam-${tag}/build -- -j$(nproc)
sudo cmake --build gtsam-${tag}/build --target install
rm -rf gtsam-${tag}
)
install_gtsam