Running Pythia 8 with root (pythia8.C example)

Hi,

I am trying to run Pythia8 as a plugin to Root on linux (i686 - Ubuntu 15.04).

I have installed Pythia 8 with the option -enable shared and managed to run the provided examples.

Then I exported the libraries as follows:

export PYTHIA8=/home/username/pythia8210
export PYTHIA8DATA=$PYTHIA8/share/Pythia8/xmldoc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/username/pythia8210/lib

And downloaded and configured root with the options ./configure --enable-pythia8 --with-pythia8-incdir=$PYTHIA8/include/Pythia8 --with-pythia8-libdir=$PYTHIA8/lib and then make.

Root on its own works fine, I could run the examples in the tutorials folder. But when I try to run the example code pythia8.C, I have this:

root [0] Processing pythia8.C... In file included from input_line_9:1: /home/antinea/Documents/Summer_Student_Internship/test_pythia8/pythia8.C:47:4: error: unknown type name 'TPythia8' TPythia8* pythia8 = new TPythia8(); ^ /home/antinea/Documents/Summer_Student_Internship/test_pythia8/pythia8.C:47:28: error: unknown type name 'TPythia8' TPythia8* pythia8 = new TPythia8(); ^ /home/antinea/Documents/Summer_Student_Internship/test_pythia8/pythia8.C:65:10: error: unknown type name 'TParticle' TParticle* part = (TParticle*) particles->At(ip); ^ /home/antinea/Documents/Summer_Student_Internship/test_pythia8/pythia8.C:65:29: error: use of undeclared identifier 'TParticle' TParticle* part = (TParticle*) particles->At(ip); ^ /home/antinea/Documents/Summer_Student_Internship/test_pythia8/pythia8.C:65:39: error: expected expression TParticle* part = (TParticle*) particles->At(ip); ^ /home/antinea/Documents/Summer_Student_Internship/test_pythia8/pythia8.C:70:27: error: use of undeclared identifier 'TDatabasePDG' Float_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();

Tried the command “root-config --has-pythia8” and got “no” as the output…

Could you help me with that please?
Thanks!

Well, “no” means that “configure” did NOT find your pythia8 (e.g. the include file Pythia.h and/or the library libpythia8.so is missing).
Inspect the ROOT’s “config.log” file and see what was not found (start with the line “Checking for Pythia8/Pythia.h …”).

Is the library libEGPythia8.so in your ROOT installation? $ROOTSYS/lib ?

Hi,

So I checked the config.log file and have that:

Checking for Pythia8/Pythia.h …
Checking in directory /home/antinea/pythia8210/include/Pythia8
Checking for Pythia8/Pythia.h in directory /home/antinea/pythia8210/include/Pythia8
Checking for libpythia8 …
libraries to check for: libpythia8.so libpythia8.sl libpythia8.dylib libpythia8.dll.a libpythia8.a libpythia8.lib libpythia8
Checking in directories /home/antinea/pythia8210/lib/i386-linux-gnu /home/antinea/pythia8210/lib for libpythia8.so libpythia8.sl libpythia8.dylib libpythia8.dll.a libpythia8.a libpythia8.lib libpythia8
Checking for library libpythia8.so in directory /home/antinea/pythia8210/lib
Checking /home/antinea/pythia8210/lib/libpythia8.so
Found file /home/antinea/pythia8210/lib/libpythia8.so

Regarding libEGPythia8.so, I can’t find it in my Root installation, I only have libEG.so. Is there a special command to get it?

Thanks

As you can see, “configure” did NOT find your “Pythia8/Pythia.h”.
Maybe you should try “–with-pythia8-incdir=${PYTHIA8}/include”.
Run “make distclean” or maybe better “make maintainer-clean” and then run “configure” again.
Right after the “configure” step (before you try to “make” it), inspect the bottom of the “config.log” file and see if you have “pythia8” in the line which begins with “Result: Enabled support for”.

So, I’ve done that “./configure --enable-pythia8 --with-pythia8-incdir=${PYTHIA8}/include --with-pythia8-libdir=$PYTHIA8/lib” and checked the end of the config.log file but Pythia8 is not in the list…

Check the existence of the file:
/home/username/pythia8210/include/Pythia8/Pythia.h
If it exists, check again your “config.log”, starting with the line “Checking for Pythia8/Pythia.h …”.

Maybe another idea … define (export) the PYTHIA8 environment variable and then run “./configure --enable-pythia8” (without additional “-with-pythia8-…=…” flags).

The file /home/username/pythia8210/include/Pythia8/Pythia.h really exists. And I’ve just did as you said (export and the configure without all the previous options) and now have Pythia8 as an enabled support :slight_smile:

So, try (after exporting PYTHIA8, without additional “–enable-pythia8”):
./configure --enable-soversion --all

Did it! Pythia8 is still as an enabled support and got that in my terminal:
“Checking for Pythia8/Pythia.h … /home/antinea/pythia8210/include
Checking for libpythia8 … /home/antinea/pythia8210/lib”

Shall I move to the next step then, meaning “make”?

What are you waiting for?

P.S. Just a precaution … after you “make” it and before you try to use it … have a look at the “[url=https://root-forum.cern.ch/t/root-doesnt-runs-with-pythia8/19485/1 Doesn’t runs with Pythia8[/url]” thread.

I had a look at it. Every thing is working now, thanks a lot for your help!!!