Skip to content

Install dependencies

Istvan Madari edited this page Sep 19, 2019 · 1 revision

RIAPS-CORE Dependencies

Before you try the RIAPS C++ API you have to install its dependencies. You have two options to go through the preparation part:

  • The fastest way: use the pre-built virtual machine, where everything is pre-installed: VM instructions.
  • The fascinating way: build the dependencies from scratch.

We would suggest try the fastest way first. The rest of the document describes the steps of the "fascinating way".

Why is it difficult?

RIAPS has several dependencies, you might suspect that. Since RIAPS is prepared to support multiple architectures you have to install all the dependencies for all the target architectures on your development machine. Your journey is about to build and setup cross compile toolchain on your development machine for C++. It is not secret: cross compilation in C++ is not always smooth. The following steps describe how to set up your development machine to compile and crosscompile RIAPS applications for amd64 and armhf architectures.

Install || build the dependencies

Ubuntu provides "multiarch" packages from the apt repository, however not all the dependencies can be installed by this comfortable way. That means, you have to build few dependencies by yourself for all the target architectures.

Requirements

  • Linux. This instruction is based on Ubuntu 18.04 and we recommend to use this distribution since RIAPS heavily depends on multiarch libraries from Ubuntu apt repositories.
  • Optionally few armhf devices (e.g.: BeagleBone Black), where you can try our/your applications. Of course you can test the apps on the development machine, but this framework targets rapid application development for distributed environments. It is more fun to try your applications on multiple armhf devices and then test RIAPS features (like fault tolerance, resource management or distributed coordination).

Add armhf repositories to apt sources

RIAPS has tons of dependencies, but thanks to the multi architecture support in Ubuntu, lot of the dependencies can be installed from the apt repositories. By default, the armhf repositories are not in the apt source list, you have to add and tag them (with the corresponding architecture). Edit the apt source list:

sudo nano /etc/apt/sources.list

Make sure that the following repositories (with the corresponding tags) are in the list:

deb [arch=i386,amd64] http://us.archive.ubuntu.com/ubuntu/ bionic restricted main universe multiverse
deb [arch=i386,amd64] http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe restricted multiverse main
deb [arch=i386,amd64] http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb [arch=i386,amd64] http://security.ubuntu.com/ubuntu bionic-security multiverse main restricted universe
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main universe multiverse

Add the armhf architecture to the system:

sudo dpkg --add-architecture armhf

Check the known architectures on the development machine:

~$ dpkg --print-foreign-architectures 
i386
armhf

Tools for compilation and build

What you need for compiling and crosscompiling:

sudo apt update
sudo apt install crossbuild-essential-armhf gdb-multiarch build-essential cmake libtool libtool-bin autoconf autogen git python3-pip

RIAPS dependencies

riaps-core has the following dependencies:

The following libraries can be installed from the apt repositories (note that few of them install the armhf version too, this is for the crosscompile support):

sudo apt install byacc flex python3-dev libboost-dev libpython3.6-dev           \
                 python3-setuptools libncurses5-dev libreadline-dev nettle-dev  \
                 libpcap-dev libzmq5 libzmq3-dev libsystemd-dev                 \
                 libpython3.6-dev:armhf libncurses5-dev:armhf libzmq3-dev:armhf \
                 libreadline-dev:armhf nettle-dev:armhf libpcap-dev:armhf       \
                 libsystemd-dev:armhf libuuid1:armhf liblz4-1:armhf

Install the remaining dependencies

Since not all the dependencies enjoy the multi architecture support, we pre-built the missing libraries and packed into one .deb file. Download and install riaps-externals-amd64.deb on your development machine.

About the contents of the riaps-externals, please check the readme.

What's next

At this point all the riaps-core dependencies are installed. The next step is to install (or build and install) the riaps-core itself.

Clone this wiki locally