Boost logo

Boost Users :

From: Marko Stanisic (sankerspace_at_[hidden])
Date: 2019-08-25 19:28:30


Hi,

on the Boost Support page is a short description about a cross compiling
process:

https://www.boost.org/doc/libs/1_64_0/doc/html/bbv2/tasks.html

I didn't found it actually for the current version,but that doesn't matter.

On these pages are some additional informations:

1)
https://stackoverflow.com/questions/29029867/cross-compile-boost-1-57-0-on-ubuntu-for-arm

2) https://github.com/Yadoms/yadoms/wiki/Cross-compile-for-raspberry-PI

It seems that you are on the right way, you have to create a file
"user-config.jam" inside $HOME (Windows: |%HOME%|) and put following
line inside:

using gcc : arm : arm-none-linux-gnueabi-g++ ; (or)
[using gcc : arm : arm-linux-gnueabi-g++ ;(if it doesnt work )]

then

|./b2 --with-log toolset=gcc-arm link=static cxxflags=-fPIC (according to 2)|

I hope that is more helpfull.

On 25.08.19 19:53, Adrian C via Boost-users wrote:
> Thank you, but that caused the compiler to complain about an unknown
> option.
>
> However, it succeeds if I replace BUILD_CXX=arm-linux-gnueabihf-gcc
> with BUILD_CXX=arm-linux-gnueabihf-g++.
>
> Now I realize I don't understand the building process of boost. The
> result of running bootstrap.sh is some jam config files and an
> executable called b2, not the actual boost libraries.
> The resulting b2, unsurprisingly, is an ARM executable for the target
> platform, and can't run on the intel machine, which defeats my purpose
> of cross compiling in the first place (since it was b2 that caused the
> out of memory condition on the ARM).
>
> So I ran bootstrap.sh _without_ the cross compiler settings and got a
> b2 for intel x86-64. Now I have to make b2 use the ARM toolchain (or
> it will build for Intel). However I can't figure out what and how to
> pass the cross compiler settings to b2, because it seems to expect
> them in a different way than bootstrap.sh did.
> Running ./b2 --help only offers this hint about cross compiling:
>
> Properties:
>
>   toolset=toolset Indicate the toolset to build with.
>
> I tried passing toolset=arm-linux-gnueabihf but that caused an error too:
>
> arm.jam: No such file or directory
> /home/ubuntu/arm-toolkit/boost_1_71_0/tools/build/src/build/toolset.jam:44:
> in toolset.using
> ERROR: rule "arm.init" unknown in module "toolset".
>
> Does anyone know how to tell b2 to use a specific toolchain? Or what
> I'm doing wrong.
>
>
> On Sunday, August 25, 2019, 2:29:13 AM MST, Marko Stanisic
> <sankerspace_at_[hidden]> wrote:
>
>
> Try to compile it with that compiler settings:
>
>
> *g++ –std=c++14 -pthread *
> *
> *
>
> Hint comes from here:
> https://www.geeksforgeeks.org/thread-hardware_concurrency-function-in-c/amp/
>
> Sent from my iPhone
>
> On 24.08.2019, at 20:05, Adrian C via Boost-users
> <boost-users_at_[hidden] <mailto:boost-users_at_[hidden]>> wrote:
>
>> undefined reference to `std::thread::hardware_concurrency()'
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net