Page MenuHomeHEPForge

Refine use of ROOT dictionary generation macros
Open, NormalPublic

Description

A bug report from Ludovico Massaccesi on the dev email list indicates that the build is failing because of a deprecation warning about ClassImp from ROOT, which is being promoted to an error because of -Werror. We, strangely, don't see such warnings in our regular CI builds but nevertheless this should clearly be fixed.

The ROOT manual pages have been recently updated on the topic of dictionary generation, see:
https://root.cern/manual/io_custom_classes
Things are now much more clearly explained, so we should adapt accordingly.

Firstly, ClassImp is indeed no longer needed, so we should just remove it. This should be done in v3r5-patches and then we release v3r5p2. The change should also be made in master and propagated to timedep-branch.

The ROOT_GENERATE_DICTIONARY CMake macro has been improved so that the old-style include_directories should not be needed anymore - the necessary changes should be implemented in master and propagated to timedep-branch. This should be tested against ROOT older versions and, if necessary, we can bump the minimum version (currently 6.14 in master).

One important clarification in the recent ROOT manual changes is that dictionaries are only needed for classes that require I/O, so we can actually stop generating dictionaries for most of our classes - we should try this out in master.

Once we're happy with the state of master we can make a v3r6.

Event Timeline

tlatham triaged this task as Normal priority.Apr 24 2023, 5:52 PM
tlatham created this task.
tlatham created this object with visibility "Public (No Login Required)".
tlatham created this object with edit policy "Laura (Project)".

Thanks to D101, this is now in master but needs to also be propagated to the time-dependent branch, so not yet closing this.

The implementation in D101 has caused problems with being able to run the python example GenFit3pi.py because to be able to use our classes in python they need to have dictionaries generated.
As such, I'm going to revert the changes from landing D101 and make new commits that only apply the following parts of those changes:

  • Removal of the deprecated ClassImp macro in all source files
  • The improvements to the CMake modules to avoid using old-style CMake stuff like file-level include_directories, etc.

So what will be reverted will be the removal of ClassDef and dropping classes from the Laura++LinkDef.h.
Some small improvements to the LinkDef file will be retained and some additional improvements to the CMake config will be added.