-
Notifications
You must be signed in to change notification settings - Fork 34
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
Provide option to select between G4VG via FetchContent or find_package #348
Provide option to select between G4VG via FetchContent or find_package #348
Conversation
Can one of the admins verify this patch? |
Thanks Ben, works well for me. |
I've added the message, but note that @SeverinDiederichs has also reported some issues at the configure step we're trying to work out. |
We worked out the issue the @SeverinDiederichs was having. It's not a blocker as one can still build and install, but the warnings can be confusing. The sequence of operations and problems is:
This requires a little more debugging first to double check the interplay between |
Note that the above warnings still allow a successful build/install, but ideally we want to be rid of them to avoid confusion or possibly incorrect build setups from being created. |
Simple "find_package then FetchContent" logic (whether directly or through the coupling capability) can lead to CMake-generate time errors if CMake is run where: 1. The previous CMake invocation set things up to use FetchContent 2. The current CMake invocation picks up an external G4VG through find_package. CMake-generate will then warn about runtime paths, e.g.: """ Cannot generate a safe runtime search path for target test_atomic because there is a cycle in the constraint graph: """ This does not stop generation or a subsequent build from completing, but is confusing. This can be considered a temporary problem until AdePT moves entirely to required an external G4VG only (As was done with integrating G4HepEm). Provide a temporary workaround through a CMake option to control whether to get G4VG via FetchContent or find_package. Default to use FetchContent matching current behaviour (ON). This will also not trigger the issues noted above under any case. Switching the option from ON to OFF in a given build directory can trigger the above warnings, but they can no longer happen without the developer making that decision.
O.k., the latest commit does two main things
This makes things a bit more robust/less subject to confusion. It doesn't totally fix @SeverinDiederichs's issue, but prevents it happening without a deliberate change in the build options. Whilst there may be ways to make this fully robust, I think the true long term solution will be to move completely to only requiring an external install of G4VG. But, this is a good enough solution for now to avoid confusion. |
A small ease of use/integration enhancement to use an external install of G4VG by default, falling back to use of
FetchContent
otherwise.This should allow easier integration in ATLAS/Athena as well as common integration with Celeritas so the same G4VG install is used without symbol clashes.