Hi HDF5 folks,
I was wondering how the soname of HDF5 shared object files (.so files) on Linux is decided?
For both HDF5 1.10.5 and 1.10.6 shared libraries, the built-out filenames differ (libhdf5.so.103.1.0 versus libhdf5.so.103.2.0 respectively), but the built-in sonames (and therefore, the filenames of symlinks to these libraries) are the same:
$ objdump -x libhdf5.so.103.1.0 | grep SONAME
$ objdump -x libhdf5.so.103.2.0 | grep SONAME
Nevertheless, trying to run an application that was built against HDF5 1.10.5, using a shared library built from HDF5 1.10.6, causes an immediate abort:
Warning! HDF5 library version mismatched error
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Headers are 1.10.5, library is 1.10.6
Aborted (core dumped)
This doesn’t seem to me to be in the spirit of how SONAME versioning is supposed to work on Linux. When two different library versions have the same SONAME, this is supposed to mean that applications linked against the older version can be safely run against the newer library version.
If the two library versions are actually incompatible and it is not safe to use them this way (as implied by the error message and forced abort), then the build process ought to give them different sonames. Otherwise – that is, they are not incompatible – then this error message should not be issued at runtime.