-
Notifications
You must be signed in to change notification settings - Fork 47
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:
- A recent C++ compiler: Either Clang 16 or GCC 12
- CMake 3.17 (or newer): cmake.org (Ubuntu APT Repository)
- Ninja: ninja-build.org
- Git
Note: Unix Makefiles are not working. Please use Ninja to build.
git clone [email protected]: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 ..