PyRoot on mac osx 10.6

Hi Philippe,

sorry, but I removed that build, because I tried many other combinations of setup.
So you can be right, that particular combination could be mis-configured.

But now looking on old posts I found that one: root.cern.ch/phpBB2/viewtopic.ph … c&start=15

So apparently there is a mismatch between the architectures.

Actually I tried now to run the ./configure without any options, and then compiled. The libpyroot is thus built for

RM-Bianchis-MacBook:~ rmbianchi$ file /opt/root/root_python265/lib/libPyROOT.so /opt/root/root_python265/lib/libPyROOT.so: Mach-O 64-bit dynamically linked shared library x86_64
RM-Bianchis-MacBook:~

In this case the ARCH macosx64 is automatically selected (why? is the Apple default?) and then I’m not able to import ROOT from the new python installation (2.6.5) because of a “wrong architecture version”, but I’m able to import it from the built-in system python (2.6.1):

custom python installation from python.org (not working):

RM-Bianchis-MacBook:~ rmbianchi$ python
Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/root/root_python265/lib/ROOT.py", line 86, in <module>
    import libPyROOT as _root
ImportError: dlopen(/opt/root/root_python265/lib/libPyROOT.so, 2): no suitable image found.  Did find:
	/opt/root/root_python265/lib/libPyROOT.so: mach-o, but wrong architecture
	/opt/root/root_python265/lib/libPyROOT.so: mach-o, but wrong architecture
	/opt/root/root_python265/lib/libPyROOT.so: mach-o, but wrong architecture
>>> 

system python installation shipped with Snow Leopard (working):

RM-Bianchis-MacBook:~ rmbianchi$ file /opt/root/root_python265/lib/libPyROOT.so
/opt/root/root_python265/lib/libPyROOT.so: Mach-O 64-bit dynamically linked shared library x86_64
RM-Bianchis-MacBook:~ rmbianchi$ /usr/bin/python
Python 2.6.1 (r261:67515, Jul  9 2009, 17:39:10) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>> h1 = ROOT.TH1F()
>>>

So apparently the ./configure command picks the system python, even if “which python” points to the custom python installation.

So I do not understand how could I make it work for a standard .dmg installation from python.org.

Should I compile python from source for 32 bit instead of 64??

Thanks again for your help,

Ric.