Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround missing G4persistency target bug in Geant4 11.2 #1122

Merged

Conversation

drbenmorgan
Copy link
Contributor

As reported on Slack, and the same report on VecGeom JIRA, Geant4 11.2 split the G4persistency target into subcomponents:

  • G4mctruth
  • G4geomtext
  • G4gdml (optional, only if Geant4 built with GDML support)

and so projects use the direct CMake targets will fail to link with these versions. A bug fix will be made in Geant4 itself to address this, but we'll still need to support the affected versions of 11.2.

Workaround this issue in Celeritas by translating request for persistency target in celeritas_get_g4libs to appropriate underlying targets. Translation rather than creation of our own imported target was chosen to:

  • Avoid possible (albeit unlikely) clashes with other projects that might create the same target (and likewise not mess with the Geant4:: CMake namespace).
  • Reduce dependence on use of Celeritas' FindGeant4 wrapper by downstream projects.

Geant4 11.2 split the G4persistency target into subcomponents:

- G4mctruth
- G4geomtext
- G4gdml (optional, only if Geant4 built with GDML support)

and so projects use the direct CMake targets will fail to link
these versions. A bug fix will be made in Geant4 itself to address
this.

Workaround issue in Celeritas by translating request for "persistency"
target in celeritas_get_g4libs to appropriate underlying targets. Use
translation rather than creation of our own imported target to:

- avoid possible (albeit unlikely) clashes with other projects that
  might create the same target.
- Reduce dependence on use of Celeritas' FindGeant4 wrapper by downstream
  projects.
@drbenmorgan drbenmorgan requested review from sethrj and pcanal February 22, 2024 19:07
@drbenmorgan drbenmorgan added the core Software engineering infrastructure label Feb 22, 2024
@drbenmorgan drbenmorgan changed the title Workaround missing G4persistency target bug in Geant4 11.2 *[enhancement, build]* Workaround missing G4persistency target bug in Geant4 11.2 Feb 22, 2024
@sethrj sethrj added bug Something isn't working external Dependencies and framework-oriented features and removed core Software engineering infrastructure labels Feb 22, 2024
cmake/CeleritasUtils.cmake Outdated Show resolved Hide resolved
cmake/CeleritasUtils.cmake Outdated Show resolved Hide resolved
Check obvious case first, then the special cases for persistency
and tasking. Post-process list to remove duplicates to avoid
ld warnings observed on macOS.
Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for that.

@sethrj sethrj enabled auto-merge (squash) February 23, 2024 17:24
@sethrj sethrj merged commit 23ee7e0 into celeritas-project:develop Feb 23, 2024
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external Dependencies and framework-oriented features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants