Building on Ubuntu - Project-OSRM/osrm-backend GitHub Wiki

Building on Ubuntu

Current OSRM builds use vcpkg manifest mode for library dependencies. Follow the source-build instructions in the README; the manifest and overlay ports provide the versions used by CI, including LibArchive, RapidJSON, FlatBuffers, sol2 and gauche.

Ubuntu 24.04

Install the build tools:

sudo apt install build-essential git cmake ninja-build pkg-config \
  autoconf automake libtool curl zip unzip tar

Check cmake --version. The default Ubuntu 24.04 package is older than the README's CMake 3.29 requirement. Install a supported newer version from CMake's official downloads or Kitware's APT repository.

Bootstrap vcpkg:

git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
~/vcpkg/bootstrap-vcpkg.sh
export VCPKG_ROOT=~/vcpkg

From the OSRM repository root:

cmake --preset ci-linux
cmake --build --preset ci-linux

The first configure builds the manifest dependencies. Later builds reuse vcpkg's binary cache. You do not need to install the library dependencies separately with apt or copy packages from another Ubuntu release.

The ci-linux preset targets x86-64. On another architecture, select the matching vcpkg triplet, for example:

cmake --preset release -DVCPKG_TARGET_TRIPLET=arm64-linux
cmake --build --preset release

Tests

Install a supported Node.js runtime for the library-test data scripts, then run:

ctest --test-dir build --output-on-failure

CTest builds test executables and prepares the required data through fixtures. See the testing guide for individual suites and the cucumber guide for integration tests.

Older versions and manual dependency builds

Old OSRM releases have different requirements. Use the README and dependency manifest from the release you are building. The former apt-only package list on this page was incomplete for current OSRM and is no longer the recommended build path.