art-framework-suite / art

The implementation of the art physics event processing framework
Other
2 stars 7 forks source link

genreflex build fhicl issue with art suite v3_15_00 #146

Closed kutschke closed 4 months ago

kutschke commented 4 months ago

Describe the bug When running genreflex on Mu2e Offline/EventDisplay/src/classes.h and Offline/EventDisplay/src/classes_def.xml the following error occurs:

In file included from input_line_7:20: In file included from ./Offline/EventDisplay/src/DataInterface.h:16: In file included from ./Offline/Mu2eBTrk/inc/ParticleInfo.hh:11: In file included from ./Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh:6: In file included from ./Offline/GlobalConstantsService/inc/GlobalConstantsService.hh:11: In file included from /cvmfs/mu2e.opensciencegrid.org/artexternals/fhiclcpp/v4_19_00/include/fhiclcpp/ParameterSet.h:12: /cvmfs/mu2e.opensciencegrid.org/artexternals/fhiclcpp/v4_19_00/include/fhiclcpp/coding.h:202:16: error: out-of-line definition of 'encode' does not match any declaration in namespace 'fhicl::detail' fhicl::detail::encode(T const& value) ^~ Error: rootcling: compilation failure (build/sl7-prof-e28-u057/Offline/lib/libmu2e_EventDisplayfa726e0265_dictUmbrella.h)

To Reproduce On any machine that sees Mu2e /cvmfs and Mu2e /exp/mu2e/app, look in:

/exp/mu2e/app/users/kutschke/Bugs/art_v3_15_00

and follow the instructions in README. This is a maximally stripped down example.

If this is a high-priority issue This is moderately high priority. I do not have privs to add labels.

kutschke commented 4 months ago

Hopefully this is as simple as updating our genreflex command.

kutschke commented 4 months ago

After a good night's sleep, I think I see the fix ... More later.

kutschke commented 4 months ago

I have fixed the problems and they were all at our end. Sorry for the noise.

There were several issues. One was superfluous included files in .hh files. In some cases they were simply unneeded at all. In other cases they were needed in the .cc but not the .hh. In other cases a forward declaration was needed in the .hh and the include in the .cc. There were a few other cases all of the flavor of included more than was needed for the header to do its job.

I don't understand why these superfluous includes triggered the error that they did but it was right to fix the code and the problem went away. So I am leaving it for now.

kutschke commented 4 months ago

@knoepfel Please close this issue at your convenience. If you are motivated to understand and explain the path from a superfluous include of a fhicl header to to error message, I am interested. But I don't need to know.

knoepfel commented 4 months ago

@kutschke, with art 3.15, we are using C++20 concepts to constrain the types of arguments allowed for function templates. ROOT's genreflex and rootcling functionalities do not yet understand C++20 concepts; hence the failures. I'm glad you were able to get around the issue–we've tried to avoid using C++20 concepts in places where dictionaries will be generated...but that does require some reworking of code.

Sorry about this hiccup.

kutschke commented 4 months ago

@knoepfel thanks for the explanation. As best I can tell the code in question should never have been exposed to dictionary building and I am working with the author to confirm that.