General build instructions

Dependencies

The components within this repository have some dependencies:

Dependencies provided by Ubunutu (>= 18.04):

  • Boost
  • pugixml
  • libproj-dev
  • gtest
  • libpython-dev
  • libosmium2-dev
  • liblapacke-dev

Those can be installed by calling:

$>  sudo apt-get install libboost-all-dev libpugixml-dev libgtest-dev libpython-dev libosmium2-dev liblapacke-dev libproj-dev

Additional dependencies for the python bindings:

$>  sudo apt-get install castxml
$>  pip install --user python-wheel pygccxml pyplusplus xmlrunner

Remaining dependencies are present as GIT submodules; also to fix the version of these:

  • spdlog
  • odrSpiral

Building

For compiling all libraries and the dependencies, colcon is used colcon. Please use the link above for installation instructions.

This repository is prepared as colcon workspace including all dependencies not provided as installable packages by the OS. Those dependencies are part of the dependencies folder as GIT submodules. To properly fetch these, the submodules have to be updated and initialized.

 map$>  git submodule update --init

Once this is done, the full set of dependencies and components can be built calling:

 map$> colcon build

All components will be compiled respecting the dependencies between them.

The python bindings are disabled by default. To integrate them into the build you can make use of the prepared colcon meta file:

 map$> colcon build --metas colcon_python.meta

colcon_python.meta enables python build (-DBUILD_PYTHON_BINDING=ON). To specify the python version to be used you call e.g.:

 map$> colcon build --metas colcon_python.meta --cmake-args -DPYTHON_BINDING_VERSION=3.8

If cmake isn't able to find the requested python version you can try to specify the python executable explicitly (e.g. under Ubuntu18.04):

 map$> colcon build --metas colcon_python.meta --cmake-args -DPYTHON_BINDING_VERSION=3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6

The QGIS Plugin also requires the python build to be enabled (you have to adapt to your python version used):

 map$> colcon build --metas colcon_python.meta
 map$> echo "Setting PYTHONPATH and LD_LIBRARY_PATH:"
 map$> source install/setup.bash
 map$> echo "QGIS plugin built! Let's test it out:"
 map$> export QGIS_PLUGINPATH=<path/to/>map/install/ad_map_access_qgis/share/qgis/python/plugins
 map$> qgis

You should have seen 'CARLA ad_map_access Plug-in loaded' on successful loading of the plugin by qgis.

Build options

There are some CMake options affecting what or how the components are built.

  • BUILD_TESTING: Enables unit tests compilation
  • BUILD_APIDOC: Enables API documentation building
  • BUILD_HARDENING: Enables hardening compiler and linker flags
  • BUILD_PYTHON_BINDING: Enables the build of the respective python bindings
  • PYTHON_BINDING_VERSION: Select the python version to use explicitly e.g. "3.8". (Note: If that's not one of the system installed python versions, you have to ensure that the boost-python binding for that python version is available!)

By default, all options are set to off. Any of these could be activate by adding them via the colcon call above as "--cmake-args -D<OPTION>=[ON|OFF]", e.g.:

 map$> colcon build --cmake-args -DBUILD_TESTING=ON -DBUILD_APIDOC=ON -DBUILD_PYTHON_BINDING=ON -DPYTHON_BINDING_VERSION=3.8

Unit tests

 map$> colcon build --cmake-args -DBUILD_TESTING=ON

When activating the Unit tests, they all can be executed with:

 map$> colcon test

API documentation

When BUILD_APIDOC is enabled, the "colcon" call will automatically generate the API documentation.

 map$> colcon build --cmake-args -DBUILD_APIDOC=ON

The API documentation is written to the apidoc folder within the build directory.

Build hardening

Usually, build hardening is injected by the surrounding build system. Nevertheless, the CMakeLists.txt defines hardening flags to ensure the code is compatible to respective flags. To enable hardening compiler and linker flags:

 map$> colcon build --cmake-args -DBUILD_HARDENING=ON