1

By default, package BR2_PACKAGE_BOOST_MPI does not build when cross-compiling in Buildroot: It requires detecting MPI (e.g. OpenMPI) configuration and libraries, and given this is not possible automatically (in the buildroot environment), the bjam build system will just inform Boost.MPI gets skipped:

warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.

In my environment I was able to workaround this by patching output/build/boost-1.61.0/user-config.jam:

using gcc : 6.2.0 : 
     /home/me/buildroot-2016.11/output/host/usr/bin/arm-buildroot-linux-gnueabihf-g++ : 
     <cxxflags>"-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os " <linkflags>"" ;

using mpi : /home/me/buildroot-2016.11/output/host/usr/bin/arm-buildroot-linux-gnueabihf/g++ : 
<find-shared-library>mpi  <find-shared-library>dl ;

(the first line is the only contents of user-config.jam as configured by the build system; I added the second line. Also, paths were adapted here).

Note: I obtained that bjam line by looking at mpi.jam sources and lots of trial an error.

However, any clean rebuild will delete output/build directory, thus wiping these changes.

Is there a "correct" way of enabling compilation of Boost.MPI when crosscompiling with Buildroot? Or at least, being able to patch the user-config.jam file after the build system configures the compiler? (note that paths depend on my system configuration and target host).

herchu
  • 936
  • 7
  • 24
  • Seems like you just need to tweak `boost.mk` and add needed string to `user-config.jam` and perhaps add dependency for openmpi. Though I'd still suggest to post this question to BR's mailing list. – yegorich Apr 20 '17 at 05:53

0 Answers0