Bug#1147167: vtk9: CMake project using VTK and ITK fails configure: both want HDF5 but VTK uses older FindHDF5.cmake
Manik Bhattacharjee
manik.bhattacharjee at univ-grenoble-alpes.fr
Tue Sep 8 17:19:19 BST 2026
Package: vtk9
Version: 9.6.2+dfsg1-5
Severity: normal
X-Debbugs-Cc: manik.bhattacharjee at univ-grenoble-alpes.fr
Dear Maintainer,
our package CamiTK does not build since the update to ITK 5.4.7. While
troubleshooting the issue, we noticed that this is caused by VTK and ITK
requesting the same library: HDF5.
VTK uses a custom, older FindHDF5.cmake, while ITK uses the system one.
The CMake variables defined by the two FindHDF5.cmake are different,
which leads to an error at the configure step about not finding HDF5.
Our package does not require HDF5 except through VTK and ITK.
The curent workaround we are considering is to require it before asking
for VTK and ITK in our CMake files.
Here is a minimal example of a CMakeLists.txt file that shows the issue:
cmake_minimum_required(VERSION 3.28)
project(HDF5Issue)
# FIX: find_package(HDF5 COMPONENTS C HL)
find_package(VTK REQUIRED COMPONENTS CommonCore)
find_package(ITK REQUIRED)
Configuring the project ("cmake -S . --build build") in the directory
with this CMakeLists.txt generates an error identical to the one in our package:
-- Found HDF5: /usr/lib/x86_64-linux-gnu/libhdf5_serial.so (found version "2.2.0") found components: C
CMake Error at /usr/share/cmake-4.3/Modules/FindHDF5.cmake:1257 (message):
HDF5 was found, but a different variable was set which contains the
location of the `hdf5::hdf5` library.
Call Stack (most recent call first):
/usr/share/cmake-4.3/Modules/CMakeFindDependencyMacro.cmake:93 (find_package)
/usr/share/cmake-4.3/Modules/CMakeFindDependencyMacro.cmake:125 (__find_dependency_common)
/usr/lib/x86_64-linux-gnu/cmake/LIBMINC/LIBMINCConfig.cmake:54 (find_dependency)
/usr/lib/x86_64-linux-gnu/cmake/ITK-5.4/Modules/ITKMINC.cmake:15 (find_package)
/usr/lib/x86_64-linux-gnu/cmake/ITK-5.4/ITKModuleAPI.cmake:86 (include)
/usr/lib/x86_64-linux-gnu/cmake/ITK-5.4/ITKModuleAPI.cmake:31 (itk_module_load)
/usr/lib/x86_64-linux-gnu/cmake/ITK-5.4/ITKModuleAPI.cmake:143 (_itk_module_config_recurse)
/usr/lib/x86_64-linux-gnu/cmake/ITK-5.4/ITKConfig.cmake:89 (itk_module_config)
sdk/cmake/modules/macros/camitk/CamiTKLibrary.cmake:205 (find_package)
imaging/libraries/itktemplates/CMakeLists.txt:76 (camitk_library)
-- Found NetCDF headers: /usr/include
-- Found NetCDF library: /usr/lib/x86_64-linux-gnu/libnetcdf.so
-- Found Python3: /usr/bin/python3 (found suitable version "3.14.7", minimum required is "3.14") found components: Interpreter Development.Module Development.Embed
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.15.3")
-- Found HDF5: /usr/lib/x86_64-linux-gnu/libhdf5_serial.so (found version "2.2.0") found components: C HL
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/vtk-9.6/patches/99/FindHDF5.cmake:1123 (message):
HDF5 was found, but a different variable was set which contains the
location of the `hdf5::hdf5_hl` library.
The reason I am posting this to the VTK9 package is that it is using a
specific FindHDF5.cmake
I am not sure why VTK may need a specific patch version of
FindHDF5.cmake, but the current one is based on an older version
than the one on the standard path in my sid image:
/usr/lib/x86_64-linux-gnu/cmake/vtk-9.6/patches/99/FindHDF5.cmake
/usr/share/cmake-4.3/Modules/FindHDF5.cmake
Is there a way to fix this in the VTK9 package ?
Best regards,
Manik Bhattacharjee.
-- System Information:
Debian Release: forky/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.8.0-136-generic (SMP w/20 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect
Versions of packages vtk9 depends on:
ii libc6 2.43-5
ii libgcc-s1 16.2.0-2
ii libstdc++6 16.2.0-2
ii libvtk9.6 9.6.2+dfsg1-5
vtk9 recommends no packages.
Versions of packages vtk9 suggests:
pn vtk9-doc <none>
pn vtk9-examples <none>
-- no debconf information
More information about the debian-science-maintainers
mailing list