Can't use root objects after building v5.16 from source

After asking my previous question about the color scheme, I downloaded ROOT v5.16 and compiled from the source, the same way I had done for version 5.14. Now PyROOT doesn’t work, namely:

[pwa@hnpux3 root]$ python
Python 2.5.1 (r251:54863, Sep 29 2007, 18:25:15) 
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>> tV = ROOT.TLorentzVector(0,0,0,0)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
Attaching to program: /proc/13975/exe, process 13975
[Thread debugging using libthread_db enabled]
[New Thread -1211287888 (LWP 13975)]
0xffffe410 in __kernel_vsyscall ()
error detected on stdin
The program is running.  Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/13975/exe, process 13975
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "lib/ROOT.py", line 341, in __getattr1
    self.__finalSetup()
  File "lib/ROOT.py", line 384, in __finalSetup
    if c.CreatePyROOTApplication():
SystemError: problem in C++; program state has been reset

The “import” statement works so the paths are all set up. I also configured it with the exact same options I used to compile version 5.14. Any ideas?

Hi,

no idea, but can you give this code sample a try:[code]>>> from ROOT import *

tV = TLorentzVector(0,0,0,0)[/code]
which changes the initialization order significantly and may offer some insights.

Thanks,
Wim

in “classic ROOT” need first load library:gSystem->Load("libPhysics.so") tV = TLorentzVector(0,0,0,0)
Jan

A-ha…

[pwa@hnpux3 craigb]$ python
Python 2.5.1 (r251:54863, Sep 29 2007, 18:25:15) 
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import *
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
Attaching to program: /proc/21920/exe, process 21920
[Thread debugging using libthread_db enabled]
[New Thread -1211775312 (LWP 21920)]
0xffffe410 in __kernel_vsyscall ()
error detected on stdin
The program is running.  Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/21920/exe, process 21920
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/d/home/pwa/apps/root/lib/ROOT.py", line 341, in __getattr1
    self.__finalSetup()
  File "/d/home/pwa/apps/root/lib/ROOT.py", line 384, in __finalSetup
    if c.CreatePyROOTApplication():
SystemError: problem in C++; program state has been reset

So…?

Hi,

puzzling … Well, if that doesn’t work, I don’t really have ideas. All it does so far, is to instantiate the TApplication, which isn’t much. One more test might be:[code]$ python - -b

from ROOT import *[/code]
where the idea is solely that in batch mode, the instantiation of TApplication will do even less, so if it still crashes, it’s more than likely a local setup problem.

Just to be sure, can you also verify the results of ldd $ROOTSYS/lib/libPyROOT.so as well as making sure that you’re running (LD_LIBRARY_PATH and PYTHONPATH) with the same version of ROOT that you used for the build. Thanks.

Cheers,
Wim

[pwa@hnpux3 ~]$ python - -b
Python 2.5.1 (r251:54863, Nov  6 2007, 10:42:04) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import *
>>> tV = TLorentzVector(0,0,0,0)
>>> print "wtf?!"
wtf?!
>>> 

So now I am really confused. Running ldd shows that ROOT’s loading my freshly-built libraries and not something unexpected. Another possible hiccup is that I upgraded to the latest Ubuntu, but that shouldn’t affect anything if I recompiled both Python and ROOT with no problems.

Hi,

ok … but now you’ve changed 3 things: run with -b, freshly built python, and a new compiler. Anyway, just to be sure, does it still work without ‘- -b’? Is so, great! If not, then there is a problem with setting up the X windowing.

Cheers,
Wim

I’ve been recompiling both ROOT and python in the meantime to make sure I didn’t make a dumb mistake during the build process. But no, a fresh build of both python and ROOT, even in a clean environment, does not solve the problem. It works in batch mode but not in regular mode, just as above. If you say that there’s a problem setting up windowing, I might agree–Ubuntu’s latest version includes some new windowing stuff:

(from the “Gutsy Gibbon” feature plan)

That probably doesn’t have anything to do with it but you never know.

Alright before you waste time thinking any more about this, I got it to work using “import ROOT”, but not “from ROOT import *”. I’ll post later with details if I can work it out.