Skip to content

Conversation

@karabowi
Copy link
Collaborator

@karabowi karabowi commented Aug 6, 2025

Moved the add_subdirectory(trackbase) outside of if(Geant3_FOUND) condition.

Fixes issue #1609.


Checklist:

@coderabbitai
Copy link

coderabbitai bot commented Aug 6, 2025

📝 Walkthrough

Walkthrough

The change moves the inclusion of the trackbase subdirectory in the CMake configuration to be unconditional, rather than dependent on the presence of Geant3. The geane subdirectory remains conditionally included based on Geant3 detection. No other logic or declarations were altered.

Changes

Cohort / File(s) Change Summary
CMake Configuration Update
fairroot/CMakeLists.txt
Moved add_subdirectory(trackbase) outside the if(Geant3_FOUND) block, making its inclusion unconditional. No other changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
fairroot/CMakeLists.txt (1)

36-37: Minor ordering nit – keep core unconditional directories grouped

For readability the unconditional core components appear in one block (geobase, parbase, generators, …). Consider moving the new

add_subdirectory(trackbase)

right after the generators block to preserve that grouping.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d16b36a and 157a007.

📒 Files selected for processing (1)
  • fairroot/CMakeLists.txt (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: dennisklein
PR: FairRootGroup/FairRoot#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.
📚 Learning: `package_project_cmakemod_dir` is defined by the call to `configure_package_config_file()` in the cm...
Learnt from: dennisklein
PR: FairRootGroup/FairRoot#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.txt
🔇 Additional comments (1)
fairroot/CMakeLists.txt (1)

32-37: Validate that trackbase really builds when Geant3 is absent

Making trackbase unconditional is the right direction for #1609, but please confirm that nothing in trackbase/CMakeLists.txt (or its sources)

• links against Geant3::G3VMCLibrary / uses GEANT3_INCLUDE_DIRS
• includes headers that live exclusively in the geane sub-tree
• depends on targets produced by geane

If any such coupling still exists, wrap the offending bits with if(Geant3_FOUND) guards inside trackbase instead of failing at configure/link time.

Copy link
Member

@ChristianTackeGSI ChristianTackeGSI left a comment

Choose a reason for hiding this comment

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

Generally this looks like the right thing to do.

If we want to support building without Geant3, do we have a testcase for this? (not sure, I haven't touched FairRoot for too long now).

P.S.: We probably should revive our CI one way or another?

@karabowi
Copy link
Collaborator Author

@ChristianTackeGSI . Agree on everything.
In principle the test of trackbase is the propagator example.
It falsely depended on EventDisplay. Fixed that.
Cleaned a bunch of stuff.

@karabowi
Copy link
Collaborator Author

@ChristianTackeGSI can you have a look at the PR again?

Copy link
Member

@ChristianTackeGSI ChristianTackeGSI left a comment

Choose a reason for hiding this comment

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

Please remember to change the copyright year on all files that you changed.

Moved the add_subdirectory(trackbase) outside of if(Geant3_FOUND) condition.

Fixes issue FairRootGroup#1609.
…sive`

The ConstField magnetic field is used by few examples: Tutorial1, Tutorial3, propagator,
By moving it to `common` the examples become more independent.
The build of `FairTutorialDet4PointDraw.cxx` dependend
on `opengl`, while it should depend on `TARGET FairRoot::EventDisplay`.
Fixed this.
…Display`

Since only few classes really depend on `EventDisplay`, made only these few
really depend on the exsistance of `EventDisplay`.

Added `ExPassive` to link FairConstField.
The macro depended on Geant3, because it uses `FairGeane` and `FairGeanePro`
inside an if function.
Added preprocessor directives to remove this dependency.
Made order in the dependcies of many of the examples.
Most were placed in the `if(Geant3_FOUND)` which is not needed.
Moved `propagator` out of `if(TARGET FairRoot::EventDisplay`
following previous commit.

That increased the number of tests from 40 to 68 for the no-Geant3 case.
Copy link
Member

@ChristianTackeGSI ChristianTackeGSI left a comment

Choose a reason for hiding this comment

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

Assuming you were able to compile things / run tests…

hopefully our CI will come back sometime.

@karabowi
Copy link
Collaborator Author

I have tested on Mac/Sep25 and Ubuntu/May25.

@karabowi karabowi merged commit c185b1d into FairRootGroup:dev Sep 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants