Skip to content

Drop GSL and finalize fortnum wiring (8/8)#147

Draft
krystophny wants to merge 1 commit into
fortnum/k7-hyper1f1from
fortnum/k8-plumbing
Draft

Drop GSL and finalize fortnum wiring (8/8)#147
krystophny wants to merge 1 commit into
fortnum/k7-hyper1f1from
fortnum/k8-plumbing

Conversation

@krystophny

@krystophny krystophny commented Jun 14, 2026

Copy link
Copy Markdown
Member

Merge order

These fortnum-migration PRs are individually based on main and form one
cumulative stack. Merge them in this order:

#140 -> #141 -> #142 -> #143 -> #144 -> #145 -> #146 -> #147 -> #148 -> #149 -> #150

Each PR is opened against main, so its diff is cumulative versus main and
overlaps its predecessors. Merging in the order above keeps the history linear:
once a predecessor merges into main, the next PR's diff shrinks to just its
own increment.

Scope

Remove the last GSL traces now that every call site runs on fortnum and finalize the build wiring. Deletes cmake/FetchGSL.cmake and its include, strips gsl/gslcblas and the gsl include path from the KiLCA, QL-Balance, and KIM CMake targets, and drops the find_package(GSL) probe. KIM_exe and the KIM tests link the in-tree kilca_lib target instead of the hardcoded versioned .a path; ddeabm gains an explicit slatec link so xermsg_ resolves under the new link order. Updates the legacy build scripts and the dependency docs to name fortnum in place of GSL.

Dependency removed

The GSL build dependency (FetchGSL, gsl/gslcblas link targets, the GSL probe) for the whole project.

Verification

Full KAMEL configure and build of the stack tip (all eight aspects applied), with fortnum from the local checkout at a7faa3c:

$ CODE=$HOME/code cmake -S KAMEL -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
-- Using fortnum in /home/ert/code/fortnum
-- Configuring done
$ cmake --build build -j$(nproc)
[275/275] Linking CXX executable tests/test_rhs_balance.x   # build exit 0
$ ctest --output-on-failure
100% tests passed, 0 tests failed out of 18

nm over every shipped binary (install/bin/{KIM,ql-balance,fouriermodes}.x and tests/*.x):

  • 0 defined AMOS implementation symbols (zbknu zbinu zseri zmlri zasyi zacai zacon zunhj zunik zuoik zwrsk zbuni zbunk zairy zbesh zbesy zbiry dgamln zabs).
  • zbesi_/zbesj_/zbesk_ defined as the fortnum-backed shim in KIM.x.
  • No gsl_ symbols from KAMEL code. The only residual GSL references are two undefined gsl_sf_gamma / gsl_sf_gamma_inc_P in ql-balance.x and test_rhs_balance.x pulled transitively from libneo.a, not from KAMEL sources; the GSL detection line in the configure log likewise comes from a fetched dependency's own probe.

This PR is the buildable, fully verified tip of the stack and is draft only pending review of the stack as a whole.


Stack reconciliation (update)

The migration stack was rebuilt as a strictly linear cumulative chain on main 428a708:

k1 (+ golden CI fix) -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> k8 -> z1 -> z2 -> z3

Every branch now pins fortnum to main 974dcf1 (all kernel fixes plus both new integrators). This branch's standalone golden result above stands. The cumulative tip (#150 z3) does not pass: the KiLCA background equilibrium ODE on #143 k4 cannot reproduce the GSL rk8pd golden with DOP853 at the unchanged 1e-8 bar. See #143 and #150. Tolerances were not weakened and the stored golden was not regenerated.

Merge order: #140 -> #141 -> #142 -> #143 -> #144 -> #145 -> #146 -> #147 -> #148 -> #149 -> #150.

Note: fortnum pin updated to current main (92de6e9) after a fortnum history rewrite; old shas no longer resolve.

@krystophny

Copy link
Copy Markdown
Member Author

Stacked on this branch, PRs #148-#150 finish the upstream numerical dependency removal that this PR (AMOS) was part of, completing the GSL/AMOS/SLATEC/QUADPACK drop. Only BLAS/LAPACK/OpenMP/MPI remain.

nm on every shipped binary: 0 dqag/quadpack-netlib, 0 d1mach/i1mach/xermsg/slatec, 0 zeal, 0 ddeabm. ctest green at each step. The only residual undefined GSL symbol is gsl_sf_gamma transitive from libneo.a, out of scope here (libneo #316).

@krystophny krystophny force-pushed the fortnum/k8-plumbing branch from 2ac023b to a17d191 Compare June 15, 2026 19:28
@krystophny krystophny changed the base branch from main to fortnum/k7-hyper1f1 June 15, 2026 19:29
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.

1 participant