From: Martin C. <cos...@wa...> - 2010-07-20 09:56:58
|
Bruce Sherwood wrote: > The missing links all seem to be Python symbols such as > _PyExc_RuntimeError and _PyInt_AsLong, which are part of the Python > API for connecting to C. I don't have any experience with the darwin > environment, but maybe someone on this list will recognize what the > problem is. It is a problem with python-2.6. There the python executable does not export the symbols such as PyExc_RuntimeError any more, as it did until python2.5. Up to python2.5, the external symbols in the python executable were identical to those in the python library libpython. The recommended way to link python modules on MacOSX (and this is what is coded in src/Makefile.in) was to use the "-bundle_loader $PYTHON" flag, meaning that symbols in the module were resolved from the python executable. Linking with the python library instead led to a runtime error "interpreter version mismatch". On python2.6 (I haven't looked at later versions yet), this is different. Now the python executable itself is linked with the python library. You need to link the module with the flag "-undefined dynamic_lookup" instead of -bundle_loader. At runtime, the symbols are then looked up from the python library. For the Fink visual-py26 package, I am patching src/Makefile.in correspondingly. I have not found a way to link cvisualmodule.so that would work both with (Fink's) python2.5 and python2.6. -- Martin |