Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build boost 1.45 universal binaries?

How to build boost 1.45 universal binaries? on leopard/ snow leopard ?

like image 382
Rajeshaz09 Avatar asked Jan 21 '11 05:01

Rajeshaz09


2 Answers

To build 4-way universal boost static binaries on OSX 10.6 I do the following:

  1. Download boost from the boost website.

  2. Extract the archive and cd into the boost_x_xx_x folder (where x_xx_x is the version of boost you are using).

  3. Run:

    ./bootstrap.sh and then

    # The name of the Boost.Jam program changed from "bjam" to "b2" in Boost 1.47.0

    # Replace "b2" with "bjam" if you are compiling a version <= 1.46.1

    ./b2 macosx-version=10.6 macosx-version-min=10.4 architecture=combined threading=multi link=static address-model=32_64

This will compile everything except for Boost.MPI (which requires the --with-mpi option). The build products get put in ./stage


UPDATE: If you have installed XCode 4, then there is an extra step that you must perform. XCode 4 does not come with compilers or libraries capable of targeting PowerPC. Unfortunately, the compilers that come with XCode 4 become the default compilers used by Boost. To force the use of the compilers that come with XCode 3, you must perform an extra step. Note that you must install XCode 3 if it is not on your system.

After running ./bootstrap.sh, and before running b2, open:

./tools/build/v2/user-config.jam

Add following line to that file. This instructs boost to use the g++-4.2 from XCode 3:

using darwin : : /Developer-old/usr/bin/g++-4.2 ;
like image 82
Mankarse Avatar answered Oct 17 '22 03:10

Mankarse


Which libraries are you trying to build? It says here (http://www.boost.org/doc/libs/1_45_0/more/getting_started/unix-variants.html) that:

Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking.

The one that you do need to build are:

  • Boost.Filesystem
  • Boost.GraphParallel
  • Boost.IOStreams
  • Boost.MPI
  • Boost.ProgramOptions
  • Boost.Python
  • Boost.Regex
  • Boost.Serialization
  • Boost.Signals
  • Boost.System
  • Boost.Thread
  • Boost.Wave

So which one are you trying to build?

like image 33
o1iver Avatar answered Oct 17 '22 02:10

o1iver