Fork me on GitHub

Opened 11 years ago

Last modified 10 years ago

#288 new Bug

Delphes 3.1.2 with Pythia8

Reported by: Matthew Low Owned by:
Priority: minor Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:

Description

Dear Delphes team,

I have a question about running Delphes 3.1 with Pythia8. I think this has been brought up in previous tickets that running make while Pythia8 environment variables are set tends to not work. The work-around of unsetting these variables works fine for me. I am wondering if I actually want to use the Pythia8 functionality with it, how to fix it.

If I run make I get the following error:

modules/PileUpMergerPythia8.cc:25:20: error: Pythia.h: No such file or directory
modules/PileUpMergerPythia8.cc: In member function ‘virtual void PileUpMergerPythia8::Init()’:
modules/PileUpMergerPythia8.cc:67: error: invalid use of incomplete type ‘struct Pythia8::Pythia’
./modules/PileUpMergerPythia8.h:23: error: forward declaration of ‘struct Pythia8::Pythia’
...

I can fix this by changing "#include "Pythia.h"" to "#include "Pythia8/Pythia.h" (this seems to be how Pythia.h is included in the Pythia8 example) in modules/PileUpMergerPythia8.cc. Compiling again I get this error:

Building libDelphes.so

/usr/bin/ld: cannot find -lpythia8
collect2: ld returned 1 exit status
make: * [libDelphes.so] Error 1

For this case, I don't know what the fix is since comparable Makefiles I use with Pythia8 reference -lpythia8 in a similar way.

Thanks for your help,
Matthew

Change History (5)

comment:1 by Pavel Demin, 10 years ago

Dear Matthew,

Thanks for the suggestion about #include "Pythia8/Pythia.h", we'll include this fix in the next Delphes release.

What is the location of libpythia8.so or libpythia8.dylib on your system? One of the following commands could be useful to find this file:

ls $PYTHIA8
ls $PYTHIA8/lib
find $PYTHIA8 -name libpythia8\*

In Makefile its location is specified as $PYTHIA8/lib.

Regards,

Pavel

comment:2 by Matthew Low, 10 years ago

Dear Pavel,

Thanks for the reply. With your prompts I've gotten this to compile, but it required a few modifications. As far as I know, my compilation/installation of Pythia8 was using all defaults. The changes I made were:

  • In the pythia8 directory I changed "SHAREDLIBS = no" to "SHAREDLIBS = yes" in config.mk and then compiled pythia (the pythia README says there was a way to get "SHAREDLIBS = yes" using environment variables and using configure to generate config.mk, but after a few failed tries I gave up on this way). This created the libpythia8.so I was missing.
  • By default I guess pythia8 does not install LHAPDF, but has a placeholder lhapdfdummy. So in the Delphes makefile I replaced "-lLHAPDF" with "-llhapdfdummy".
  • I changed "#include "Pythia.h"" to "#include "Pythia8/Pythia.h"" in readers/DelphesPythia8.cpp

After these modifications Delphes compiled with Pythia8 and I was able to run DelphesPythia8 and generate events.

Best,
Matthew

comment:3 by Fahmi Maulida, 10 years ago

Hi Matthew and Pavel,

I got some problems same as you Matthew, and I follow your instruction (3 points above) and I can configure it. I did "make" and it works. But when I stated it with command "./DelphesHepMC" I got this

  • ./DelphesHepMC: error while loading shared libraries: libpythia8.so: cannot open shared object file: No such file or directory

and I have libpythia8.so in my pythia8,

  • locate -b '\libpythia8.so'
  • /home/ami/pythia_root/pythia8/lib/libpythia8.so

could you help me?. Where should the libpythia8.so should be exist?

Best regards,
Fahmi

comment:4 by Pavel Demin, 10 years ago

Hi Fahmi,

Could you check your LD_LIBRARY_PATH variable to see if it contains '/home/ami/pythia_root/pythia8/lib'?

If it does not, you can append the path to libpythia8.so to LD_LIBRARY_PATH with the following command:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PYTHIA8/lib

Regards,

Pavel

comment:5 by Fahmi Maulida, 10 years ago

Hi Pavel,

Thanks for replying. Yes, I checked it. And it works. I edited my .bashrc file, following the command :

  • export LD_LIBRARY_PATH=$PYTHIA8/lib:$LD_LIBRARY_PATH

and I have done "make" it.

Thank you,
Best regards,
Fahmi.

Note: See TracTickets for help on using tickets.