-
Notifications
You must be signed in to change notification settings - Fork 47
Linux Developer Setup
Pablo Hoch edited this page Apr 30, 2021
·
10 revisions
The steps to build the MOTIS distribution you can also download can found be here.
Requirements:
- A recent C++ compiler: Either Clang 11 (or newer) or GCC 10 (or newer)
- CMake 3.16 (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++):
# clang11-toolchain.cmake
set(CMAKE_C_COMPILER /usr/bin/clang-11)
set(CMAKE_CXX_COMPILER /usr/bin/clang++-11)
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/clang11-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 ..