Source: libminc
Version: 2.4.07-1
Severity: important
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

I am testing the rebuild of every HDF5 reverse dependencies against HDF5
1.14.6+repack-1~exp17 currently in experimental.

The main change to the HDF5 packages is not the minor version bump but
the toolchain used for the build: I wanted to switch to cmake because
I was told by the HDF Group that they will drop the autotools toolchain
at some point in the future.

My tests report a FTBFS for insighttoolkit5, which I could pinpoint to
a change into the libminc-dev package. Please see the details below.

# Current libminc situation when built against HDF5 1.14.5+repack-4 in unstable

CMakeLists.tst:
HDF5_LIBRARY=/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;/usr/lib/x86_64-linux-gnu/libcurl.so;/usr/lib/x86_64-linux-gnu/libpthread.a;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so
HDF5_LIBRARY_NAME=libm.so

This doesn't seem correct ^^

Generated LIBMINCConfig.cmake (installed by libminc-dev):
LIBMINC_LIBRARIES=minc2;libm.so;libz.so;m;dl;libnetcdf.so
VOLUME_IO_LIBRARIES=minc2;libm.so;libz.so;m;dl;libnetcdf.so
EZMINC_LIBRARIES=minc_io;minc2;libm.so;libz.so;m;dl;libnetcdf.so

Package insighttoolkit5 builds fine.

# libminc built against HDF5 1.14.6+repack-1 in experimental

CMakeLists.txt:
HDF5_LIBRARY=/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
HDF5_LIBRARY_NAME=libhdf5.so

This does seem correct ^^

Generated LIBMINCConfig.cmake:
LIBMINC_LIBRARIES=minc2;libhdf5.so;libz.so;m;dl;libnetcdf.so
VOLUME_IO_LIBRARIES=minc2;libhdf5.so;libz.so;m;dl;libnetcdf.so
EZMINC_LIBRARIES=minc_io;minc2;libhdf5.so;libz.so;m;dl;libnetcdf.so

But then insighttoolkit5 FTBFS with:
/usr/bin/c++ -fPIC -g -O2 
-ffile-prefix-map=/build/insighttoolkit5-k8zAE3/insighttoolkit5-5.4.4=. 
-fstack-protector-strong -fstack-clash-protection -Wformat 
-Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 
-I/usr/include/nifti -g1  -mtune=generic -march=corei7 -Wall -Wcast-align 
-Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral 
-Wpointer-arith -Wshadow -Wunused -Wwrite-strings -Wno-strict-overflow 
-Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual 
-Wctad-maybe-unsupported -Wstrict-null-sentinel  -fno-sized-deallocation -msse2 
-Wl,--dependency-file=CMakeFiles/ITKIOMINC.dir/link.d -Wl,-z,relro  -shared 
-Wl,-soname,libITKIOMINC-5.4.so.1 -o 
../../../../lib/x86_64-linux-gnu/libITKIOMINC-5.4.so.1 
CMakeFiles/ITKIOMINC.dir/itkMINCImageIO.cxx.o 
CMakeFiles/ITKIOMINC.dir/itkMINCImageIOFactory.cxx.o   
-L/usr/lib/x86_64-linux-gnu/lib  
-Wl,-rpath,/usr/lib/x86_64-linux-gnu/lib:/build/insighttoolkit5-k8zAE3/insighttoolkit5-5.4.4/BUILD/lib/x86_64-linux-gnu:
 ../../../../lib/x86_64-linux-gnu/libITKIOImageBase-5.4.so.1 -lminc2 -lhdf5 -lz 
-lm -ldl -lnetcdf ../../../../lib/x86_64-linux-gnu/libITKCommon-5.4.so.1 
../../../../lib/x86_64-linux-gnu/libitksys-5.4.so.1 
../../../../lib/x86_64-linux-gnu/libITKVNLInstantiation-5.4.so.1 
../../../../lib/x86_64-linux-gnu/libitkvnl_algo-5.4.so.1 
../../../../lib/x86_64-linux-gnu/libitkvnl-5.4.so.1 
../../../../lib/x86_64-linux-gnu/libitkv3p_netlib-5.4.so.1 
../../../../lib/x86_64-linux-gnu/libitkvcl-5.4.so.1 -lm -lm -ldl 
-Wl,-rpath-link,/build/insighttoolkit5-k8zAE3/insighttoolkit5-5.4.4/BUILD/lib/x86_64-linux-gnu
/usr/bin/ld: cannot find -lhdf5: No such file or directory
collect2: error: ld returned 1 exit status

# Workaround

As I understand it, '-lhdf5' is not needed to link against libminc.so.
Hence my proposal to remove 'libhdf5.so' from the libminc generated file
'LIBMINCConfig.cmake'.

Please see attached debdiff.

New Generated LIBMINCConfig.cmake:
LIBMINC_LIBRARIES=minc2;libz.so;m;dl;libnetcdf.so
VOLUME_IO_LIBRARIES=minc2;libz.so;m;dl;libnetcdf.so
EZMINC_LIBRARIES=minc_io;minc2;libz.so;m;dl;libnetcdf.so

Note this is very close to the current situation in unstable ^^

