PyROOT on OS X 10.8: libpython2.7 is not found

Hi,

I am trying to configure ROOT with Python support but it fails because configure script can not find python lib:

./configure macosx --enable-python --prefix=$PWD/try --etcdir=$PWD/try/etc/root ... Checking for Python.h ... /usr/local/Cellar/python/2.7.3/include/python2.7 Checking for python2.7, libpython2.7, libpython, python, or Python ... no ... Enabled support for asimage, astiff, bonjour, builtin_afterimage, builtin_ftgl, builtin_glew, builtin_pcre, builtin_lzma, cintex, explicitlink, fink, genvector, krb5, ldap, memstat, odbc, opengl, reflex, shared, ssl, tmva, x11, xft, xml. ...

I’ve also tried:

./configure macosx --enable-python --prefix=$PWD/try --etcdir=$PWD/try/etc/root --with-python-incdir=`python-config --prefix`/include/python2.7 --with-python-libdir=`python-config --prefix`/lib
But it leads to the same issue.

My setup is:

[code]python-config --prefix
/usr/local/Cellar/python/2.7.3

ll /usr/local/lib/libpython2.7.dylib
lrwxr-xr-x 1 samvel admin 45 Aug 3 16:41 /usr/local/lib/libpython2.7.dylib -> …/Cellar/python/2.7.3/lib/libpython2.7.dylib

ll /usr/local/Cellar/python/2.7.3/lib/libpython2.7.dylib
-r-xr-xr-x 1 samvel admin 2030792 Aug 3 16:41 /usr/local/Cellar/python/2.7.3/lib/libpython2.7.dylib[/code]

What am I doing wrong?

Note … this thread is a “continuation” of: [url]./configure does not find libpython2.7?

One more thing … what ROOT version are you trying to use exactly?
In the previous thread [url]Canvas does not show up in OSX 10.8 with XQuartz 2.7.2? “tpochep” mentions some recent modifications “in both trunk and 5-34 specially for Mac OS X 8”.
Maybe you could try to download the source of the head of the v5-34-00-patches branch:
svn co root.cern.ch/svn/root/branches/v5-34-00-patches root

Thanks @pepe for the summary and links.

I am trying to install ROOT v5.34.01. The XQuartz (X11) moved to /opt/X11 in OS X 10.8 and this may lead to ROOT installation/setup problems. However, it works fine in my case.

The problem, I guess, is in the Python installation and the fact ROOT can not find library for some reason. This is the problem I do not understand: why? The library seem to be there and Python is setup on the computer.

I’ve been comparing the output of different “python-config” commands between you and me …

I’ve got an idea … maybe you could try …
–with-python-incdir=python-config --prefix/include/python2.7
–with-python-libdir=python-config --prefix/lib/python2.7/config
… or maybe …
–with-python-libdir=python-config --prefix/lib/python2.7

That’s because I get (Python 2.6.5 on Ubuntu) …
python-config --prefix … /usr
python-config --includes … -I/usr/include/python2.6
python-config --ldflags … -L/usr/lib/python2.6/config

Thanks for looking into this. Unfortunately, the solution

does not work.

And do you have a subdirectory (or is it just Ubuntu’s peculiarity where they keep libraries and another configuration related files) …
python-config --prefix/lib/python2.7/config

I’ve got another idea … maybe you could attach here the “config.log” file which was created by the configure script (rename this file into “config.log.txt”) … this file should contain more detailed information what has failed when looking for the python’s library.

Another point … can it be that you try to compile a 32-bit ROOT, but your python’s library is a 64-bit one?

@pepe, the problem is solved. It was simply incompatibility of libs: python is generated for 64 while I was trying to compile ROOT for 32bits arch. :slight_smile: The right configuration is:

Thanks for your help.