-
Notifications
You must be signed in to change notification settings - Fork 99
fix(mcconfigurator): Fix to run without TGeant3 #1622
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
base: dev
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe PR refactors mcconfigurator's build dependencies and optional feature support. It decouples mcconfigurator from hard-coded Geant3/Geant4/FastSim requirements by making these dependencies optional and detectable at compile-time via preprocessor macros. mcconfigurator now builds with only yaml-cpp present, while Geant3/Geant4/FastSim support is conditionally compiled when available. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
fairroot/mcconfigurator/FairYamlVMCConfig.cxx (1)
68-131: Potential unused parameter warning when Geant4 is disabled.When
FAIRROOT_HAS_GEANT4is not defined, themcEngineparameter is unused, which may trigger compiler warnings.Apply this diff to suppress the warning:
void FairYamlVMCConfig::SetupPostInit(const char* mcEngine) { #ifdef FAIRROOT_HAS_GEANT4 if (!fPostInitFlag) { ... #else + (void)mcEngine; // Suppress unused parameter warning LOG(fatal) << "FairYamlVMCConfig::SetupPostInit() - Geant4 support is not available! " << "FairRoot was compiled without Geant4. " << "Please use TGeant3 or recompile FairRoot with Geant4 support."; #endif }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
examples/CMakeLists.txt(2 hunks)fairroot/CMakeLists.txt(1 hunks)fairroot/mcconfigurator/CMakeLists.txt(2 hunks)fairroot/mcconfigurator/FairYamlVMCConfig.cxx(8 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-06-14T10:16:00.050Z
Learnt from: dennisklein
Repo: FairRootGroup/FairRoot PR: 1560
File: cmake/private/FairRootConfig.cmake.in:13-13
Timestamp: 2024-06-14T10:16:00.050Z
Learning: `PACKAGE_PROJECT_CMAKEMOD_DIR` is defined by the call to `configure_package_config_file()` in the CMake configuration process for FairRoot.
Applied to files:
fairroot/CMakeLists.txtexamples/CMakeLists.txtfairroot/mcconfigurator/FairYamlVMCConfig.cxxfairroot/mcconfigurator/CMakeLists.txt
🔇 Additional comments (7)
fairroot/mcconfigurator/FairYamlVMCConfig.cxx (3)
31-41: LGTM! Conditional includes are correctly structured.The guarded includes properly isolate optional dependencies, preventing compilation errors when Geant3/Geant4/FastSim are not available.
133-181: LGTM!The conditional compilation guard and fatal error message are correctly implemented, providing clear guidance when Geant3 support is unavailable.
244-249: LGTM!The fallback fatal error message is consistent with the Geant3 pattern and provides clear guidance.
examples/CMakeLists.txt (1)
14-16: LGTM!Moving the
gconfigsubdirectory inclusion outside theGeant3_FOUNDblock correctly reflects that MCConfigurator now only requiresyaml-cppto build.fairroot/CMakeLists.txt (1)
43-45: LGTM!Relaxing the condition to only require
yaml-cpp_FOUNDcorrectly enables building MCConfigurator without transport engines. The individual backend dependencies are now properly handled via compile definitions inmcconfigurator/CMakeLists.txt.fairroot/mcconfigurator/CMakeLists.txt (2)
25-34: LGTM!The compile definitions are correctly set based on the availability of each component, and
PUBLICvisibility ensures consumers can also use these guards when including MCConfigurator headers.
56-61: LGTM!The conditional linking of
FairRoot::FastSimcorrectly requires bothGeant4VMC_FOUNDand the target existence.
e7f4d88 to
56f1e18
Compare
The MCConfigurator required TGeant3 and TGeant4 to run. Added compiler flags to enable running without any given transport engine.
56f1e18 to
eb757f3
Compare
The MCConfigurator required TGeant3 and TGeant4 to run. Added compiler flags to enable running without any given transport engine.
Fixes issue #1620.
Checklist: