JuliaIO / HDF5.jl

Save and load data in the HDF5 file format from Julia
https://juliaio.github.io/HDF5.jl
MIT License
380 stars 138 forks source link

Convenience function to use custom or system provided HDF5 binaries #1114

Closed johnomotani closed 9 months ago

johnomotani commented 10 months ago

Using Preferences.jl for the settings to use custom binaries is great! But the method to set this up is now less convenient. Instead of being able to do something short like

ENV["JULIA_HDF5_PATH"] = "/path/to/hdf5/dir"
using Pkg, Pkg.build()

it is now necessary to import Preferences, create two separate paths, and give them both to set_preferences!(). It would be lovely to wrap up the process in a convenience function (copying the name from the MPI.jl equivalent), e.g.

using HDF5
HDF5.use_system_binary("/path/to/hdf5/dir")

If it was possible to auto-detect the directory for system binaries in common cases, that would be awesome, but I don't know how possible that is - maybe parse the output of h5cc -show?

JoshuaLampert commented 10 months ago

Yes, I definitely agree. We plan to implement a convenience function set_libraries!, see https://github.com/JuliaIO/HDF5.jl/pull/1061#pullrequestreview-1455810870. I will create a PR soon.