I’m running Mac OS X 10.5.1 and have Python 2.5.1 downloaded from fink. I also obtained ROOT through the SVN trunk (5.17/05). The manual specifies that you should set libdir to the folder that contains libpythonx.y.so. The problem is: this file doesn’t (seem to) exist! The closest thing I can find is libpython2.5.dylib which I don’t think counts. There’s also a libpython2.5.a. When I’ve run ./configure macosx --enable-python with specifications for libdir and incdir, it says Python’s enabled, but after make, I get a version mismatch? error.
I’m aware that version mismatch errors arise if there are more than one Python installation (I’ve run into those), and I’ve deleted MacPython / all the Python.framework stuff in System/Library, and all my Python info is in /sw via fink.
Is there anything to be done to import ROOT at the Python prompt? I realize the .so search is more of a fink issue, but is the only way to reinstall Python from the 10.5 disc, so that specifying this .so isn’t an issue?
creating a symlink libpythonx.y.so to the libpythonx.y.dylib should do the trick. The default install on Mac is to look for the Python framework though.
You get a version mismatch (rather common), because you have two pythons on your system and you’re running with one while building against the other.
Usually a link problem or runtime problem (LD_LIBRARY_PATH and/or DYLD_LIBRARY_PATH, I forget).
yes, that’s a foolproof way of getting the error you observe. You won’t find the problem with numpy likely because it does not link with libpython.
Can you move /sw/bin up in $PATH? I’m thinking that you get 2.5.1 from normal /System, and 2.5.0 from fink. Or run /sw/bin/python to start the fink one (and even if you installed 2.5.1 with fink, it should still be that the python that corresponds to the libpythonx.y lib is the one chosen).
An alternative is to rebuild libPyROOT w/o linking with libpythonx.y.so and adding that lib to $ROOTSYS/lib/libPyROOT.rootmap. I’ve got that recipe nailed on Linux, but still not finalized on Mac (for which I’m doing it …).
I moved it to the “front” of $PATH and rebuilt–no good. I did verify that the python command at the prompt is the one in /sw/bin/ though and it is 2.5.1 from fink. (frustrating since the .dylib is from this fink download!)
Could you outline how you do this (at least for Linux) and maybe I can get it to work on the Mac (PowerBook PPC G4)?
easiest way to do it directly is to change pyroot/Module.mk and add:PYTHONLIBDIR :=
PYROOTLIBDEPM := /sw/lib/libpython2.5.so
where I’m assuming that your libpython2.5.so is located in /sw/lib (it doesn’t really matter, though).
Then rm -rf $ROOTSYS/lib/libPyROOT.* and make again. After that, libPyROOT is no longer linked with python, and for use of TPython from CINT, the libPyROOT.rootmap file tells it to load libpython2.5.so.
P.S. The hard part is not the above, but having all behave properly in all cases (e.g. if no shared library exist, if there is a framework install, if additional libs such as util are needed, etc.).