Problem loading Pythia library on cygwin

Hi - I am having a problem loading libEGPythia6 in cygwin (root version 3.10, latest cygwin, gcc 3.3.3). Here are the specifics.

  • I download the source from here and compile and copy it to $ROOTSYS/lib

  • I then define the env. variable, configure Root and run make as follows:

dan> setenv PYTHIA6 $ROOTSYS/lib
dan> cp $ROOTSYS/lib/ $ROOTSYS/lib/libPythia6.dll
dan> ./configure win32gcc
   Checking for libPythia6 ... /home/dan/root/lib
dan> make
  • Root compiles fine and generates libEG.dll and libEGPythia6.dll.

  • Then I run root and try to load the libraries:

dan> root -l
root [0] gSystem->Load("libEG")
root [1] gSystem->Load("libPythia6")
root [2] gSystem->Load("libEGPythia6")
dlopen error: dlopen: Win32 error 126
Load Error: Failed to load Dynamic link library /home/dan/root/lib/libEGPythia6.dll
*** Interpreter error recovered ***

The libEGPythia6.dll library is certainly there. I’ve worked on this for quite awhile without solving the problem. Since I’ve been using this combination of Root/cygwin/gcc for a few months without any problems, I don’t know what to try next… thanks for any help.


I found the solution to my problem. Apparently I needed to place libPythia6.dll in [color=maroon]$ROOTSYS/bin[/color] for libEGPythia6.dll to find it… when it was in [color=maroon]$ROOTSYS/lib[/color] I got the error message.

Hi Dan,
well done, that’s exactly it. If you look carefully (i.e. ls -l) you’ll see that the dlls are all in bin, and lib just softlinks them.

I had seen that the dll’s were softlinks to $ROOTSYS/bin, but that made me think that Root (and any dll’s) would look to lib for other dll’s, or else no need for the soft links. It is a little strange that a dll looks to /bin, isn’t it?

Anyway I solved the problem (after a few google searches!) by using the command cygcheck libEGPythia6.dll, which indicated the missing library.

Thanks, Dan

here’s how and why:
cygwin is mainly windows, with things ontop. And as such it looks in %PATH for binaries (and, for windows, dlls are just that). One could specify $LD_LIBRARY_PATH in cygwin, which extends dlopen to also look in other dirs (or only in $LD_LIBRARY_PATH? Hmm, never tried that).

When you tell ROOT to load libs, and at start-up, when it loads a basic set of libs, it looks for them in $ROOTSYS/lib. Also, when linking (e.g. using Aclic) it looks for the import libs (.dll.a) and the dlls themselves in $ROOTSYS/lib. So having softlinks was the cleanest solution.
Cheers, Axel.