468,765 Members | 1,279 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

linking one extension module to another (Mac OSX)


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.

Nov 22 '05 #1
3 1608
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
Nov 22 '05 #2

Martin v. Lwis wrote:
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


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.

Nov 22 '05 #3
pi**********@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
Nov 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Fortepianissimo | last post: by
5 posts views Thread by scott | last post: by
4 posts views Thread by David Garamond | last post: by
13 posts views Thread by 7stud | last post: by
3 posts views Thread by MacRules | last post: by
reply views Thread by Martin Landa | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.