Then libminc and insightoolkit5 build fine in both cases: unstable with HDF5 
1.14.5+repack-4, and experimental with HDF5 1.14.6+repack-1.

Thanks in advance,
_g.


- -- System Information:
Debian Release: 12.0
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-34-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEoJObzArDE05WtIyR7+hsbH/+z4MFAmkUk7AACgkQ7+hsbH/+
z4P92AgAqIYHW81uMbIhfBnJR5SLzGSxqKPMWhOeR9cpA9WxuI5jAcSToPrnp+D/
PJw7FDXb4+6/qAS4JDC5cy6EfX2uHZOKqlLlWXq4hz15ZvalZaw+kPiF7c5i/HR1
9FeyHs4kWVX8MaLw2ZNE3eoMXUjPkF71qu7NVvNu9ILLy0qWGoKXct6wBVTC8ZFJ
VFj4sXQS1+kz7Mt+V2qN84kBmrsoGB4Viaj/HGGU7CHw5CV0XGDcttG7d8mKVNPo
js1lPM3mJihj9icCsl82yhdwAarq23o5/EzSJ8Hbpc7E5vsim1CYP+SSczJURZEh
zFaKXa3DDfH/m0CfRIpp/gMiJ191pg==
=g5U7
-----END PGP SIGNATURE-----
diff -Nru libminc-2.4.07/debian/changelog libminc-2.4.07/debian/changelog
--- libminc-2.4.07/debian/changelog     2025-10-24 02:28:01.000000000 +0200
+++ libminc-2.4.07/debian/changelog     2025-11-12 10:24:52.000000000 +0100
@@ -1,3 +1,11 @@
+libminc (2.4.07-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * New patch to drop libhdf5.so from LIBMINC_LIBRARIES_CONFIG
+    (fix FTBFS for insighttoolkit5 against HDF5 1.14.6 built with cmake)
+
+ -- Gilles Filippini <[email protected]>  Wed, 12 Nov 2025 10:24:52 +0100
+
 libminc (2.4.07-1) unstable; urgency=medium
 
   [ Steve M. Robbins ]
diff -Nru 
libminc-2.4.07/debian/patches/0006-Drop-hdf5-from_LIBMINC_LIBRARIES_CONFIG.patch
 
libminc-2.4.07/debian/patches/0006-Drop-hdf5-from_LIBMINC_LIBRARIES_CONFIG.patch
--- 
libminc-2.4.07/debian/patches/0006-Drop-hdf5-from_LIBMINC_LIBRARIES_CONFIG.patch
    1970-01-01 01:00:00.000000000 +0100
+++ 
libminc-2.4.07/debian/patches/0006-Drop-hdf5-from_LIBMINC_LIBRARIES_CONFIG.patch
    2025-11-12 10:24:52.000000000 +0100
@@ -0,0 +1,15 @@
+Index: libminc-2.4.07/CMakeLists.txt
+===================================================================
+--- libminc-2.4.07.orig/CMakeLists.txt
++++ libminc-2.4.07/CMakeLists.txt
+@@ -425,8 +425,8 @@ ENDIF()
+ get_filename_component(HDF5_LIBRARY_NAME "${HDF5_LIBRARY}" NAME)
+ get_filename_component(ZLIB_LIBRARY_NAME "${ZLIB_LIBRARY}" NAME)
+ 
+-SET(LIBMINC_LIBRARIES        ${LIBMINC_LIBRARY} ${HDF5_LIBRARY} 
${NIFTI_LIBRARIES} ${ZLIB_LIBRARY})
+-SET(LIBMINC_LIBRARIES_CONFIG ${LIBMINC_LIBRARY} ${HDF5_LIBRARY_NAME} 
${NIFTI_LIBRARY_NAME} ${ZNZ_LIBRARY_NAME} ${ZLIB_LIBRARY_NAME})
++SET(LIBMINC_LIBRARIES        ${LIBMINC_LIBRARY} ${NIFTI_LIBRARIES} 
${ZLIB_LIBRARY})
++SET(LIBMINC_LIBRARIES_CONFIG ${LIBMINC_LIBRARY} ${NIFTI_LIBRARY_NAME} 
${ZNZ_LIBRARY_NAME} ${ZLIB_LIBRARY_NAME})
+ message("LIBMINC_LIBRARIES_CONFIG=${LIBMINC_LIBRARIES_CONFIG}")
+ 
+ SET(LIBMINC_STATIC_LIBRARIES ${LIBMINC_LIBRARY_STATIC} ${HDF5_LIBRARY} 
${NIFTI_LIBRARIES} ${ZLIB_LIBRARY})
diff -Nru libminc-2.4.07/debian/patches/series 
libminc-2.4.07/debian/patches/series
--- libminc-2.4.07/debian/patches/series        2025-10-24 02:28:01.000000000 
+0200
+++ libminc-2.4.07/debian/patches/series        2025-11-12 10:24:52.000000000 
+0100
@@ -3,3 +3,4 @@
 0003-disable-dimension-test.patch
 0004-Fix-setting-of-LIBMINC_USE_FILE_CONFIG-to-be-correct.patch
 0005-Disable-setting-RPATH.patch
+0006-Drop-hdf5-from_LIBMINC_LIBRARIES_CONFIG.patch

Reply via email to