Partial success Re: [C++-sig] boost.python on OS X 10.3 (Panther)

Bob Ippolito bob at redivi.com
Tue Nov 4 23:55:39 CET 2003


On Nov 4, 2003, at 5:37 PM, Ralf W. Grosse-Kunstleve wrote:

> --- Bob Ippolito <bob at redivi.com> wrote:
>> -bundle_loader is pretty worthless with a framework Python..
>
> But as it stands right now I don't know how to get a working build  
> without the
> -bundle_loader switch. Did you see my other posting with the example  
> compile &
> link commands?
>
> http://mail.python.org/pipermail/c++-sig/2003-November/006188.html
>
> How would you modify these command lines?

the last one:

c++ -bundle -bundle_loader  
/Library/Frameworks/Python.framework/Versions/2.3/Python  
/Library/Frameworks/Python.framework/Versions/2.3/Python -o  
libtbx/str_ext.so boost/libs/python/test/str.os -Llibtbx  
-L/net/worm/scratch1/rwgk/hot/libtbx -lboost_python -lm

should be:

c++ -bundle -o libtbx/str_ext.so boost/libs/python/test/str.os -Llibtbx  
-L/net/worm/scratch1/rwgk/hot/libtbx -framework Python -lboost_python  
-lm

see:
LDSHARED=   $(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK)

from:
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ 
config/Makefile

Basically the deal is that dyld does two level namespaces.. so except  
in the case of umbrella frameworks or libraries (don't try and do this  
for Python), if you don't have the symbol defined in your object file  
it does not get exported.  Therefore, anything that uses symbols from  
Python have to get them from the Python framework directly (I'm  
assuming that both libboost_python and str_ext use symbols from  
Python).

-bob





More information about the Cplusplus-sig mailing list