Cross Compiling Boost C++ Libraries for ARM

Boost provides free peer-reviewed portable C++ source libraries. Ten Boost libraries are already included in the C++ Standards Committee’s Library Technical Report and will be in the new C++11 Standard.

The Boost C++ libraries are already included in popular Linux and Unix distributions such as Fedora, Debian, Ubuntu and NetBSD and are used by projects such as Python, Xibo, Civilization IV, etc..

Here are the steps to cross-compile Boost C++ libraries for arm using arm-linux-guneabi-g++:

  1. Download the source code:
  2. Extract the source code:
  3. Bootstrap the code:
  4. Modify the configuration file (project-build.jam) to use the ARM toolchain by replacing the line with “using gcc” by:
  5. Install the python development package:
  6. Build and install the boost libraries:

This was tested in Ubuntu 11.04 (natty) and 10.04 LTS with linaro g++ toolchain.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
16 Comments
oldest
newest
vincent
vincent
12 years ago

Hello,I am following your step cross compile boost for mips.
I have some questions:
1.The last step is to ./bjam install toolset=gcc-arm….
I don’t know how to set toolset in my environment,I use mips64-octeon-linux-gnu-g++/gcc.I try several times use gcc-mips or mips64-octeon-linux-gnu,but it failed.

2.When I execute ./bjam install –prefix=/home/lvrainbow/request-software/octeon-boost -disable-long-double -sNO_ZLIB=1 -sNO_BZIP2=1.
it will have some errors as following:
/usr/include/python2.7/pyconfig.h:6:25: error: pyconfig-64.h: No such file or directory
/usr/include/python2.7/pyport.h:849:2: error: #error “LONG_BIT definition appears wrong for platform (bad gcc/glibc config?).”

Didn’t you met the same errors? help me!!!Thank you very much.

Yusuf Taş
11 years ago

Man you really made my day. I have been working on this since 2 days and nothing worked so far. But your post helped me to finish my problems. I was trying to use eclipse for cross compiling, but boost shared libraries were compiled for intel not arm. This helped me so much. Thank you so much.

Jake
Jake
11 years ago


Can you elaborate on how to get the right python header files for my target?

ash
ash
11 years ago

Hi, My question isnt related to ARM. Its cross compilation for CN OCTEON MIPS64 platform. I have written a multithreaded code as cpp file and i am trying to cross compile using: [root@ash Documents]# /usr/local/Cavium_Networks/OCTEON-SDK/tools-gcc-4.3/bin/mips64-octeon-linux-gnu-g++ fourcore_2048bits.cpp -o fourcore_2048bits -lpthread But it gives a list of errors. Here are some of the initial errors: new' cannot appear in a constant-expression error: ISO C++ forbids initialization of member 'M1' error: making 'M1' static invalid in-class initialization of static data member of non-integral type 'long long unsigned int*' new’ cannot appear in a constant-expression ISO C++ forbids initialization of member ‘M2’ error: making… Read more »

ash
ash
11 years ago


I did that. i have compiled the same program on my host system using g++ and its working fine.
The problem comes when compiling for MIPS64 cavium networks OCTEON platform.

I have been working on it since two days and I can’t proceed.

ash
ash
11 years ago

The problem is solved 🙂

Rune K. Svendsen
10 years ago

@Jake
I’m stuck here too. When I try to build it I get an error saying it can’t find arm-linux-gnueabihf/python2.7/pyconfig.h

vincent
vincent
10 years ago

Hi,

I ask about the file project-build.jam dose not exist in the boost directory i find the project-config.jam and i modefiy the line with “using gcc” by “using gcc : arm : arm-linux-gnueabi-g++ ;”

but i get this message
/bjam install toolset=gcc.arm –prefix=/home/out/boost –disable-long-double -sNO_ZLIB=1 -sNO_BZIP2=1
gcc.arm.jam: No such file or directory
/home/invitee/Bureau/boost_1_47_0/tools/build/v2/build/toolset.jam:38: in toolset.using
rule gcc.arm.init unknown in module toolset.
/home/invitee/Bureau/boost_1_47_0/tools/build/v2/build-system.jam:481: in process-explicit-toolset-requests
/home/invitee/Bureau/boost_1_47_0/tools/build/v2/build-system.jam:562: in load
/home/invitee/Bureau/boost_1_47_0/tools/build/v2/kernel/modules.jam:283: in import
/home/invitee/Bureau/boost_1_47_0/tools/build/v2/kernel/bootstrap.jam:142: in boost-build
/home/invitee/Bureau/boost_1_47_0/boost-build.jam:17: in module scope

fercis
fercis
10 years ago

Hi, I did whatever written in the first post, but as vincent stated project-build.jam does not exist. Instead I modified project-config.jam, (after installing Linaro Arm gcc toolchain) I observed the following error , (error: Invalid property ‘~’: unknown feature ‘–prefix’.): The output: /home/fercis/boost_1_47_0/tools/build/v2/build/property.jam:328: in validate1 from module property error: Invalid property ‘~’: unknown feature ‘–prefix’. /home/fercis/boost_1_47_0/tools/build/v2/build/property.jam:337: in property.validate from module property /home/fercis/boost_1_47_0/tools/build/v2/build/build-request.jam:216: in convert-command-line-element from module build-request /home/fercis/boost_1_47_0/tools/build/v2/build/build-request.jam:153: in build-request.from-command-line from module build-request /home/fercis/boost_1_47_0/tools/build/v2/build-system.jam:612: in load from module build-system /home/fercis/boost_1_47_0/tools/build/v2/kernel/modules.jam:283: in import from module modules /home/fercis/boost_1_47_0/tools/build/v2/kernel/bootstrap.jam:142: in boost-build from module /home/fercis/boost_1_47_0/boost-build.jam:17: in module scope from module Do you have any… Read more »

TheDiD
TheDiD
9 years ago

Can someone help me on how to install boost in my arm-linux-gnueabi ? i am trying with boost 1.53 now and i can’t do it

s. wu
s. wu
8 years ago

I download version 1.59. At step 3, I have the following error. Bootstrapping the build engine with toolset gcc… Failed to bootstrap the build engine Consult ‘bootstrap.log’ for more details The log file is as follows. What’s the potential issue at here? Thanks! ### ### Using ‘gcc’ toolset. ### rm -rf bootstrap mkdir bootstrap gcc -o bootstrap/jam0 command.c compile.c constants.c debug.c execcmd.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c class.c cwd.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c… Read more »

Khadas VIM4 SBC