Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

linking one extension module to another (Mac OSX)

0 views
Skip to first unread message

Simon Burton

unread,
Nov 21, 2005, 10:57:45 PM11/21/05
to

Hi,

I'm having some trouble linking one extension module to another because
the linker expects a "lib" prefix and my python modules cannot have
this prefix.

I found two ways of doing it on a linux box (either symlink or create a
dummy .so that links to extension module) but I can get neither of them
work on OSX (let alone windows).

Simon.

"Martin v. Löwis"

unread,
Nov 22, 2005, 12:48:53 AM11/22/05
to
Simon Burton wrote:
> I'm having some trouble linking one extension module to another because
> the linker expects a "lib" prefix and my python modules cannot have
> this prefix.

This is a Good Thing (tm) :-) Don't link extension modules to each
other; this is really asking for trouble. Instead, come up with a
function pointer API in one module, put that into a CObject, and
access the CObject through import statements.

Alternatively, make both extension modules link to the same
backend library.

Regards,
Martin

pianom...@gmail.com

unread,
Nov 22, 2005, 3:52:39 AM11/22/05
to

I have C Extension classes distributed across several modules with
non-trivial interdependancies. I guess you are saying I should have
these in backend libraries and then put the module specific functions
in the module itself. It's going to be tricky because I am using
distutils and pyrex to do all this. Maybe Greg (Ewing) has some other
ideas.

Thanks for the warning.

Simon.

"Martin v. Löwis"

unread,
Nov 22, 2005, 8:30:18 PM11/22/05
to
pianom...@gmail.com wrote:
> I have C Extension classes distributed across several modules with
> non-trivial interdependancies. I guess you are saying I should have
> these in backend libraries and then put the module specific functions
> in the module itself. It's going to be tricky because I am using
> distutils and pyrex to do all this. Maybe Greg (Ewing) has some other
> ideas.

Alternatively, if you are always shipping the entire set: make
them all a single extension module.

For backwards compatibility, provide Python modules with the "old"
module names, which export the symbols that used to be in that
module.

Regards,
Martin

0 new messages