On 2022-11-06 15:22, Gilles Filippini wrote:
Hi Drew,
...
h5pcc is showing an unexpected default configuration:
...
Note how it includes static linking to libhdf5_hl.a and libhdf5.a
This is the expected behavior as documented by upstream:
-shlib Compile with shared HDF5 libraries [default for hdf5
built without static libraries]
-noshlib
Compile with static HDF5 libraries [default for hdf5
built with static libraries]
I agree, we should stick with upstream's documented behaviour. There
could be room for some discussion or interpretation, unless I'm
misunderstanding upstream's intent here. In our case we're providing
hdf5 built both with and without static libraries. In that case we could
argue for setting -shlib as default, if we expect client programs
normally to use the shared library (are there arguments in favour of
using the static library even if the shared library is available?)
On the other hand, the h5pcc documentation for the HDF5_USE_SHLIB
environment variable is a bit less ambiguous:
"default: no except when built with only shared libraries". That makes
it more clear that upstream expects the static library to be used when
available, even if the shared library is available.
...
As far as I can tell, the default static linking is causing the RC
Bug#1020054 reported against h5py.
Could be fixed using `HDF5_USE_SHLIB=yes`:
PYBUILD_NAME=$(PYBUILD_NAME_MPI) CC=h5pcc HDF5_USE_SHLIB=yes
HDF5_MPI=ON HDF5_PKGCONFIG_NAME=hdf5-mpi H5PY_SYSTEM_LZF=1
dh_auto_build -D $(BUILD_DIR_MPI)
Should the default configuration of h5pcc be changed to confirm with
the -shlib configuration?
I don't think so since the current behavior is the documented one.
Fair, especially since the HDF5_USE_SHLIB documentation makes upstream's
intention clear.
It's strange that Bug#1020054 was only recently reported. h5py was
building happily until now. Would it be the upgrade to gcc-12 that
changed the behaviour?
I'll update the h5py configuration in any case as you recommend
(assuming we still want to be using the shared library for debian
packages).