Repository navigation
Conversation
…talls
BuildNIFTI.cmake staged nifti_clib into ${CMAKE_INSTALL_LIBDIR}, which is
lib64 on Fedora. The superbuild installs only lib${LIB_SUFFIX} from its
staging tree, so on Fedora libniftiio.a, libznz.a and libnifti2.a were
never installed, while the NIFTI package in share/cmake/NIFTI was. Any
find_package(NIFTI) against such an install fails:
The imported target "NIFTI::znz" references the file
".../lib64/libznz.a"
but this file does not exist.
Stage into lib${LIB_SUFFIX}, as the rest of the superbuild does
(LIBMINC_INSTALL_LIB_DIR, CMAKE_INSTALL_RPATH, the staging install rule).
Verified: configured with -DCMAKE_INSTALL_LIBDIR=lib64 and built the NIFTI
target; the three archives are staged in lib/, and NIFTITargets refers to
lib/.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RCrjXCD1KiTWLtah7wmySX
This was referenced Sep 21, 2026
Contributor
Author
|
This is currently fixing the cmake to be consistent but there's an alternative PR that makes the superbuild use CMAKE_INSTALL_LIBDIR everywhere instead, which would make it closer to standard cmake. |
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.
Why
On Fedora, the toolkit installs a NIFTI package (
share/cmake/NIFTI) that refers to archives it never installs. Eachfind_package(NIFTI)against such an install fails:cmake-modules/BuildNIFTI.cmakestages nifti_clib into${CMAKE_INSTALL_LIBDIR}, which islib64on Fedora. But the superbuild installs onlylib${LIB_SUFFIX}from its staging tree (CMakeLists.txt, theINSTALL(DIRECTORY …/lib${LIB_SUFFIX})rule). Solibniftiio.a,libznz.aandlibnifti2.astay in the staging tree.This defect is already on
develop-1.9.18. Nothing loaded the NIFTI package until now, so nobody saw it. BIC-MNI/libminc#156 addsfind_dependency(NIFTI)toLIBMINCConfig.cmake, and without this fix,find_package(LIBMINC)fails on each Fedora toolkit install.What
BuildNIFTI.cmakestages intolib${LIB_SUFFIX}, the directory that the superbuild installs. This is the convention that the rest of the superbuild uses already (LIBMINC_INSTALL_LIB_DIR,CMAKE_INSTALL_RPATH, the staging install rule). The change is toCMAKE_INSTALL_LIBDIR,NIFTI_INSTALL_LIBRARY_DIR, the install RPATH, and theNIFTI_LIBRARY/ZNZ_LIBRARYpaths.Verification
-DCMAKE_INSTALL_LIBDIR=lib64(the Fedora value) and built theNIFTItarget. The three archives are staged inlib/, andNIFTITargets-release.cmakerefers tolib/.LIBMINC::minc2andLIBMINC::nifti:develop-1.9.18: macOS fails onlynu_reference_1.Notes
Build*.cmakemodules already pass-DCMAKE_INSTALL_LIBDIR=lib${LIB_SUFFIX}(FFTW, freeglut, JPEG, netCDF, OpenBLAS).BuildOpenJPEG.cmakeuses${CMAKE_INSTALL_LIBDIR}too, so a vendored OpenJPEG on alib64system is also not installed. That has less effect: its archive is static and linked at build time, and its CMake package is in the samelib64/directory, so nothing installed refers to a missing file. I left it out of this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01RCrjXCD1KiTWLtah7wmySX