Re: problems build root on OSX against non-system python version

From: Chris Jones <jonesc_at_hep.phy.cam.ac.uk>
Date: Wed, 14 Sep 2011 17:03:37 +0100


Hi,

OK, a bit of progress..

The problem was previously when I tried to install the python26 variant, I had not run

sudo port select python python26

before hand, if I do this, then run

./configure --with-python-incdir=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 --with-python-libdir=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config --enable-python

I get

Checking for Python.h ... /opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 Checking for python2.6, libpython2.6, libpython, python, or Python ... /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config

so it worked fine. If I try with the alternative you suggest below

./configure --with-python-incdir=/opt/local/Library/Frameworks/Pythude/python2.6 --with-python-libdir=/opt/local/Library/Frameworks/Python.framework/Versions/2.6 --enable-python

I get

Checking for Python.h ... /opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 Checking for python2.6, libpython2.6, libpython, python, or Python ... /opt/local/Library/Frameworks/Python.framework/Versions/2.6

So also seems to work…

Anyway. The problem I have has now changed a bit. I can now install any python variant I want, as long as I run

sudo port select python python<XY>

first.

I still maintain my basic argument that it is not ideal for root to just assume 'python' found via the PATH is always the right binary to use. Not all macPorts python users use the 'port select' means to run a given python version. It is perfectly valid to just run the versioned binaries instead.

Chris-Jones-Macbook-Pro ~/Projects/root > python2.6 Python 2.6.7 (r267:88850, Aug 29 2011, 15:45:15) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>
Chris-Jones-Macbook-Pro ~/Projects/root > python2.7 Python 2.7.2 (default, Aug 29 2011, 15:26:16) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>

However, at least with the 'port select' trick I now have a workaround to allow users to get their favourite python variant of root installed ;)

Chris

On 14 Sep 2011, at 4:09pm, <wlavrijsen_at_lbl.gov> <wlavrijsen_at_lbl.gov> wrote:

> Chris,
>
> so I had a chance to look at my own MacPorts installation and I find that the
> paths that you provided to configure:
>
> ./configure
> --with-python-incdir=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
> --with-python-libdir=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config --enable-python
>
> don't work for my MacPorts (no linkable library is found). I need:
>
> ./configure
> --with-python-incdir=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
> --with-python-libdir=/opt/local/Library/Frameworks/Python.framework/Versions/2.6 --enable-python
>
> and then both the header (Python.h) and library (Python) are found and p2.6
> is selected as required.
>
> I also note that my MacPorts really does not have a "python" symlink or
> executable. Meaning, if anyone where to do:
>
> $ python
> >>> import ROOT
>
> with the MacPorts build of ROOT, it won't work, which is going to end up
> being confusing, I'll bet (see the large number of posts on the ROOT forum
> whenever non-system pythons are used on the Mac).
>
> Best regards,
> Wim
> --
> WLavrijsen_at_lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
>

Received on Wed Sep 14 2011 - 18:03:45 CEST

This archive was generated by hypermail 2.2.0 : Wed Sep 14 2011 - 23:50:01 CEST