Compiling Boost on Mac OS X for 64bit Builds

Since I have a bit of spare time on my hands at the moment, I thought I’d get back into playing around with Boost. Since my Simple Guide to Installing Boost on Mac OS X article was published we have had a few new releases of Boost, and more importantly a whole new version of Mac OS X. So does my guide still work?

It does still work as I described in my original article, but I have found one slight problem. When I try to compile a project using one of the dylib libraries I get link errors. It seems XCode projects are now defaulting to 32/64 bit combined binaries. The original build instructions only compile pure 32bit binaries so we can either switch our XCode projects to pure 32 bit or we need to compile Boost with the 64bit architecture.

The fix for this is simple, when you compile your binaries with the bjam command simply use the following command line:-

./bjam architecture=x86 address-model=32_64

This will give you a pure x86 (No PowerPC) set of binaries that are both 32bit and 64bit build compatible. You could use:-

./bjam architecture=combined address-model=32_64

To get both Intel and PowerPC compatible binaries if you need them. Once you’ve done this you can carry on using Boost as usual.

Image | WordPress Themes