Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > linking one extension module to another (Mac OSX)

Reply
Thread Tools

linking one extension module to another (Mac OSX)

 
 
Simon Burton
Guest
Posts: n/a
 
      11-22-2005

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.

 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      11-22-2005
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
 
Reply With Quote
 
 
 
 
pianomaestro@gmail.com
Guest
Posts: n/a
 
      11-22-2005

Martin v. L÷wis 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.

 
Reply With Quote
 
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      11-23-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Static array defined in one module, but used in another module pozzugno@gmail.com C Programming 6 10-24-2012 07:30 PM
MVC2: linking from one area view to another area view Andy B. ASP .Net 0 04-30-2010 07:46 AM
Extension which depends on another extension Jeff Mitchell Ruby 3 06-17-2004 02:35 AM
linking from one portlet to another portlet in the same page Michael Meyer Java 0 08-22-2003 12:17 PM
Passing value from one script on one page to another script on another page. Robert Cohen ASP General 3 07-15-2003 01:46 PM



Advertisments