Boost

Boost

Boost is a popular collection of C++ libraries.

The robo.fish software projects standardize on Boost version 1.67.0, which is assumed to be located at /usr/local/boost_1_67_0 on Linux systems.

Build From Source

Configuration

The version of Boost in Ubuntu 16.04 Xenial and Ubuntu 18.04 Bionic is older than 1.67.0. Therefore you need to build Boost from source. Make sure to supply the correct version of Python to bootstrap.sh. The software projects on this website use Python 3.6 because version 3.6 is the default for the Python environment manager Miniconda3 and the default version of Python 3 in Ubuntu 18.04.

./bootstrap.sh --with-python-version=3.6m


Also, on your main development system make sure that Boost is installed to the directory /usr/local/boost_1_67_0 instead of the default directory /usr/local. This allows you to install other versions of Boost without conflict.

./bootstrap.sh --with-python-version=3.6m --prefix=/usr/local/boost_1_67_0

On Raspberry Pi, Boost is assumed to be installed in /usr/local.

On an Ubuntu 16.04 based system, where you installed Python 3.6 via miniconda, edit the file project-config.jam to replace the lines

# Python configuration
import python ;
if ! [ python.configured ]
{
    using python : 3.6m : <path to miniconda3> ;
}

with

# Python configuration
using python : 3.6m : <path to miniconda3>/bin/python3 : <path to miniconda3>/include/python3.6m : <path to miniconda3>/lib ;

where <path to miniconda3> is the absolute file path to the miniconda root directory. Otherwise the configuration file will pick up the system's default Python configuration, which is Python 2.7.

On Ubuntu 18.04, where Python 3.6 is a main package, replace the same if block with

# Python configuration
using python : 3.6m : /usr/bin/python3.6m : /usr/include/python3.6m : usr/lib/x86_64-linux-gnu ;


Building

Use this command to install while building and to shorten the build time by running up to 4 build processes in parallel.

sudo ./b2 -j4 install


Raspberry Pi

On Raspberry Pi, -j4 can cause problems. Try with -j2 or just don't use the multi-process building option. Since build times will be long, you probably want to run the build process in the background and so that it continues running after you logged out from the terminal session:

nohup sudo ./b2 install > /dev/null 2>&1 &

The assumption is that there is a GUI-less Raspbian system on the Raspberry Pi. When you log in again on your RPi, you can use top to check if the build is still running. The b2 command will be using most of the CPU while running.