By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,034 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

linking one extension module to another (Mac OSX)

P: n/a

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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a

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

P: n/a
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.