Skip to content

Compile from Source

wissem chiha edited this page Sep 13, 2026 · 4 revisions
Platform Compiler CMake Version
Windows MSVC 2017 3.22.1
Linux GCC Latest
MacOS AppleClang Latest

Other platforms or compilers have not yet been tested. Please open an issue on GitHub Issues for any suspected bugs.

liburdf currently depends on the following libraries:

These are mainly for developers or for building language interfaces:

These dependencies are automatically fetched and compiled during the build process, no separate installation is required.

CMake

Dependencies

liburdf currently depends on the following libraries:

These are mainly for developers or for building language interfaces:

These dependencies are automatically fetched and compiled during the build process, no separate installation is required.

Prerequisites

  1. C++17 compatible compiler (GCC 7.1+, Clang 5.0+, MSVC 2017+)
  2. CMake (version 3.10+)

Configuration Options

Option Description Default
LIBURDF_BUILD_SHARED Build shared library OFF
LIBURDF_BUILD_SCRIPTS Enable building C++ scripts ON
LIBURDF_ENABLE_TESTING_COVERAGE Enable Test Coverage OFF
LIBURDF_BUILD_TESTS Enable building C++ tests ON
LIBURDF_BUILD_PYTHON3 Enable building Python3 binaries ON
LIBURDF_INSTALL Enable installation of liburdf ON

Build

We recommend using Ninja for faster builds. Run the following commands to build the project:

mkdir build && cd build
cmake -G Ninja  ..
ninja
ninja install

By default, this will use the MSVC compiler on Windows and the default CMake options. To use a different compiler with Ninja, run:

cmake -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc ..
make
make install

for unix systems or MinGW on Windows, If you prefer not to use Ninja, you can build the project using Unix Makefiles:

mkdir build && cd build
cmake -G "Unix Makefiles" ..
make
make install

These commands will build and install the static/shared library under the lib/ directory and the include files in the include/ directory of the build folder.

For Python bindings build and installation, enable the -DLIBURDF_BUILD_PYTHON3=ON flag, and run the following command from the root of the project to install them locally.

pip install --user .

Note that Python bindings are not currently tested, many bugs exist. Use them at your own risk, or feel free to contribute.

Bazel

The official build system for liburdf is cmake. However, bazel will continue to be maintained for bazel‑based projects, primarily for integration purposes. Issues may still arise; please report them in the issue tracker.

Prerequisites

  1. C++17 compatible compiler (GCC 7.1+, Clang 5.0+, MSVC 2017+)
  2. Bazel (version >=9.0.1)

Configuration Options

From the top level of the project folder run

bazel build //...

Running Tests

Project tests are built by default with bazel, to run them:

bazel test //...

Clone this wiki locally