Support LIBNEO_BRANCH override for the libneo dependency#19
Merged
Conversation
6 tasks
6be309e to
902c4a3
Compare
902c4a3 to
bb6de68
Compare
Member
Author
|
@phizenz heads-up: this PR is part of a cross-repo change unifying how the codes resolve libneo (a validated |
bb6de68 to
98a5768
Compare
Additive: unset keeps current ref resolution. main.yml takes a libneo_ref dispatch input and exports it as LIBNEO_BRANCH so libneo's release gate can build MEPHIT against a candidate ref. Tracking itpplasma/code#55.
98a5768 to
b658305
Compare
MEPHIT CI is build-only, so a libneo-gate dispatch already runs the fast path (the build against the candidate libneo). The inert full input lets the nightly dispatch every downstream the same way.
LIBNEO_BRANCH read from $ENV{} is replaced by the -DLIBNEO_REF=<ref>
cache variable. LIBNEO_PATH replaces the implicit $ENV{CODE}/libneo
local-source path. Both default to auto-detection when unset; no
behavior change for unmodified builds.
Makefile unexports LIBNEO_REF, LIBNEO_PATH, LIBNEO_BRANCH, and LIBNEO_DIR
so ambient shell values cannot reach cmake. Only an explicit command-line
value (make LIBNEO_REF=<ref>) is forwarded as -DLIBNEO_REF.
The dispatch workflow drops the env: LIBNEO_BRANCH block and passes the
ref directly via make LIBNEO_REF=${{ inputs.libneo_ref }}, so the
libneo-gate contract is preserved without the environment footgun.
SetupCODE.cmake declares LIBNEO_REF and LIBNEO_PATH as typed cache
variables so they appear in cmake-gui and ccmake. README documents
both overrides.
Remove every $ENV{CODE} path from the CMake build so a clean checkout
configures without an ambient $CODE tree.
- find_or_fetch (Util.cmake): drop the $ENV{CODE}/<dep> source bypass.
Dependencies default to FetchContent; -D<DEP>_PATH stays as the
explicit local-source override.
- SetupCODE.cmake: drop the $ENV{CODE} block that pre-seeded
LIBNEO_DIR, FGSL_DIR, TRIANGLE_DIR, MFEM_DIR. LIBNEO_DIR was unused
by the build; FGSL_DIR is unused (build uses find_package(GSL));
Triangle and MFEM keep their -DTRIANGLE_DIR / -DMFEM_DIR cache
options plus FetchContent fallback in SetupTriangle / SetupMFEM.
- find_or_fetch now exports <DEP>_DIR as the dependency build dir.
libneo builds vacfield.x into that dir, so LIBNEO_DIR points at the
fetched build output instead of $CODE/libneo/build.
- README: vacfield.x now lives at $MEPHIT_DIR/libneo/vacfield.x.
libneo is now built from source by default (hermetic, slower);
-DLIBNEO_PATH=<dir> is the fast local-dev override.
MEPHIT calls fftw_* directly from src/fftw3.f90 and src/mephit_util.f90.
The MEPHIT_LIBS list already referenced ${FFTW_LIBRARIES}, but
find_package(FFTW) was never called, so the variable was empty and the
link line carried no -lfftw3. FFTW was previously pulled in transitively
through the prebuilt libneo shared object; building libneo from source as
a static library removed that transitive linkage and exposed the missing
explicit dependency.
Call find_package(FFTW REQUIRED COMPONENTS DOUBLE_LIB) alongside the other
system deps and add FFTW_INCLUDE_DIRS to the mephit include path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires MEPHIT into libneo's per-PR reverse-dependency gate (full=yes downstream) and makes the build hermetic with respect to
$CODE.Dispatch contract
Implements the gate's dispatch contract for MEPHIT's
main.yml:main.ymlworkflow_dispatch inputs:libneo_ref(the libneo ref to build against) andfull(accepted for uniform dispatch).LIBNEO_BRANCHis set frominputs.libneo_ref.cmake/Util.cmake:find_or_fetchhonors a<DEP>_BRANCHenv override. For libneo that isLIBNEO_BRANCH, so a gate dispatch with-f libneo_ref=<sha>builds MEPHIT against that candidate libneo via FetchContent (GIT_TAG ${REMOTE_BRANCH}). Unset keeps the current branch/main resolution. Additive.MEPHIT CI is build-only (no ctest/pytest tests are registered with the build), so building against the candidate libneo is itself the gate;
full=truechanges nothing and is accepted only so the gate can dispatch every full=yes downstream uniformly.Normal push/PR builds are unchanged.
Hermetic build (no
$ENV{CODE})Remove every
$ENV{CODE}path from the CMake build so a clean checkout configures without an ambient$CODEtree. libneo is now built from source by default.cmake/Util.cmakefind_or_fetch: dropped the$ENV{CODE}/<dep>source bypass. Dependencies default to FetchContent;-D<DEP>_PATH(e.g.-DLIBNEO_PATH=<dir>) remains the explicit local-source fast override. The function now also exports<DEP>_DIRas the dependency build dir.cmake/SetupCODE.cmake: dropped theif(DEFINED ENV{CODE})block that pre-seededLIBNEO_DIR,FGSL_DIR,TRIANGLE_DIR,MFEM_DIRfrom$CODE.LIBNEO_DIRwas unused by the build (build links theLIBNEO::FetchContent targets).FGSL_DIRis unused (build usesfind_package(GSL)+GSL::gsl). Triangle and MFEM keep their-DTRIANGLE_DIR=/-DMFEM_DIR=cache options and the FetchContent/ExternalProject fallback inSetupTriangle.cmake/SetupMFEM.cmake.vacfield.x(via libneoCMakeSources.in) into the dependency build dir.find_or_fetchexports that asLIBNEO_DIR, sovacfield.xis at$MEPHIT_DIR/libneo/vacfield.xinstead of$CODE/libneo/build/vacfield.x. README updated accordingly.Consequence: MEPHIT builds libneo from source by default (hermetic, slower).
-DLIBNEO_PATH=<dir>is the local-dev fast path.Verification
rg -i '\$ENV\{CODE\}'overcmake/,CMakeLists.txt,Makefilereturns nothing.Configure with
CODEset in env still fetches libneo from git, not from$CODE:LIBNEO_DIRcache resolves to the fetched build dir (<build>/libneo), andvacfield.xis a build target (ninja -t targets | grep vacfield->vacfield.x).Tracking itpplasma/code#55, gated by itpplasma/libneo#278.