Home | News | Documentation | Download

Generating streamers for pythia8302 with cmake

Hi,
I am trying to compile and link a program the is modeled on pythia8’s example
main92, outputting pythia8 events to the output root file.
I am working with cmake v3.16.
So far I can compile and link the program successfully, but without any dictionaries.
Hence, when running I get many errors like below, which I hope to avoid by correctly
generating the dicts. Hope someone can tell me how I need to change my
CMakeLists.txt file to achieve that. Btw, I am not adding any classes of my own,
all missing dicts are for pythia8.

the first few errors:

=========================================================
Error in <TStreamerInfo::Build>: Pythia8::Event: Pythia8::ParticleData* has no streamer or dictionary, data member particleDataPtr will not be saved
Error in <TStreamerInfo::Build>: Pythia8::ParticleData: Pythia8::Info* has no streamer or dictionary, data member infoPtr will not be saved
Error in <TStreamerInfo::Build>: Pythia8::ParticleData: Pythia8::Settings* has no streamer or dictionary, data member settingsPtr will not be saved
Error in <TStreamerInfo::Build>: Pythia8::ParticleData: Pythia8::Rndm* has no streamer or dictionary, data member rndmPtr will not be saved
Error in <TStreamerInfo::Build>: Pythia8::ParticleData: Pythia8::CoupSM* has no streamer or dictionary, data member coupSMPtr will not be saved
Error in <TStreamerInfo::Build>: The class "Pythia8::ParticleData" is interpreted and for its data member "pdt" we do not have a dictionary for the collection "map<int,Pyth>
Error in <TStreamerInfo::Build>: Pythia8::ParticleData: Pythia8::ParticleDataEntry* has no streamer or dictionary, data member particlePtr will not be saved
Error in <TStreamerInfo::Build>: The class "Pythia8::ParticleData" is interpreted and for its data member "readStringSubrun" we do not have a dictionary for the collection >
Error in <TStreamerInfo::Build>: Pythia8::Info: Pythia8::Settings* has no streamer or dictionary, data member settingsPtr will not be saved
... etc ...
=====================================================

The LinkDef.h file is in the same directory as the ex92.cxx source, and obviously
I am not triggering the dict generation at all.

CMakeLists.txt:

find_package( ROOT 6.20 CONFIG REQUIRED COMPONENTS Tree RIO Thread Core)
include(${ROOT_USE_FILE})

set( CMAKE_INCLUDE_CURRENT_DIR ON )
add_executable( ex92 ex92.cxx  )
target_include_directories( ex92 PUBLIC ${PYTHIA8_incs}
${ROOT_INCLUDE_DIRS} )
target_link_libraries( ex92 PUBLIC ${PROJECT_LINK_LIBS}
  ROOT::Tree ROOT::RIO ROOT::Thread ROOT::Core )

install( TARGETS ex2 DESTINATION bin )

__
Please read tips for efficient and successful posting and posting code

ROOT Version: 6.20.06
Platform: kubuntu 20.04
Compiler: gcc 9.3


thanks for the reply!

~/root/root-6.20.06$ root-config --has-pythia8
yes

libEGPythia8.so exists and should be among the ${ROOT_LIBRARIES}.
Although I don’t see the direct relevance to my cmake question.

However, I have just found the useful page at
https://root.cern.ch/how/integrate-root-my-project-cmake
which has a complete example which I am going to adapt.
I guess I should have dug a bit more before sending off my question,
but it was around midnight :wink:

One question I now have is whether it is preferrable to use
ROOT_GENERATE_DICTIONARY( … ) over
REFLEX_GENERATE_DICTIONARY( … ) ?
What are the advantages/drawbacks?

On the REFLEX_GENERATE_DICTIONARY: perhaps @vvassilev can comment?

ROOT_GENERATE_DICTIONARY calls rootcling which processes Linkdef.h files

REFLEX_GENERATE_DICTIONARY calls reflex (a hardlink of rootcling which takes different argument style) which processes selection.xml files

If you have a Linkdef.h I’d recommend using ROOT_GENERATE_DICTIONARY