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

Bob Ippolito bob at redivi.com
Thu Sep 11 20:39:52 CEST 2003


On Thursday, Sep 11, 2003, at 14:07 America/New_York, Ralf W. 
Grosse-Kunstleve wrote:

> --- 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.

I had the stacksize set to 16384 when I tried earlier.  I just tried 
again at 65536, and the same error comes up, so the gcc 3.3 in the 
jaguar preview of XCode is probably busted.  I'll have to try it with 
something else when I get the time.  Don't waste yours trying to figure 
it out, I don't expect to need Boost.Python for anything in the near 
future, I was just curious.

-bob





More information about the Cplusplus-sig mailing list