Bug#1020054: h5py: FTBFS: ld: final link failed: bad value

Drew Parsons dparsons at debian.org
Thu Oct 13 08:28:37 BST 2022


Source: h5py
Followup-For: Bug #1020054

The problem is partially related to the
  -L/usr/lib/x86_64-linux-gnu -lhdf5
in the failing compilation line.

Since debian provides serial and mpi builds of hdf5, there is no 
/usr/lib/x86_64-linux-gnu/libhdf5.so (there is libhdf5_serial.so and
libhdf5_openmpi.so instead).

h5py should be accessing flags using pkgconfig, which would provide
the more specific path
  -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi -lhdf5
  
In any case, for some reason ld is finding
/usr/lib/x86_64-linux-gnu/hdf5/openmpi/libhdf5.a instead of
/usr/lib/x86_64-linux-gnu/hdf5/openmpi/libhdf5.so

The problem may be in the configuration of h5pcc, which has -shlib and
-noshlib flags.

Apparently it currently defaults to static build (-noshlib):

$ h5pcc --showconfig
gcc -I/usr/include/hdf5/openmpi -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi /usr/lib/x86_64-linux-gnu/hdf5/openmpi/libhdf5_hl.a /usr/lib/x86_64-linux-gnu/hdf5/openmpi/libhdf5.a -lcrypto -lcurl -lsz -lz -ldl -lm -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu/hdf5/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi

i.e. h5pcc links to libhdf5.a


The shlib configuration would be

$ h5pcc --showconfig -shlib
gcc -I/usr/include/hdf5/openmpi -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi -lhdf5_hl -lhdf5 -lcrypto -lcurl -lsz -lz -ldl -lm -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu/hdf5/openmpi


So it looks like h5py now needs to be more explicit specifying -shlib
or -noshlib.

Again, I can't see why this behaviour would have changed.  It doesn't
sound like a change that would be caused by gcc-12.



More information about the debian-science-maintainers mailing list