[Pythonmac-SIG] Has anyone running vtk+python on OSX?
Jack Jansen
Jack.Jansen at cwi.nl
Sat Aug 2 00:58:27 EDT 2003
On vrijdag, aug 1, 2003, at 22:27 Europe/Amsterdam, Bob Ippolito wrote:
> There's three ways that I know of to do it:
> (1) Inject Mach-O loader commands into the .so's that have
> dependencies directly after compilation (something like
> install_name_tool but more dangerous, I could write one of these using
> the "potool" code I have)
> (2) Trick the linker by whatever means.. i.e. not using -l, or
> renaming to lib*.dylib then editing the Mach-O loaders with
> install_name_tool after the fact.
I think neither of these two will work. For one, Python extensions are
bundles (Mach-O bundles, not MacOSX bundles), not dynamic libraries.
If you want to use linker magic I would suggest building the modules
*except their init routines* into .dylibs, linking them against each
other as needed, and putting the init routines (linked against their
.dylib) in the .so bundles. But you may still need to fiddle
DYLD_LIBRARY_PATH at runtime:-(
> (3) Fix VTK to use the recommended Python way for inter-extension
> dependencies, like the way that numarray does it. Basically what you
> do is use Python to import the module containing the things you depend
> on. That module has a way of giving you various pointers to C
> functions, and you setup a jump table based upon that. See:
> http://stsdas.stsci.edu/numarray/Doc/node37.html
That's really the way to go, assuming numarray uses cobjects in stead
of the string hack that was used in Numeric.
--
- Jack Jansen <Jack.Jansen at oratrix.com>
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma
Goldman -
More information about the Pythonmac-SIG
mailing list