TinyT TinyT - 8 months ago 24
Linux Question

Building Boost unit test framework on Debian 8.3 ARM

I'm trying to port a larger project to an embedded Linux system (Debian 8.3 ARM). The project requires Boost libraries newer than the system's Synaptic (1.55 vs. 1.58), so I'll need to build Boost from source. Usually I pick the most recent version, which was 1.60 when I downloaded things two weeks ago (current is 1.61).

The project contains test cases requiring

From the Boost docs I take it the calls (from the unzipped source directory) should be

./bootstrap.sh --prefix=/home/tinyt/b160_clang \
--with-libraries=system,thread,<more lbraries>,\
./b2 install toolset=clang

and that ought to give me boost 1.60 in
(line breaks are not part of the command but inserted here for readability).
The problem is that b2 doesn't recognize
as libraries and therefore doesn't build boost.
If I just omit the library, my subset of boost libraries builds, but of course CMake fails because its
requirement is not met.

Are there any other libraries that I ought to include?
Does the sequence of libraries matter?
Should I link to ar somewhere along the way?

The CMake generally seems to be OK, my build environment for the project is a x86 Debian 8.3 machine where things work fine. The difference is that there is enough room for a full install here.

Running clang 3.5 and CMake 3.0.2, same as the functional desktop system.
Most likely there is not enough space on the embedded target system to build the entire boost library AND have free space for my project app.

Am I missing further dependencies of
Is there a catch in how to specify the library for installation?
Is the unit test framework header-only so I can just copy the headers manually?

Any suggestions appreciated. Thanks!


I've just tried running
bjam --prefix=/... --with-<...>
for all the libraries I want to build with. The output was the same as before:

error: wrong library name 'boost_unit_test_framework' in the --with-<library> option.

The same is true if I omit the prefix


You're using incorrect name to specify the library.

You may run

bjam --show-libraries

to obtain a list of names of the libraries that require compilation.

For example, with boost 1.58, I get the following (trimmed) output:

...updated 1 target...
The following libraries require building:
    - atomic
    - chrono
    - container
    - context
    - coroutine
    - date_time
    - exception
    - filesystem
    - graph
    - graph_parallel
    - iostreams
    - locale
    - log
    - math
    - mpi
    - program_options
    - python
    - random
    - regex
    - serialization
    - signals
    - system
    - test
    - thread
    - timer
    - wave

Inspecting that, I can see there is a library named test. That's the one you're looking for. Hence, your command line to perform the build should contain:

--with-libraries=system,thread,<more libraries>,test