Building on OSX

Hello

I’m building on OSX 10.5.4

I compiled root_v5.20.00 using enable_python option (setting ROOTSYS to where I placed the package).

Now I try import ROOT from python and get

>>> from ROOT import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/root_versions/root_v5.20.00.fromsource/lib/ROOT.py", line 85, in <module>
    import libPyROOT as _root
ImportError: dlopen(/usr/local/root_versions/root_v5.20.00.fromsource/lib/libPyROOT.so, 2): no suitable image found.  Did find:
        /usr/local/root_versions/root_v5.20.00.fromsource/lib/libPyROOT.so: mach-o, but wrong architecture
        /usr/local/root_versions/root_v5.20.00.fromsource/lib/libPyROOT.so: mach-o, but wrong architecture

I don’t get this error when I’m using the binary version I got from ROOT but I need to compile by myself now.

Thanks for help

Akira

Akira,

sorry for responding so late; I’ve been away for a bit.

What you see here is a mismatch between 32b and 64b. I do not have access to a 10.5 Mac, but what I understood was that the python binary on 10.5 is 32b, b/c most .so’s downloaded from the web are 32b, and so this would be convenient to the user. Your own build of ROOT, however, is likely to be 64b, and so there’s a mismatch.

Best regards,
Wim

Regarding this thread, I have FFTW and ROOT all built for 64bit mode. Instead of re-building them I wanted to rebuild python to work. The default python from MacPython looks like:

$ file which python
/usr/bin/python: Mach-O universal binary with 2 architectures
/usr/bin/python (for architecture ppc7400): Mach-O executable ppc
/usr/bin/python (for architecture i386): Mach-O executable i386

while my ROOT looks like
$ file which root.exe
/Users/cranmer/projects/RooStats/svn/roostats-branch/root/bin/root.exe: Mach-O 64-bit executable x86_64

If you download the python source, when you configure do something like:

./configure --prefix=/usr/local/python-2.5.4
–enable-framework=/usr/local/python-2.5.4/frameworks
–enable-universalsdk=/ MACOSX_DEPLOYMENT_TARGET=10.5
–with-universal-archs=all

and you might want
–with-universal-archs=intel

instead. Maybe that’s helpful.