Check for G4VTrackingManager support via compilation#125
Merged
mnovak42 merged 1 commit intomnovak42:masterfrom Apr 4, 2025
Merged
Check for G4VTrackingManager support via compilation#125mnovak42 merged 1 commit intomnovak42:masterfrom
mnovak42 merged 1 commit intomnovak42:masterfrom
Conversation
G4HepEm currently uses the Geant4 version to determine availability of the `G4VTrackingManager` interface/capability. This is always available from Geant4 v11.0 onwards, but experiments may backport the capability to earlier versions (here, request from LHCb). Use a CMake-time compile check to determine if `G4VTrackingManager` is available in the found Geant4 irrespective of its version. Output result to CMake variable and use this to determine whether to add G4HepEm tracking manager support. Add a "FOUND" variable to installed CMake config file to indicate if G4HepEm provides tracking manager capability.
|
The test fails when I build with LHCb Geant4 installation with the following output: |
|
There is also a warning message before which may be related to it: |
|
I see that it tries to test compile the code using /usr/bin/c++ which is gcc version 11.5.0, while the rest of the software was compiled with /usr/local/bin/gcc which is gcc version 13.1.0. This probably causes the linking problem. |
|
OK, I have made a quick test by adding -DCMAKE_CXX_COMPILER=g++ when calling cmake. The test passes now. The question now is whether it's my system which is inconsistent (having c++ and gcc commands pointing to different compiler versions) or whether there is something to fix in the CMakeLists.txt? I guess, it's more a problem with my system? |
SeverinDiederichs
added a commit
to apt-sim/AdePT
that referenced
this pull request
Apr 10, 2025
Shamelessly stolen from @drbenmorgan's [PR to G4HepEm ](mnovak42/g4hepem#125), this improves the version test in AdePT: instead of testing for version > 11, now it is tested for the `G4VTrackingManager`, as this one is required. This fixes a compilation issue in Gauss which uses a patched version of 10.7 with the G4VTrackingManager. The old test for flush which was needed for the FastSim hook approach is removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
G4HepEm currently uses the Geant4 version to determine availability of the
G4VTrackingManagerinterface/capability. This is always available from Geant4 v11.0 onwards, but experiments may backport the capability to earlier versions (here, request from LHCb).Use a CMake-time compile check to determine if
G4VTrackingManageris available in the found Geant4 irrespective of its version. Output result to CMake variable and use this to determine whether to add G4HepEm tracking manager support. Add a "FOUND" variable to installed CMake config file to indicate if G4HepEm provides tracking manager capability.Tested locally with raw 10.7 and 11.3 installs which result in same behaviour as before. Would need more testing with LHCb's patched Geant4 to confirm it works in that case.