Problems with PyROOT and Cygwin

Hello,

I am trying to get a working set of root and PyROOT, working under Windows XP. I think I have things set up right, and have installed the win32gcc version of ROOT (4.02)

Does anyone have any ideas/pointers?

Thanks, Duane

dkaufman@minsk /cygdrive/c/root
$ echo $LD_LIBRARY_PATH
/cygdrive/c/root/lib:/usr/lib:/usr/X11R6/lib

dkaufman@minsk /cygdrive/c/root
$ echo $ROOTSYS
/cygdrive/c/root

dkaufman@minsk /cygdrive/c/root
$ echo $PYTHONPATH
/cygdrive/c/root/lib::/usr/lib/python2.2:/opt/gnome/lib/gnome-python

dkaufman@minsk /cygdrive/c/root
$ python
Python 2.4 (#1, Dec 4 2004, 20:10:33)
[GCC 3.3.3 (cygwin special)] on cygwin
Type “help”, “copyright”, “credits” or “license” for more information.

import ROOT
Traceback (most recent call last):
File “”, line 1, in ?
File “/cygdrive/c/root/lib/ROOT.py”, line 39, in ?
from libPyROOT import *
ImportError: No module named libPyROOT

Hi Duane,
the error message you get is wrong :-] The cygwin binaries cannot work with python 2.4; libPyROOT depends on libpython2.3.dll (“cygcheck $ROOTSYS/bin/libPyROOT.dll” tells you).

You have two options: downgrade your cygwin installation to python 2.3 (if still available), or build the root binaries from sources yourself. There’s even some documentation on that - even though it’s very easy nowadays. For my root build (cvs version, same python 2.4 as you have) python works without any problems.
Axel.

Hi,

Thanks for the response! Taking you up, I installed ROOT from CVS, and tried to build. I ran into problems…

g++ -pipe -Wall -Woverloaded-virtual -D_DLL -Iinclude -I/usr/X11R6/include -D_
REENTRANT -I. -I/usr/X11R6/include
-o gl/src/G__GL.o -c gl/src/G__GL.cxx
build/unix/wingcc_ld.sh -shared -Wl,-soname,libRGL.dll -O3 -foptimize-sibling-ca
lls -finline-functions -Wl,–enable-auto-image-base -Wl,–export-all-symbols -L/
usr/X11R6/lib -o lib/libRGL.dll gl/src/TGLKernel.o gl/src/TViewerOpenGL.o gl/src
/TArcBall.o gl/src/TGLRenderArea.o gl/src/TGLSceneObject.o gl/src/TGLRender.o gl
/src/TGLCamera.o gl/src/TGLEditor.o gl/src/TGLFrustum.o gl/src/TX11GL.o gl/src/g
l2ps.o gl/src/G__GL.o -Llib -lGpad -lGraf3d -lGui -L/usr/X11R6/lib -lGLU.dll -lG
L.dll -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXi -lm -Llib -lCore -lCint
Warning: resolving _glGetIntegerv@8 by linking to _glGetIntegerv
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _glRenderMode@4 by linking to _glRenderMode
Warning: resolving _glGetBooleanv@8 by linking to _glGetBooleanv
Warning: resolving _glGetFloatv@8 by linking to _glGetFloatv
Warning: resolving _glBegin@4 by linking to _glBegin
Warning: resolving _glVertex3f@12 by linking to _glVertex3f
Warning: resolving _glEnd@0 by linking to _glEnd
Info: resolving _gROOT by linking to __imp__gROOT (auto-import)
Info: resolving vtable for TVirtualGLby linking to __imp___ZTV10TVirtualGL (auto
-import)
Info: resolving vtable for TNamedby linking to __imp___ZTV6TNamed (auto-import)
Info: resolving _gSystem by linking to __imp__gSystem (auto-import)
Info: resolving _gClient by linking to __imp__gClient (auto-import)
Info: resolving vtable for TVirtualViewer3Dby linking to __imp___ZTV16TVirtualVi
ewer3D (auto-import)
Info: resolving vtable for TGLayoutHintsby linking to __imp___ZTV13TGLayoutHints
(auto-import)
Info: resolving vtable for TGVerticalFrameby linking to __imp___ZTV15TGVerticalF
rame (auto-import)
Info: resolving _gHelpAbout by linking to __imp__gHelpAbout (auto-import)
Info: resolving vtable for TCollectionby linking to __imp___ZTV11TCollection (au
to-import)
Info: resolving vtable for TSeqCollectionby linking to __imp___ZTV14TSeqCollecti
on (auto-import)
Info: resolving vtable for TListby linking to __imp___ZTV5TList (auto-import)
Info: resolving _gTQSender by linking to __impCreating library file: lib/libRGL.
dll.a
gl/src/gl2ps.o(.text+0x262b):gl2ps.c: undefined reference to _glIsEnabled@4' gl/src/gl2ps.o(.text+0x2877):gl2ps.c: undefined reference to_glFeedbackBuffer@
12’
gl/src/gl2ps.o(.text+0x3e28):gl2ps.c: undefined reference to _glPassThrough@4' gl/src/gl2ps.o(.text+0x3e94):gl2ps.c: undefined reference to_glPassThrough@4’
gl/src/gl2ps.o(.text+0x3ea6):gl2ps.c: undefined reference to _glPassThrough@4' gl/src/gl2ps.o(.text+0x3eca):gl2ps.c: undefined reference to_glPassThrough@4’
gl/src/gl2ps.o(.text+0x41ac):gl2ps.c: undefined reference to _glPassThrough@4' gl/src/gl2ps.o(.text+0x41e9):gl2ps.c: more undefined references to_glPassThrou
gh@4’ follow
__gTQSender (auto-import)
Info: resolving vtable for TVirtualGLImpby linking to __imp___ZTV13TVirtualGLImp
(auto-import)
Info: resolving vtable for TQClassby linking to __imp___ZTV7TQClass (auto-import
)
collect2: ld returned 1 exit status
make: *** [lib/libRGL.dll] Error 1

duanek@Duanes_Tablet /cygdrive/c/root_src/root
$

Any ideas?

Thanks,
Duane

Hi Duane,
I can reproduce this - I haven’t updated my ROOT sources for a few days, now that I have I see the same problem. It’s a name decoration mismatch, which for some symbolds doesn’t get resolved. While I’m trying to find out how to fix that, calling ./configure --disable-opengl will allow the build to go through. As I said, I’m trying to resolve the issue; this is really only a work-around.
Axel.

Hey,

[thanks to Axel for the help so far]

Now, I wouldn’t recommend it, but it would work if you symlink your libpython2.4.dll as libpython2.3.dll (you’d get a pesky warning message, but there are no API incompatibilities that I know of). However, in your PYTHONPATH:

[quote]$ echo $PYTHONPATH
/cygdrive/c/root/lib::/usr/lib/python2.2:/opt/gnome/lib/gnome-python[/quote]

you’re probably better off removing “/usr/lib/python2.2” (python2.4, as you run it, will be able to find its own modules by itself).

Finally, this error message:

[quote] from libPyROOT import *
ImportError: No module named libPyROOT
[/quote]

really does mean what it says (if it can’t resolve the dependent libraries, it’ll tell you), so please check whether or not the libPyROOT.so file can be located through your PYTHONPATH. That is, whether or not it is installed in “/cygdrive/c/root/lib”?

HTH,
Wim

Hi Wim,

Of course I tried that :-] Gives a coredump - not too surprising, as the linking on win depends on the actual library.

Axel.

Axel,

Duh, … :confused: I do it occasionally on linux when I’m too lazy to reconfigure and rebuild for another version of python. I wasn’t aware of the differences on windows.

Thanks.
Wim

[quote=“Axel”]Hi Duane,
I can reproduce this - I haven’t updated my ROOT sources for a few days, now that I have I see the same problem. It’s a name decoration mismatch, which for some symbolds doesn’t get resolved. While I’m trying to find out how to fix that, calling ./configure --disable-opengl will allow the build to go through. As I said, I’m trying to resolve the issue; this is really only a work-around.
Axel.[/quote]

Ah! good (it isn’t just me)!

Yes, disabling opengl did the trick. Good for now,

Duane

Hi Duane,
the fix for opengl on win32gcc is in CVS. Thanks for reporting the problem.

Make sure you have the cygwin packages opengl and freeglut installed, “cvs -z3 up”, re-run your ./configure line (without the disable-opengl switch; you can find your current configure params in config.status), then “make gl-clean”, “make”.
Axel.

[quote=“Axel”]Hi Duane,
the fix for opengl on win32gcc is in CVS. Thanks for reporting the problem.

Make sure you have the cygwin packages opengl and freeglut installed, “cvs -z3 up”, re-run your ./configure line (without the disable-opengl switch; you can find your current configure params in config.status), then “make gl-clean”, “make”.
Axel.[/quote]

Works for me now.

Thanks,
Duane