Running Pythia8 with ROOT

Dear ROOT developers,

I am trying to run Pythia8 (v8142) with ROOT (v5.27) on mac OS X 10.6 (64 bit). Following the instructions on the PYTHIA8 web-page, ROOT usage (home.thep.lu.se/~torbjorn/php814 … ath=files/), i first tried to run the first example (pythia8.C). It gave the standard Pythia output summary and an output canvas with two filled histograms. However, i found there was an error with the lib loading at the beginning,

=========================================================
Error in TUnixSystem::DynamicPathName: $PYTHIA8/lib/libpythia8[.so | .sl | .dl | .a | .dll] does not exist in /Users/andreyoon/Root/root/lib:/Users/andreyoon/Root/root/lib::.:/Users/andreyoon/Root/root/lib::/Users/andreyoon/Root/root/cint/cint/st

After forcing the shared libraries suffix to be either of .so/sl/dl/a/dll during Pythia8 compilation, the error message does not appear, but it crashes with segmentation violation. It seems Pythia8 MakeFile was not running for Mac OS (Running pythia 8 as a plug in), is it still the case?

For the second example (ex1.C), when i ran (goex1) script that is supposed to create shared libraries with Pythia8 interface, i got the error message below, which i found it very similar to the error message reported in (Pythia8 as a ROOT Plugin). Looking at the posting, it is not clear whether the error (and segmentation violation) could be avoided in the end. It will be very nice if you could help me figuring out. Thanks,

Best regards,

  • Andre

===========================================================
pythiaDict.cxx: In function ‘int G__pythiaDict_414_0_14(G__value*, const
char*, G__param*, int)’:
pythiaDict.cxx:5583: error: invalid initialization of reference of type
‘const Pythia8::Particle&’ from expression of type ‘Pythia8::Vec4’
/Users/andreyoon/Research/pythia/pythia8142/include/Event.h:288: error: in
passing argument 1 of ‘double Pythia8::m(const Pythia8::Particle&, const
Pythia8::Particle&)’
pythiaDict.cxx: In function ‘int G__pythiaDict_414_0_15(G__value*, const
char*, G__param*, int)’:
pythiaDict.cxx:5589: error: invalid initialization of reference of type
‘const Pythia8::Particle&’ from expression of type ‘Pythia8::Vec4’

I do not see any problem running pythia4122 with ROOT5.27 and example ex1/goex1.
Did you install ROOT with a configuration referencing pythia8142?

Rene

Dear Rene,

I’ve installed ROOT following the instructions on the ROOT usage page in Pythia8 web-page;
I first defined an environment variable for Pythia8 and configured ROOT with the options

–enable-pythia8
–with-pythia8-incdir=$PYTHIA8/include
–with-pythia8-libdir=$PYTHIA8/lib

After compiling I see libEGPythia8.so and libEGPythia8.rootmap in the /root/lib directory, and the first example ran okay in spite the fact that there was this error.

=========================================================
Error in TUnixSystem::DynamicPathName: $PYTHIA8/lib/libpythia8[.so | .sl | .dl | .a | .dll] does not exist in /Users/andreyoon/Root/root/lib:/Users/andreyoon/Root/root/lib::.:/Users/andreyoon/Root/root/lib::/Users/andreyoon/Root/root/cint/cint/st

So, I presume that ROOT is installed with a configuration referencing pythia8142. Is there a simple way to check if the referencing is done properly?

Best regards,

  • Andre

Hi Andre,

[quote]Error in TUnixSystem::DynamicPathName: $PYTHIA8/lib/libpythia8[.so | .sl | .dl | .a | .dll] [/quote]Is PYTHIA8 defined in your shell environment ?

Philippe.

Hi Philippe,

Thanks for your reply, I’ve defined PYTHIA8 in my shell environment;

export PYTHIA8=/…/pythia8142
export PYTHIA8DATA=$PYTHIA8/xmldoc

However, one thing i noticed in $PYTHIA8/lib is that there isn’t a file with an extension in the any of the following format [.so | .sl | .dl | .a | .dll]. Rather, i see the following two files;

liblhapdfdummy.dylib
libpythia8.dylib

So, i was suspecting maybe this was to do with running things on MAC.

Best regards,

  • Andre

[quote=“pcanal”]Hi Andre,

[quote]Error in TUnixSystem::DynamicPathName: $PYTHIA8/lib/libpythia8[.so | .sl | .dl | .a | .dll] [/quote]Is PYTHIA8 defined in your shell environment ?

Philippe.[/quote]

In $PYTHIA8/lib copy all *.dylib to *.so

Rene

Hi Rene,

