Building on OSX


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/", line 85, in <module>
    import libPyROOT as _root
ImportError: dlopen(/usr/local/root_versions/root_v5.20.00.fromsource/lib/, 2): no suitable image found.  Did find:
        /usr/local/root_versions/root_v5.20.00.fromsource/lib/ mach-o, but wrong architecture
        /usr/local/root_versions/root_v5.20.00.fromsource/lib/ 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



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,

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-universalsdk=/ MACOSX_DEPLOYMENT_TARGET=10.5

and you might want

instead. Maybe that’s helpful.