Skip to content

Build from source

epsilonrt edited this page Jan 27, 2019 · 12 revisions

The compilation requires a compiler g ++ managing C++11, the compilation has been made with gcc version 6.3.0 20170516. This compiler is usually installed with a complete tool chain on Linux systems.

To build from sources you must do the following:

sudo apt update
sudo apt install build-essential pkg-config cmake
git clone https://github.com/epsilonrt/libmodbuspp.git
cd libmodbuspp
mkdir cmake-build-Release
cd cmake-build-Release
cmake ..
make 
sudo make install
sudo ldconfig

To uninstall:

 cd cmake-build-Release
 sudo make uninstall

Debian packages

You can also generate Debian packages with:

 cd cmake-build-Release
 rm -fr *
 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
 sudo apt-get install fakeroot
 fakeroot make package

then install them:

 sudo apt install ./*.deb

Doxygen documentation

To generate documentation in HTML format and Man pages, you must install the pre-requisites:

 sudo apt install doxygen doxygen-latex doxygen-doc doxygen-gui graphviz

then built the doc:

 cd cmake-build-Release
 cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release  -DMODBUSPP_WITH_DOXYGEN_DOC=1 ..
 fakeroot make package
Clone this wiki locally