How to Install Project Aria Tools for C++
Overview
This page provides instructions on how to:
- Build projectaria_tools for C++, without visualization
- Build projectaria_tools for C++, with visualization
- To install dependencies, follow the instructions for build without visualization first
- Build projectaria_tools in isolation with a package manager (Linux/MacOs/Windows)
- Most convenient way to check that code and unit test are running when performing Contribution/GitHub PR to the project
Build from source without visualization
Step 1 : Install dependencies
- Ubuntu
- Fedora
- MacOS
# Install build essentials
sudo apt install build-essential git cmake
# Install VRS/Pangolin dependencies
sudo apt install libgtest-dev libgmock-dev libgoogle-glog-dev libfmt-dev \
liblz4-dev libzstd-dev libxxhash-dev libboost-all-dev libpng-dev \
libjpeg-turbo8-dev libturbojpeg0-dev libglew-dev libgl1-mesa-dev libeigen3-dev
# Install build essentials
sudo dnf install -y git cmake gcc gcc-c++ make
# Install VRS/Pangolin dependencies
sudo dnf install -y gtest-devel gmock-devel glog-devel fmt-devel lz4-devel \
libzstd-devel xxhash-devel boost-devel libpng-devel libjpeg-turbo-devel \
turbojpeg-devel glew-devel eigen3
If you don't have brew on your mac, here is the setup link.
# Install build essentials with Homebrew
xcode-select --install
brew install git cmake eigen python3 boost fmt googletest \
glog lz4 zstd xxhash libpng jpeg-turbo glew
Step 2 : Compile C++ source code
cd $HOME/Documents/projectaria_sandbox
mkdir -p build && cd build
# compile the C++ API
cmake ../projectaria_tools/
make -j2
Build from source with visualization
Step 1 : Install dependencies
Follow the above steps to install dependencies build from source
Step 2 : Compile Pangolin
The viewers are built using Pangolin.
# compile & install Pangolin
cd /tmp
git clone --recursive https://github.com/stevenlovegrove/Pangolin.git
mkdir -p Pangolin_Build && cd Pangolin_Build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TOOLS=OFF -DBUILD_PANGOLIN_PYTHON=OFF \
-DBUILD_EXAMPLES=OFF ../Pangolin/
make -j2
sudo make install
Step 3 : Build projectaria_tools with visualization
cd $HOME/Documents/projectaria_sandbox
mkdir -p build && cd build
# Build C++ Aria Viewer
cmake ../projectaria_tools -DPROJECTARIA_TOOLS_BUILD_TOOLS=ON
make -j2
Step 4 : Verify installation by running the viewer
cd $HOME/Documents/projectaria_sandbox/build
# Running the Aria Viewer with default example data
./tools/visualization/aria_viewer \
--vrs ../projectaria_tools/data/mps_sample/sample.vrs
Build projectaria_tools in isolation with a package manager
You can build projectaria_tools in isolation using pixi on and for your local platform (Linux, macOS Intel/Silicon, Windows) using the exact same command lines. Pixi is a convenient package and environment manager that simplifies the logic to compile and run projects by defining dependencies and tasks in a single pixi.toml file for all platforms.
note
For Windows platform we assume that Microsoft Visual C++ Compiler, MSVC 2017 or 2022 has been installed.
Step1 Install Pixi
- Linux & macOS
- Windows
# Install Pixi
curl -fsSL https://pixi.sh/install.sh | bash
# Install Pixi
iwr -useb https://pixi.sh/install.ps1 | iex
Step2 Compile and test the code
# When this command line first run, it will collect required dependencies, and then trigger the build and unit test
pixi run run_c
Step3 Access the compiled artifacts
# Activate the environment
pixi shell
# You can now run and use things from the projects
Troubleshooting
Check the Troubleshooting Guide if you encounter any issues.