The installation guide is currently limited to a Debian-based system. In this tutorial we go through the installation based on an Ubuntu 18.04 or 20.04 is installed.
Software prerequisites:
- cmake
- clang
- catch2
- git
Optional software:
- mkdocs
- doxygen
- nlohmann::json (used by:
extra::json_model,extra::mqtt_connector) - paho.mqtt.cpp (used by:
extra::mqtt_connector)
In the following steps, we will install and setup all necessary software.
You can install cmake using the following command:
sudo apt install cmakeBy default lbVDA5050++ is build with clang. In the a first step we will setup clang on your Ubuntu 18.04 or 20.04 system.
For Ubuntu 20.04 clang v10 will be installed. You can install it with the following command:
sudo apt install clangFor installing clang 9 on Ubuntu 18.04 you have to add a repository. Perform the following commands to install clang v9:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt install clang-9We recommend to install catch2 beside your libVDA5050++. For further information visit Catch2 Github.
Recommended file structure:
Development Folder
|- catch2
|- Your Project / libvda5050pp
Clone the catch2 test-framework.
git clone https://github.com/catchorg/Catch2.gitNavigate inside the catch2 folder
cd catch2Change the branch to catch2 version 2 (v2.x)
git checkout v2.xConfigure the build process
cmake -Bbuild -H. -DBUILD_TESTING=OFFBuild and install catch2 on your system
sudo cmake --build build/ --target installFor Debian-based distribution, such as Ubuntu, use the following command. For further information visit the Git Homepage.
sudo apt install git-allMkdocs and Doxygen are optional software. You can install them to build the documentation on your system. The complete documentation is also available on the Gitlab-Pages in the libVDA5050++ repository.
To install Mkdocs on your system, execute the following command:
pip3 install mkdocsIf you don't have python3 and pip3 installed on your system you can also install mkdocs via apt. We encountered the problem that sometimes code blocks in the documentation are displayed as a single line with the apt version of mkdocs. Hence we recommend to install mkdocs with pip3.
sudo apt install mkdocsTo install Doxygen on your system, execute the following command:
sudo apt install doxygenClone the project repository:
git clone --depth 1 --branch v3.9.1 https://github.com/nlohmann/jsonConfigure the build directory:
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=/usr/bin/clang++-10Optionally add the -DCMAKE_INSTALL_PREFIX=$HOME/.local Flag to install
the library locally.
Finally install the library:
cmake --build build --target installPrerequisites:
sudo apt-get install libssl-devBuild and install paho.mqtt.c:
git clone --depth 1 --branch v1.3.8 https://github.com/eclipse/paho.mqtt.c.git
cd paho.mqtt.c
cmake -Bbuild -H. -DPAHO_ENABLE_TESTING=OFF -DPAHO_BUILD_STATIC=ON \
-DPAHO_WITH_SSL=ON -DPAHO_HIGH_PERFORMANCE=ON \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-10
sudo cmake --build build/ --target install
sudo ldconfig
Optionally add the -DCMAKE_INSTALL_PREFIX=$HOME/.local flag to install
the library locally.
Build and install paho.mqtt.cpp:
git clone --depth 1 --branch v1.2.0 https://github.com/eclipse/paho.mqtt.cpp
cd paho.mqtt.cpp
cmake -Bbuild -H. -DPAHO_BUILD_STATIC=ON \
-DPAHO_BUILD_DOCUMENTATION=TRUE -DPAHO_BUILD_SAMPLES=TRUE \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-10
sudo cmake --build build/ --target install
sudo ldconfig
If the paho.mqtt.c library was installed locally, add the -DCMAKE_PREFIX_PATH=$HOME/.local flag,
to locate it.
Optionally add the -DCMAKE_INSTALL_PREFIX=$HOME/.local flag to install
the (paho.mqtt.cpp) library locally.