draft: 255 organize odeint as stand alone library - #41
Conversation
Review Summary by QodoOrganize odeint as standalone sublibrary with CMake support
WalkthroughsDescription• Add support for subdirectory specification in CMake dependency resolution • Enable odeint library as standalone sublibrary within libneo • Modify build paths to support nested library structures • Link odeint library to rabe_lib as private dependency Diagramflowchart LR
A["CMake Util Functions"] -->|"Add SUBDIR parameter"| B["find_or_fetch Function"]
B -->|"Pass SUBDIR to fetch"| C["fetch Function"]
C -->|"Append SUBDIR to paths"| D["Nested Build Paths"]
E["src/CMakeLists.txt"] -->|"Include Util module"| F["find_or_fetch libneo"]
F -->|"Fetch with SUBDIR src/odeint"| G["odeint Library"]
G -->|"Link as PRIVATE"| H["rabe_lib Target"]
File Changes1. cmake/Util.cmake
|
Code Review by Qodo
1. Malformed fetch() call
|
| message(STATUS "Using ${DEPENDENCY}/${OPTIONAL_SUBDIR} in $ENV{CODE}/${DEPENDENCY}") | ||
| else() | ||
| fetch(${DEPENDENCY} SOURCE_DIR) | ||
| fetch(${DEPENDENCY} SOURCE_DIR SUBDIR ${OPTIONAL_SUBDIR}) |
There was a problem hiding this comment.
1. Malformed fetch() call 🐞 Bug ✓ Correctness
find_or_fetch() always calls fetch(... SUBDIR ${OPTIONAL_SUBDIR}); when the caller did not
provide SUBDIR, this can become fetch(<dep> SOURCE_DIR SUBDIR) (missing value), potentially
breaking argument parsing and causing configure failures. This is a backward-incompatible regression
for existing callers like find_or_fetch(quadpack).
Agent Prompt
## Issue description
`find_or_fetch()` currently always calls `fetch(${DEPENDENCY} SOURCE_DIR SUBDIR ${OPTIONAL_SUBDIR})`. When no SUBDIR was provided by the caller, this can turn into `fetch(<dep> SOURCE_DIR SUBDIR)` which may break argument parsing and regress existing call sites (e.g. quadpack).
## Issue Context
The repo already uses `find_or_fetch(quadpack)` without any SUBDIR. This needs to keep working.
## Fix Focus Areas
- cmake/Util.cmake[3-16]
- cmake/Util.cmake[19-39]
- src/utils/CMakeLists.txt[9-12]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
7abb2dc to
16feba3
Compare
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
8493b6d to
38b898f
Compare
|
Merged feat/precession, dropped the second libneo fetch in favor of linking LIBNEO::odeint from the already included libneo, and wrapped the over-length reference lines in test_trace_till_bounce.f90. Build and 38/39 tests now pass in CI; TestPrecessionAnalytic still fails with identical values locally and in CI (flux_mode 2/3 off by factors ~3.2/~2.3 against the analytic expectation, numerical mode 3 at 1.45e-6 vs 1e-6 tolerance), so that comparison needs a look from the derivation side. |
sister pull request to itpplasma/libneo#256
The intend of this change is to only configure and build subpackages of
libneo. Iflibneowas already fetched, it is only fetched once for all its subpackes. This approach however fails and makes also no sense, if the full packagelibneois already imported/build anyway in the project (see build failure in CI).This pr will stay open until e.g.
VMECspline functionalities inlibneohave been also refactored into an independant subpackage. As long asrabeneeds to importlibneoas a whole, subpackage management is not applicable.