[C++-sig] Building boost.python on Mac OS X

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Thu Sep 11 20:07:40 CEST 2003


--- Bob Ippolito <bob at redivi.com> wrote:
> scitbx/array_family/tst_af_4.exe
> Total OK: 1300
> [crack:~/tmp/debug] bob% gcc -v
> Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
> Thread model: posix
> gcc version 3.3 20030304 (Apple Computer, Inc. build 1435)
> 
> This is OS X 10.2.6, with the XCode preview dev tools, the gcc 3.3  
> compiler selected, and MACOSX_DEPLOYMENT_TARGET=10.2 environment  
> variable

Ever since May the scitbx and all the other modules in the cctbx (of which
scitbx is one) are fully functional under Mac OS X; ever since gcc 3.3.1 was
released even with full optimization:

    http://cci.lbl.gov/cctbx_build/

Follow the "Mac OS X notes" link for more information. I am using gcc 3.3.1
from gcc.gnu.org. Very important: you have to increase the stacksize limit to
avoid internal compiler errors!

All tests in boost/libs/python/test compile, but some of them don't link and I
am not sure if all of the rest run (they might). I also had link problems with
some extensions in the cctbx but got around them with some effort by
introducing dummy code, i.e. struct dummy {}; class_<dummy>(...); in extensions
that had no other class_<>.

I am not using bjam, but Rene made an effort to adjust the flags for gcc from
gcc.gnu.org. Apple's compiler needs different flags, so we will need two
different toolsets to support both.

The Mac OS X cctbx build.log from the build with the tag 2003_09_09_1700 shows
all compile and link commands that we use with gcc 3.3.1. The
libtbx.mac_os_x_ld_bpl_dll command is a helper script for linking the
Boost.Python library. The next three lines in build.log show the commands
executed by the helper script.

As hinted before, gcc 3.3 from gcc.gnu.org has a severely broken optimizer
(even under Linux, but not quite as bad as under OS X; 3.3.1 is perfect on both
platforms). I'd expect that Apple's gcc 3.3 has similar problems, but you never
know.

Ralf


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com




More information about the Cplusplus-sig mailing list