Building prplMesh on linux (dummy)
Frederik Van Bogaert edited this page 2021-04-19 21:27:37 +00:00

[[TOC]]

Download sources and go to prplMesh directory

$ git clone https://gitlab.com/prpl-foundation/prplmesh/prplMesh.git
$ cd prplMesh

Build prplMesh using Docker

./docker-builder.sh  

Additional CMake options can be given with the -f flag (and without -D):

./docker-builder.sh -f CMAKE_BUILD_TYPE=Debug BUILD_TESTS=ON ENABLE_NBAPI=ON

Building natively

prplMesh requires the following dependencies to be available (these are the Debian/Ubuntu package names):

cmake, libjson-c-dev, libncurses-dev, libnl-3-dev, libnl-genl-3-dev, libnl-route-3-dev, libreadline-dev, libssl-dev, pkg-config, python3, python3-yaml

In addition, for Ambiorix (Northbound API), the following packages are needed:

bison, curl, flex, libevent-dev, libyajl-dev, lua5.1, liblua5.1-0-dev, build-essential , uriparser

Note that uriparser must be at least version 9.0, so for older Debian/Ubuntu it has to be built or fetched from a more recent repo.

Before building prplmesh, ubus and ambiorix must be built and installed:

git clone git://git.openwrt.org/project/libubox.git
cd libubox
cmake -H"$(pwd)"/. -B"$(pwd)"/build/. -DCMAKE_INSTALL_PREFIX=/usr
make install -C build
cd ..

git clone git://git.openwrt.org/project/ubus.git
cd ubus
cmake -H"$(pwd)"/. -B"$(pwd)"/build/. -DCMAKE_INSTALL_PREFIX=/usr
make install -C build

# Fetch and intall Bus Agnostic API libs, applications.
# As they have some internal dependencies - we should build & install
# them in specific order.
repo init -u https://gitlab.com/soft.at.home/ambiorix/ambiorix.git
repo sync
make install -C libraries/libamxc
make install -C libraries/libamxp
make install -C libraries/libamxd
make install -C libraries/libamxj
make install -C libraries/libamxo
make install -C libraries/libamxb
make install -C applications/amxb-inspect
make install -C applications/amxo-cg
make -C bus_adaptors/amxb_ubus
make install -C bus_adaptors/amxb_ubus

Finally, build prplMesh itself:

cmake -S . -B build-native -DENABLE_NBAPI=OFF -DCMAKE_INSTALL_PREFIX=$PWD/build-native/install -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
make -C build-native install