Skip to main content

Advanced Installation From Source Code

This page covers advanced installation options to build Project Aria Tools from source code, including:

Pre-requisites: install dependencies

Before proceed to any of the advanced installation steps, please follow the command in the installer widget on Quick Start page to pull the correct branch from Github.

Then install the following third party dependency lib:

# Deactivate CONDA / MAMBA virtual environment you may be in! This is IMPORTANT!
conda deactivate

# 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 \
libepoxy-dev libopus-dev

Install FFmpeg: Aria Gen2 image data is encoded with H.265 codec. projectaria_tools relies on the decoding functions in the vrs library to decode H.265 image data. Here, we will build FFmpeg from source code with the exact same script from the vrs library:

# Set this to the root directory where you pulled the codebase
SRC_DIR=${HOME}/Documents/projectaria_sandbox/projectaria_tools/
cd ${SRC_DIR}

# Remove previously installed ffmpeg
rm -rf ~/vrs_third_party_libs/ffmpeg/

# ffmpeg will be installed under ~/vrs_third_party_libs/ffmpeg/
./build_third_party_libs/build_ffmpeg_linuxunix.sh

Build projectaria_tools lib using CMake, without visualization

cd ${SRC_DIR}
cmake -B ./build/ -S ./ -DCMAKE_POLICY_VERSION_MINIMUM=3.5
cd build/
make -j8

Build projectaria_tools lib using CMake, with visualization

The C++ visualization binaries in projectaria_tools are built using the Pangolin library. Therefore, you need to install Pangolin as a system library first.

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 -j8

sudo make install

# For Linux systems, you may need to run the following command to update the dynamic linker cache so the Pangolin library can be found
sudo ldconfig

Then you can build projectaria_tools in CMake:

cd ${SRC_DIR}
cmake -B ./build/ -S ./ -DPROJECTARIA_TOOLS_BUILD_TOOLS=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5
cd build/
make -j8

Build projectaria_tools Python package from source code

First, make sure you have installed the dependencies libraries as pre-requisites. You can build a local version of projectaria-tools Python package by doing the following. We strongly recommend you build this within a Python virtual environment.

# Go to your check-out source code directory
cd ${SRC_DIR}
python3 -m pip install --upgrade pip

python3 -m pip install .

Build projectaria_tools Python package from source code with type hinting

  1. Generate Python type hinting with generate_stubs.py script once projectaria_tools package is installed
  2. Install type hinting package for projectaria_tools
# Install pybind11-stubgen to generate the stub files
python3 -m pip install pybind11-stubgen==1.1

# Generate stubs
cd $HOME/Documents/projectaria_sandbox/projectaria_tools
python3 generate_stubs.py
cp -r projectaria_tools-stubs/projectaria_tools .

# Install projectaria-tools python package from source code.
python3 -m pip install .