From: Bruce S. <bas...@nc...> - 2010-07-20 16:56:50
|
Thanks much for the helpful information, Martin. Why don't I have problems building the native-mode version of VPython on the Mac, using either Python 2.5 or Python 2.6? The makefile I'm using contains -bundle_loader. Bruce Sherwood On Tue, Jul 20, 2010 at 3:56 AM, Martin Costabel <cos...@wa...> wrote: > 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 > > |