Skip to content

Build from source

epsilonrt edited this page Dec 20, 2023 · 6 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 used on Pi boards.

The dependencies are as follows:

  • libcppdb-dev which provides CppDB for access to the database
  • libudev-dev which provides libudev for enumerate devices
  • Qt if you want to compile the database management tool pidbm.

To build from sources you must do the following:

sudo apt update
sudo apt install libcppdb-dev pkg-config cmake libudev-dev
git clone https://github.com/epsilonrt/piduino.git
cd piduino
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, you must install the pre-requisites:

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

To correctly display the C ++ code in the documentation, it is better to install marked which depends on nodejs:

sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=18
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y
sudo npm install -g marked

then built the doc:

 cd cmake-build-Release
 cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release  -DPIDUINO_WITH_DOXYGEN_DOC=1 ..
 make doc