[Distutils] linking modules to a shared library

Stephen Langer stephen.langer at nist.gov
Mon Oct 3 16:56:38 CEST 2005

On Oct 2, 2005, at 6:21 AM, Ronald Oussoren wrote:

> On 30-sep-2005, at 19:57, Stephen Langer wrote:
>>    g++ -o _othermodule.so othermodule.C -lBase -bundle -undefined
>> dynamic_lookup -flat_namespace
> Don't use -flat_namespace. Search the pythonmac SIG archives if you  
> want a more elaborate rant :-).

Ok, I won't.  I was just guessing based on what I'd seen elsewhere.

>> Is it possible to create libBase portably with distutils?  It's
>> possible to do it on Linux by  subclassing build_ext.build_ext and
>> explicitly using self.compiler.compile() and
>> self.compiler.link_shared_lib() to build the shared library before
>> calling build_ext.build_ext.build_extensions().  But the same thing
>> on Mac OS X only creates libBase.so, whereas I need it to create
>> libBase.dylib.
> I don't know if this is possible, although I'd guess it is not.

That's too bad.  Is there a reason for it?  I'd volunteer to work on  
modifying distutils so that it can build a .dylib, but I am not an  
expert on library formats.  I don't really know the difference  
between a .so and a .dylib, except that one of them works and the  
other doesn't.  Can someone point me in the direction of a good  
reference on the topic?


  -- Steve

-- EMail: stephen.langer at nist.gov                    Phone: (301)  
975-5423 --
-- WWW:  http://math.nist.gov/mcsd/Staff/SLanger/    Fax:   (301)  
990-4127 --
-- Mail: NIST; 100 Bureau Drive -- Stop 8910; Gaithersburg, Md   
20899-8910 --

-- "I don't think this will work.  That's why it's  
science."               --
--                                      Naomi Langer,  17 Feb  
2003         --

More information about the Distutils-SIG mailing list