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_file
macro instead of hand-crafted replacements This effects all files ending in-HEPMCTEMPLATE
or-HEPMC-TEMPLATE
-
In case ROOT is enable, do not set
-std=c++X
- ROOT will supply that option -
Sub-module
CMakeLists.txt
search 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=medium
and 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_FLAGS
in a two step fashion. -
Some other minor code fixes
-
src/models.F
Preprocessor guard aroundPHO_PHIST
expanded 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 aCHARACTER
array asREAL
.
-
Some things to consider for the future:
- Perhaps EPOS should be treated like any other model
- Perhaps define own transform from
HEPEVT
toHepMC3::GenEvent
procdure so that the size of theHEPEVT
common block can be directly defined here - ROOT output should really use the "standard"
TGenerator
output - that is, aTClonesArray
ofTParticle
objects. Additional information can still be stored in the output tree (separate branches)