After copying all *.dylib to *.so, the aforementioned error regarding the shared lib is avoided,

However, a segmentation violation is encountered, which i originally observed when i forced the shared lib file to have *.so extension during compilation. (By looking at the Pythia output, it seems the segmentation violation occurs before the multiple interaction initialization is done.) Any suggestions?

Best regards,

  • Andre

I assume that you have compile pythia8 with the -fPIC option. This option was unfortunately missing in the Pythia makefile but Torbjorn fixed it on my request in version 8142 and I do not see any problem with this version.
Are you sure that you do not mix includes of different versions of Pythia.
Could you erase the pythiaDict.cxx file and try again?

Rene

[color=#0000FF]Having a similar problem:[/color]
OSX 10.6.4
g++ 4.2.1

echo $PYTHIA8
/Users/linn/Applications/pythia8142

Pythia build:
./configure --enable-shared
make

root build
./ configure
–enable-pythia8
–with-pythia8-incdir=$PYTHIA8/include
–with-pythia8-libdir=$PYTHIA8/lib
make

stephan-linns-macbook-pro-2:Pythia linn$ root


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.27/06 29 September 2010 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      [root.cern.ch](http://root.cern.ch)            *
    
  •                                     *
    

ROOT 5.27/06 (trunk@35856, Sep 29 2010, 11:29:35 on macosx64)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x pythia8.C
Error in TUnixSystem::DynamicPathName: $PYTHIA8/lib/libpythia8.so does not exist in /Users/linn/Applications/root/lib:/Users/linn/Applications/HEPMC/lib:/Users/linn/Applications/root/lib::/Users/linn/Applications/HEPMC/lib:/Users/linn/Applications/root/lib::.:/Users/linn/Applications/root/lib::/Users/linn/Applications/root/cint/cint/stl
dlopen error: dlopen(/Users/linn/Applications/root/lib/libEGPythia8.so, 9): Library not loaded: libpythia8.dylib
Referenced from: /Users/linn/Applications/root/lib/libEGPythia8.so
Reason: image not found
Load Error: Failed to load Dynamic link library /Users/linn/Applications/root/lib/libEGPythia8.so
(int)(-1)
*** Interpreter error recovered ***
root [1]

[color=#0000FF]If I change libpythia8.dylib -> .so[/color]

root [0] .x pythia8.C
dlopen error: dlopen(/Users/linn/Applications/root/lib/libEGPythia8.so, 9): Library not loaded: libpythia8.dylib
Referenced from: /Users/linn/Applications/root/lib/libEGPythia8.so
Reason: image not found
Load Error: Failed to load Dynamic link library /Users/linn/Applications/root/lib/libEGPythia8.so
(int)(-1)
*** Interpreter error recovered ***

[color=#0000FF]Can’t win ??[/color]

Instead of renaming libpythia8.dylib -> .so copy libpythia8.dylib to libpythia8.dylib.so

Rene

Nope didn’t work.
Thanks, SLL

root [0] .x pythia8.C
Error in TUnixSystem::DynamicPathName: $PYTHIA8/lib/libpythia8[.so | .sl | .dl | .a | .dll] does not exist in /Users/linn/Applications/root/lib:/Users/linn/Applications/HEPMC/lib:/Users/linn/Applications/root/lib::/Users/linn/Applications/HEPMC/lib:/Users/linn/Applications/root/lib::.:/Users/linn/Applications/root/lib::/Users/linn/Applications/root/cint/cint/stl
dlopen error: dlopen(/Users/linn/Applications/root/lib/libEGPythia8.so, 9): Library not loaded: libpythia8.dylib
Referenced from: /Users/linn/Applications/root/lib/libEGPythia8.so
Reason: image not found
Load Error: Failed to load Dynamic link library /Users/linn/Applications/root/lib/libEGPythia8.so
(int)(-1)
*** Interpreter error recovered ***

I’m thinking… is an .so really the same as a .dylib? I thought they were a different format.

SLL

of course, I assume that you have $PYTHIA8/lib in your DYLD_LIBRARY_PATH.

As it works for me and others, I do not see what else I can do. The only difference between your setup and mine is that you us gcc4.2 where I am still with gcc4.0.1 on the MAC

Rene

Hi,

In one of the pythia[8] makefile I have seen (I can not vouch whether they were locally modified or not), the produced .dylib was being given the wrong internal name. If I remember correctly the argument to -install_name was the full pathname instead of the file/library name. Can you copy/paste the exact command line used by the makefile to generate the library?

Cheers,
Philippe.

of course, I assume that you have $PYTHIA8/lib in your DYLD_LIBRARY_PATH.

my bad!!

Thanks everyone for your help.

SLL