Mega patch to modernise build system
OK, so here's a number of changes - mainly to build system - to make it easier to use CRMC shared libraries in third party applications.
The changes are
-
Use CMAKE
configure_filemacro instead of hand-crafted replacements This effects all files ending in-HEPMCTEMPLATEor-HEPMC-TEMPLATE -
In case ROOT is enable, do not set
-std=c++X- ROOT will supply that option -
Sub-module
CMakeLists.txtsearch for files not only in current source directory but also current binary directory. This is needed for out-of-source builds (don't eat where you ... - you get the idea) so that CMAKE can find the generated files (fromconfigure_file) -
Enforce that only one DPMJet model version can be built
-
Enforce, in case of static linking, that PhoJet and DPMJet cannot be built together
-
In case of static linking, check if both C++ and Fortran compilers support the flag
-mcmodel=mediumand if so, pass that flag. This is needed - otherwise we might get the errorrelocation truncated to fit: R_X86_64_32S against symbol ...from GCC (and I think other compilers too)
-
Use
set_property(SOURCE files APPEND PROPERTY COMPILER_DEFINITIONS ...)instead of setting
COMPILER_FLAGSin a two step fashion. -
Some other minor code fixes
-
src/models.FPreprocessor guard aroundPHO_PHISTexpanded to take into account if PhoJet is being built -
src/dpmjet/3.2019-1/DPMJET-19.1/src/phojet/PHO_SETPCOMB.f- fix bug. Trying to format aCHARACTERarray asREAL.
-
Some things to consider for the future:
- Perhaps EPOS should be treated like any other model
- Perhaps define own transform from
HEPEVTtoHepMC3::GenEventprocdure so that the size of theHEPEVTcommon block can be directly defined here - ROOT output should really use the "standard"
TGeneratoroutput - that is, aTClonesArrayofTParticleobjects. Additional information can still be stored in the output tree (separate branches)