Get Started
The current stable release of GTSAM is 4.2. The active development line is pre-4.3 and recent alpha releases follow that track.
Fastest Start: Python Package
If you want the easiest way to try GTSAM, install the Python package:
pip install gtsam
For the newest development build:
pip install gtsam-develop
This works well in local Python environments and in Google Colab.
Build from Source
Clone the source from the GTSAM GitHub repository:
git clone https://github.com/borglab/gtsam.git
cd gtsam
Quickstart
In the root library folder execute:
cmake -S . -B build
cmake --build build --target check
cmake --build build --target install
The check target is optional, but recommended when validating a local build.
Requirements
- A modern compiler:
- Linux: at least clang-11 or gcc-9
- macOS: at least Xcode 14.2
- Windows: at least MSVC 14.2
- CMake >= 3.10
Ubuntu package:
sudo apt-get install cmake
Optional Boost Dependency
Boost is now optional and only needed when either of these flags is enabled:
GTSAM_USE_BOOST_FEATURESGTSAM_ENABLE_BOOST_SERIALIZATION
If you need Boost, install version 1.70 or newer:
- Ubuntu:
sudo apt-get install libboost-all-dev - macOS:
brew install boost - Windows: prefer vcpkg
Optional Dependencies
- Intel Threaded Building Blocks (TBB)
- Ubuntu:
sudo apt-get install libtbb-dev
- Ubuntu:
- Intel Math Kernel Library (MKL)
- Benchmark before enabling it; it does not help all workloads.
For more build flags and platform notes, see the Build page.
Ubuntu Packages and PPAs
Ubuntu users can also use the BorgLab Launchpad archives:
For the most current configuration options, source builds are still the safest path.
Arch Linux
GTSAM is available in the AUR.
yay -S gtsam
For Intel-accelerated builds:
yay -S gtsam-mkl
Conda-forge
Community-maintained GTSAM packages are available from conda-forge for Linux, macOS, and Windows. These packages are not tested by the GTSAM developers.
Install the gtsam package with your
preferred conda-compatible package manager:
conda install -c conda-forge gtsam
mamba install -c conda-forge gtsam
micromamba install -c conda-forge gtsam
If you need a package manager, see the micromamba installation guide. It recommends this installer for Linux, macOS, and Git Bash on Windows:
"${SHELL}" <(curl -L micro.mamba.pm/install.sh)
For Windows PowerShell, use:
Invoke-Expression ((Invoke-WebRequest -Uri https://micro.mamba.pm/install.ps1).Content)
Wrappers
GTSAM also ships with Python and MATLAB wrappers: