How to create universal binaries 1.45?

How to create universal binaries 1.45? about the leopard / snow leopard?

+6
osx-leopard universal-binary macos boost-build
source share
3 answers

To create a 4-way universal raise of static binaries in OSX 10.6, I do the following:

  • Download the update from the promotion site.

  • Extract the archive and cd to the boost_x_xx_x folder (where x_xx_x is the upgrade version you are using).

  • 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 compiles everything except Boost.MPI (which requires the --with-mpi ). Build products fall into ./stage


UPDATE: If you installed Xcode 4, you need to perform an additional step. Xcode 4 does not ship with compilers or libraries capable of customizing PowerPC. Unfortunately, the compilers that ship with Xcode 4 become the default compilers used by Boost. To force the use of compilers that ship with Xcode 3, you must complete an additional step. Please note that you must install Xcode 3 if it is not available on your system.

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

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

Add the following line to this file. This instructs you to use g ++ - 4.2 from Xcode 3:

 using darwin : : /Developer-old/usr/bin/g++-4.2 ; 
+11
source share

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

Most Boost libraries have only headers: they consist entirely of header files containing templates and built-in functions and do not require separately compiled libraries or special treatment when linking.

The one you need to collect is:

  • 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?

+1
source share

To create universal binaries under Tiger, I created a user-config.jam file in my home directory ( $HOME ):

 using darwin : : : <compileflags>"-arch ppc -arch i386 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" ; 

And then I built Boost, as usual, with Jam. This should probably work with older versions of Mac OS X.

Another way is to use MacPorts, but in this case all Boost dependencies need to be rebuilt as universal binaries, which is not always possible (I have this on Tiger twice, but could not).

For both cases, you need to install MacOSX10.4u.sdk with Xcode.

[edit]

To build for three architectures, you'd better read the answer to a similar question. In short, the build options in user-config.jam are dependent on your and target versions of Mac OS X. Therefore, you'd better try different options based on the above answer.

0
source share

All Articles