473,387 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1841
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. 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.

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Fortepianissimo | last post by:
Just started learning how to write a C extension module on Mac OS X. Here is a simple module taken from Programming Python: --- #include <Python.h> #include <string.h> /* module functions */...
5
by: scott | last post by:
First my setup: I'm using the framework build of Python 2.4.1 ( http://bob.pythonmac.org/archives/2005/03/31/macpython-241-installer/ ) on an ibook G4 running Mac OS 10.3.8. I installed...
2
by: donbro | last post by:
If my read of the extension source (Mac/Modules/file/_Filemodule.c) is correct, the parameter sizes specified for data and resource file sizes are UInt32 where they should be UInt64. In both OS9...
4
by: David Garamond | last post by:
Has anyone tried using inet or cidr for storing GUID (or for storing 128bit numbers or hashes or similar stuffs)? It has a nice property in that one can use hexadecimal notation (like...
0
by: Epislicky | last post by:
Hello guys. I am a sound engineer and i have a personnal problem with my iPOD. It was formatted under mac osX. So as to be able to use it with my pc, i just bought this software called...
13
by: 7stud | last post by:
test1.py: -------------------- import shelve s = shelve.open("/Users/me/2testing/dir1/aaa.txt") s = "red" s.close() --------output:------ $ python test1.py
1
by: Prof Rodney Coates | last post by:
Although I have been using Macs for a quarter of a century and was doing scientific programming in the '60's I am VERY new to Python on the Mac. I have been writing some very simple applications and...
3
by: MacRules | last post by:
Typically, what DB2 components (clinet) have the essential DBA tool (control center)? I have Apple PowerMac dual CPUs, does IBM have plan to support DB2 on Mac OSX? Thanks
0
by: Martin Landa | last post by:
Hi, I am writing Python extension in C++, in this extension I am using methods from another Python extension. On Linux I am currently linking my extension with used Python extension -- what is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.