HDFGroup / hdf5

Official HDF5® Library Repository
https://www.hdfgroup.org/
Other
631 stars 256 forks source link

linking issues if parallel (MPI) and serial version are present #695

Open dschwoerer opened 3 years ago

dschwoerer commented 3 years ago

I have a library A that requires hdf5. It only needs the serial version. However, it also links with B that is linked with the parallel version, as it uses some of the parallel symbols. While linking, I link like -lhdf5 -lB, which returns without errors, as all symbols in A are satisfied, but fails later at run time, because B has undefined symbols, as the serial version of hdf5 is linked.

I am not sure about this, but I think the clean solution would be to split out the parallel symbols into a sub-library, and if parallel symbols are expected, pull in the sub-library.

That way the serial version cannot conflict with the parallel version.

derobins commented 1 month ago

We should revisit this for the 2.0.0 release.