Building Boost on Mac OS X

I'm trying to build boost (boost_1_31_0) as a dependency for monotone http://venge.net/monotone/ on Mac OS X 10.4 (tiger). I'm doing this using gcc-3.3 because monotone doesn't work properly with gcc 4. Following the instructions in monotone for how to build boost, it tells me to do this: $BJAM "-sBUILD=release <threading>single <optimization>speed <runtime- link>static" This failed on a few of the targets, with an error that crt0.o was not found. This is probably because static linking of binaries is not supported on Mac OS X: http://developer.apple.com/qa/qa2001/qa1118.html So I tried removing the <runtime-link>static option, but then I started getting errors about not being able to find certain symbols. For some projects, it was complaining about not being able to find _main. It also complained about not being able to find __Z20init_unit_test_suiteiPPc in libboost_unit_test_framework, and there may have been other errors too. Here's the error output for some of these: gcc-Link-action bin/boost/libs/thread/build/libboost_thread.dylib/gcc/ release/shared-linkable-true/libboost_thread-gcc-1_31.dylib c++: unrecognized option `-shared' ld: Undefined symbols: _main gcc-Link-action bin/boost/libs/test/build/ libboost_unit_test_framework.dylib/gcc/release/shared-linkable-true/ libboost_unit_test_framework-gcc-1_31.dylib c++: unrecognized option `-shared' ld: Undefined symbols: __Z20init_unit_test_suiteiPPc So, I'm wondering what I need to do to get boost to build on darwin. Can anyone give me some help? Thanks, Brian

On Jun 2, 2005, at 10:52 PM, Brian Campbell wrote:
I'm trying to build boost (boost_1_31_0) as a dependency for monotone http://venge.net/monotone/ on Mac OS X 10.4 (tiger). I'm doing this using gcc-3.3 because monotone doesn't work properly with gcc 4. Following the instructions in monotone for how to build boost, it tells me to do this:
Our support for Mac OS X wasn't all that great in 1.31.0; I think it should work. We're getting better now that more developers are using Mac OS X as their primary development machines, although Tiger is so new that it might not support it perfectly yet.
So, I'm wondering what I need to do to get boost to build on darwin. Can anyone give me some help?
You need to pass "-sTOOLS=darwin" on the bjam command line. Darwin is different enough that we have a different compiler configuration ("toolset") for it. You might have better luck with Boost 1.32.0. Doug

On 6 Jun 2005, at 14:07, Doug Gregor wrote:
So, I'm wondering what I need to do to get boost to build on darwin. Can anyone give me some help?
You need to pass "-sTOOLS=darwin" on the bjam command line. Darwin is different enough that we have a different compiler configuration ("toolset") for it.
You might have better luck with Boost 1.32.0.
The easiest way I have found to install boost on Mac OS X (Tiger 1.4.1) has been with darwinports, install docs can be found at: http://darwinports.org/docs/ch01s03.html Then "sudo port install boost" will install 1.32 (at present). I have had no problems with the installation and use quite a number of the boost libraries. Cheers Chris This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

On Jun 10, 2005, at 1:15 PM, Chris Coleman wrote:
The easiest way I have found to install boost on Mac OS X (Tiger 1.4.1) has been with darwinports, install docs can be found at:
http://darwinports.org/docs/ch01s03.html
Then "sudo port install boost" will install 1.32 (at present). I have had no problems with the installation and use quite a number of the boost libraries.
Cheers Chris
Thanks, this is actually the approach I ended up using. In fact, it was the approach I tried first, but then it turned out that the program I was trying to link to boost didn't work properly with the version of GCC 4 that shipped with OS X 10.4 (which was based on a prerelease version of GCC 4). Since I didn't want to recompile all of darwinports with GCC 3.3, I decided to see if I could compile just boost and the program that would be using it with GCC 3.3. Apple finally released an updated GCC 4, based on the stable release of GCC 4, which works, so I ended up just using that with the boost from Darwinports. Thanks for all of the suggestions, Brian
participants (3)
-
Brian Campbell
-
Chris Coleman
-
Doug Gregor