I’m going to see whether I can get hold of a Tiger on Monday (several of my colleagues use it, but it’s usually their main machine, so they may be reluctant ).
There’s nothing more that I can do, until it is possible to reproduce the problem.
~>$ /usr/local/bin/python
Python 2.4.3 (#1, Mar 30 2006, 11:02:15)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/Users/exaos/Opt/root/current/lib/ROOT.py", line 74, in ?
from libPyROOT import *
ImportError: Inappropriate file type for dynamic loading
I’m sure that $ROOTSYS/lib is in my $LD_LIBRARY_PATH, $DYLD_LIBRARY_PATH and $PYTHONPATH. And anything else?
Can anyone reproduce the problem?[/code]
ok, managed to reproduce and work around the problem. It is in the python installation itself. For reasons that I do not know (it is hard-wired for Darwin in the configure script), the python 2.4 install uses dynload_next.o rather than dynload_shlib.o as is used by the Tiger out-of-the-box python 2.3 install (both dynload_next.c and dynload_shlib.c are part of the python distribution). Modifying the python 2.4 Makefile and rebuilding did the trick.
For your installers, you can probably use the setting of an environment variable (I tested running “./configure --enable-shared --enable-framework” and saw that it was picked up). Please do:$ export DYNLOADFILE=dynload_shlib.oor the equivalent setenv if you’re running a shell in the *csh family. After, or preferably before, building, verify that the produced Makefile has the right value (do “grep DYNLOADFILE Makefile”), or change it by hand and rebuild.
I’ve rebuilt my python with the following in the configure environment
DYNLOADFILE=dynload_shlib.o
and with building ROOT against this python ROOT.py imports without issue!
[code][ram@zebedee ram]$ python
Python 2.4.3 (#1, May 19 2006, 11:59:36)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
Hi, I have a macbook and an intel Imac, and I have the same problem with the universal macpython on both, so I tried to rebuild it as suggested. The problem is that if I “./configure --enable-framework” for python 2.4.3 and then make it, I get the error
[quote]/usr/bin/ld: warning Python.framework/Versions/2.4/Python cputype
(18, architecture ppc) does not match cputype (7) for specified -
arch flag: i386 (file not loaded)[/quote]
I don’t have such error if I don’t configure python as framework, but unfortunately the framework seems necessary.
I have been exchanging some emails with the python support but they could’t replicate the problem, so I’d like to ask you. How did you manage to rebuild python on intel mac?
sorry, I don’ t have access to an Intel mac. Not sure whether any of my colleagues already have them (one does, but he’s leaving for CERN again tomorrow).
Note that it isn’t per se necessary to install a framework, just that I had best experience with that and so recommend it. However, I’ve also been successful with installation under /sw with Fink. In that case, you can specify the include (location of Python.h) and library (location of libpythonx.y) directories explicitly with --with-python-incdir=… and --with-python-libdir=… as arguments to ./configure.
so: now everything seems to work smoothly: python starts with the right version and root starts perfectly but when I import root fro python I get a new error:
[code]Python 2.4.3 (#1, Jun 30 2006, 11:44:46)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
this environment variable:export DYLD_LIBRARY_PATH=$ROOTSYS/lib
should contain the path to the newly installed libpython.so as well (/usr/local/lib if I understand your posting correctly). If there is no shared library (should be there by default since p2.3), you can use --enable-shared when configuring the python source for build.
[code]Python 2.4.3 (#2, Jun 30 2006, 23:58:40)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
import ROOT
Fatal Python error: Interpreter not initialized (version mismatch?)
Abort trap
[/code]
or did I misunderstand something?
cheers,
Emanuele