eic / EICrecon

EIC Reconstruction - JANA based
https://eic.github.io/EICrecon
GNU Lesser General Public License v3.0
6 stars 29 forks source link

datamodel_glue.h not found during compilation for src/global/pid #1034

Open wdconinc opened 1 year ago

wdconinc commented 1 year ago

I was messing around and disabling parts of the compilation (detectors and tracking algorithms), and it introduced a missing header since the datamodel_glue.h is created later than it is needed. We should make sure src/global/pid knows it needs datamodel_glue.h before it can be compiled.

[  3%] Building CXX object src/services/geometry/dd4hep/CMakeFiles/dd4hep_plugin.dir/DD4hep_service.cc.o
[  3%] Building CXX object src/services/geometry/richgeo/CMakeFiles/richgeo_plugin.dir/ActsGeo.cc.o
[  4%] Building CXX object src/services/log/CMakeFiles/log_library.dir/Log_service.cc.o
[  5%] Building CXX object src/algorithms/digi/CMakeFiles/algorithms_digi_library.dir/PhotoMultiplierHitDigi.cc.o
make[2]: Entering directory '/home/wdconinc/git/EICrecon/.worktree/1032-order-of-geometry-arguments-from-dd4hep_service-in-algorithm-init-matters/build'
[  6%] Building CXX object src/algorithms/fardetectors/CMakeFiles/algorithms_fardetectors_library.dir/MatrixTransferStatic.cc.o
[  7%] Building CXX object src/services/rootfile/CMakeFiles/rootfile_plugin.dir/rootfile.cc.o
[  9%] Building CXX object src/global/pid/CMakeFiles/pid_plugin.dir/IrtCherenkovParticleID_factory.cc.o
In file included from /home/wdconinc/git/EICrecon/.worktree/1032-order-of-geometry-arguments-from-dd4hep_service-in-algorithm-init-matters/src/global/pid/IrtCherenkovParticleID_factory.h:7,
                 from /home/wdconinc/git/EICrecon/.worktree/1032-order-of-geometry-arguments-from-dd4hep_service-in-algorithm-init-matters/src/global/pid/IrtCherenkovParticleID_factory.cc:4:
/home/wdconinc/git/EICrecon/.worktree/1032-order-of-geometry-arguments-from-dd4hep_service-in-algorithm-init-matters/src/extensions/jana/JChainMultifactoryT.h:22:10: fatal error: datamodel_glue.h: No such file or directory
   22 | #include "datamodel_glue.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/global/pid/CMakeFiles/pid_plugin.dir/build.make:76: src/global/pid/CMakeFiles/pid_plugin.dir/IrtCherenkovParticleID_factory.cc.o] Error 1
make[2]: Leaving directory '/home/wdconinc/git/EICrecon/.worktree/1032-order-of-geometry-arguments-from-dd4hep_service-in-algorithm-init-matters/build'
make[1]: *** [CMakeFiles/Makefile2:933: src/global/pid/CMakeFiles/pid_plugin.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 10%] Building CXX object src/services/geometry/dd4hep/CMakeFiles/dd4hep_plugin.dir/dd4hep.cc.o
Generating datamodel_glue.h ...
[ 11%] Generating G__datamodel_vectors.cxx, libpodio_plugin_rdict.pcm, libpodio_plugin.rootmap
veprbl commented 1 year ago

CMake's scanner should be able to detect the dependency. https://github.com/eic/EICrecon/blob/3079a7b3218553731cf8b032ebc15d3332132a5c/src/services/io/podio/CMakeLists.txt#L42 src/global/pid does have the right dependency https://github.com/eic/EICrecon/blob/3079a7b3218553731cf8b032ebc15d3332132a5c/src/global/pid/CMakeLists.txt#L21 is it up to https://github.com/eic/EICrecon/blob/3079a7b3218553731cf8b032ebc15d3332132a5c/src/services/io/podio/CMakeLists.txt#L52 to be PUBLIC?

wdconinc commented 1 year ago

Reproducer in eic-shell:

cmake -Bbuild -S. 
make -C build/src/global/pid pid_plugin
wdconinc commented 1 year ago

Maybe that's a bit of a private interface call, but I don't think so. It seems that should resolve the dependencies correctly.