Skip to content

Linux Developer Setup

Felix Gündling edited this page Nov 2, 2023 · 10 revisions

The steps to build the MOTIS distribution you can also download can found be here.


Requirements:

Note: Unix Makefiles are not working. Please use Ninja to build.

Build MOTIS using the command line

git clone git@github.com:motis-project/motis.git
cd motis
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -GNinja ..
ninja

Make sure the right compiler is used, e.g. by setting CC and CXX environment variables or using toolchain files if it is not the system default compiler.

Example toolchain file (clang with libc++):

# clang14-toolchain.cmake
set(CMAKE_C_COMPILER /usr/bin/clang-14)
set(CMAKE_CXX_COMPILER /usr/bin/clang++-14)

set(CMAKE_C_FLAGS "-fcolor-diagnostics" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "-fcolor-diagnostics -stdlib=libc++" CACHE STRING "" FORCE)
cmake -DCMAKE_TOOLCHAIN_FILE=path/to/clang14-toolchain.cmake -DCMAKE_BUILD_TYPE=Release -GNinja ..

Example without toolchain file:

cmake \
  -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
  -DCMAKE_CXX_FLAGS="-fcolor-diagnostics -stdlib=libc++" \
  -GNinja -DCMAKE_BUILD_TYPE=Release ..