Root Doesn't runs with Pythia8

Hi rooters,

I am trying to run Pythia 8 as a plug in to root.
I am using Mac OS X Yosemite.
I downloaded and installed pythia with following commands

./configure --enable shared
make

and then even ran an example and it worked well.

Then I installed root with following commands
./configure --enable-pythia8 --with-pythia8-incdir=$PYTHIA8/include --with-pythia8-libdir=$PYTHIA8/lib
make

it all worked well, root starts and runs demos perfectly and then I tried to run an example of Pythia under tutorials directory by the command

$root /root/tutorials/pythia/pythia8.C

following is the list of errors generated :frowning:

root [0]
Processing /Users/Umang/pythia_root/root/tutorials/pythia/pythia8.C…
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Users/Umang/root_pythia/root/lib/libEGPythia8.so, 9): Library not loaded: libpythia8.dylib
Referenced from: /Users/Umang/root_pythia/root/lib/libEGPythia8.so
Reason: image not found
Error in TInterpreter::TCling::AutoLoad: failure loading library libEGPythia8.so for TPythia8
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Users/Umang/root_pythia/root/lib/libEGPythia8.so, 9): Library not loaded: libpythia8.dylib
Referenced from: /Users/Umang/root_pythia/root/lib/libEGPythia8.so
Reason: image not found
Error in TInterpreter::TCling::AutoLoad: failure loading library libEGPythia8.so for TPythia8
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Users/Umang/root_pythia/root/lib/libEGPythia8.so, 9): Library not loaded: libpythia8.dylib
Referenced from: /Users/Umang/root_pythia/root/lib/libEGPythia8.so
Reason: image not found
Error in TInterpreter::TCling::AutoLoad: failure loading library libEGPythia8.so for TPythia8
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Users/Umang/root_pythia/root/lib/libEGPythia8.so, 9): Library not loaded: libpythia8.dylib
Referenced from: /Users/Umang/root_pythia/root/lib/libEGPythia8.so
Reason: image not found
Error in TInterpreter::TCling::AutoLoad: failure loading library libEGPythia8.so for TPythia8
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Users/Umang/root_pythia/root/lib/libEGPythia8.so, 9): Library not loaded: libpythia8.dylib
Referenced from: /Users/Umang/root_pythia/root/lib/libEGPythia8.so
Reason: image not found
Error in TInterpreter::TCling::AutoLoad: failure loading library libEGPythia8.so for TPythia8
In file included from input_line_9:1:
/Users/Umang/pythia_root/root/tutorials/pythia/pythia8.C:47:4: error: unknown
type name 'TPythia8’
TPythia8* pythia8 = new TPythia8();
^
/Users/Umang/pythia_root/root/tutorials/pythia/pythia8.C:47:28: error: unknown
type name 'TPythia8’
TPythia8* pythia8 = new TPythia8();
^
/Users/Umang/pythia_root/root/tutorials/pythia/pythia8.C:65:10: error: unknown
type name 'TParticle’
TParticle* part = (TParticle*) particles->At(ip);
^
/Users/Umang/pythia_root/root/tutorials/pythia/pythia8.C:65:29: error: use of
undeclared identifier 'TParticle’
TParticle* part = (TParticle*) particles->At(ip);
^
/Users/Umang/pythia_root/root/tutorials/pythia/pythia8.C:65:39: error: expected
expression
TParticle* part = (TParticle*) particles->At(ip);
^
/Users/Umang/pythia_root/root/tutorials/pythia/pythia8.C:70:27: error: use of
undeclared identifier 'TDatabasePDG’
Float_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
^
root [1]

please help friends.
Thanks :slight_smile:

Try:
root-config --features
and see if you get “pythia8” in the returned list, or try:
root-config --has-pythia8
and see if you get “yes”.

BTW. Maybe you simply need to add “${PYTHIA8}/lib” to your “LD_LIBRARY_PATH” and/or “DYLD_LIBRARY_PATH” environment variables.

Hi Wille,

I ran the command you wrote i.e root --config features and pythia 8 was there in the list.
Don’t know whats wrong :frowning:

HI WILLE,

I set my environment variables by following lines of code

export ROOTSYS=/home/username/pythia_root/root export PATH=$ROOTSYS/bin:$PATH export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH export DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH

am I doing it right?
Please help .

Thanks,
Umang

Instead of doing it manually, you should better execute, for [b][ak]sh: . /home/username/pythia_root/root/bin/thisroot.sh for [t]csh: source /home/username/pythia_root/root/bin/thisroot.csh
Afterwards, try to modify, for [b][ak]sh: LD_LIBRARY_PATH=${PYTHIA8}/lib:${LD_LIBRARY_PATH} DYLD_LIBRARY_PATH=${PYTHIA8}/lib:${DYLD_LIBRARY_PATH} for [t]csh: setenv LD_LIBRARY_PATH ${PYTHIA8}/lib:${LD_LIBRARY_PATH} setenv DYLD_LIBRARY_PATH ${PYTHIA8}/lib:${DYLD_LIBRARY_PATH}

Dear Wile,

I am using a mac OS Yosemite (.sh files support).
As you said on the post , I ran thisroot.sh file.

Now I have little doubts regarding the editing of thisroot.sh file.

my thirst.sh file looks like this :

PATH=$ROOTSYS/bin:$PATH; export PATH
fi

if [ -z “${LD_LIBRARY_PATH}” ]; then
LD_LIBRARY_PATH=$ROOTSYS/lib; export LD_LIBRARY_PATH # Linux, ELF HP-UX
else
LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
fi

if [ -z “${DYLD_LIBRARY_PATH}” ]; then
DYLD_LIBRARY_PATH=$ROOTSYS/lib; export DYLD_LIBRARY_PATH # Mac OS X
else
DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH; export DYLD_LIBRARY_PATH
fi

if [ -z “${SHLIB_PATH}” ]; then
SHLIB_PATH=$ROOTSYS/lib; export SHLIB_PATH # legacy HP-UX
else
SHLIB_PATH=$ROOTSYS/lib:$SHLIB_PATH; export SHLIB_PATH
fi

if [ -z “${LIBPATH}” ]; then
LIBPATH=$ROOTSYS/lib; export LIBPATH # AIX
else
LIBPATH=$ROOTSYS/lib:$LIBPATH; export LIBPATH
fi

if [ -z “${PYTHONPATH}” ]; then
PYTHONPATH=$ROOTSYS/lib; export PYTHONPATH
else
PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH; export PYTHONPATH
fi

if [ -z “${MANPATH}” ]; then
MANPATH=dirname $ROOTSYS/man/man1:${default_manpath}; export MANPATH
else
MANPATH=dirname $ROOTSYS/man/man1:$MANPATH; export MANPATH
fi

if [ “xroot-config --arch | grep -v win32gcc | grep -i win32” != “x” ]; then
ROOTSYS="cygpath -w $ROOTSYS"
fi

unset old_rootsys
unset thisroot

A part of the file looks like this.

Which part should I edit ,i.e which line should it change ?

Please help.

Thanks,
Umang

You should NOT modify “bin/thisroot.[c]sh” at all.

You should call this script as it is and, after calling it, modify what you need for PYTHIA8.

Or, you first set what you need for PYTHIA8 and then you call this script (it will ADD what it needs for ROOT).

Many Thanks Brother , I used your sent commands and it totally worked out , now pythia8 and root runs out very finely! :smiley: :slight_smile:

all credit goes to you :slight_smile: