-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring back compatibility with HDF5 < v1.12 #756
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,9 +35,6 @@ else | |
if libhdf5_size != filesize(Libdl.dlpath(libhdf5)) | ||
error("HDF5 library has changed, re-run Pkg.build(\\\"HDF5\\\")") | ||
end | ||
if libversion < v"1.12" | ||
error("HDF5.jl requires ≥ v1.12 of the HDF5 library.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Or something along those lines? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. Maybe it would be better if it's only printed when HDF5.jl is built (here it would be printed every time HDF5.jl is loaded), but I don't know if that's possible. Or maybe we could read an environment variable which would disable warnings, as in: if libversion < v"1.12" && get(ENV, "JULIA_HDF5_NOWARN", "0") == "0"
@warn "HDF5.jl requires ≥ v1.12 of the HDF5 library, but v\$libversion was detected. Use at your own risk..."
end There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably better to check if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think that will actually work, since the library would need to be loaded first. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case we could load it at build time, just to get the library version. Note that this will only be done when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just tried this, but the problem is that by default nothing is printed to the terminal when building a package. This is unless |
||
end | ||
end | ||
""" | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -713,16 +713,19 @@ dspace_scal = HDF5.Dataspace(HDF5.h5s_create(HDF5.H5S_SCALAR)) | |
dspace_norm = dataspace((100, 4)) | ||
dspace_maxd = dataspace((100, 4), max_dims = (256, 4)) | ||
dspace_slab = HDF5.hyperslab(dataspace((100, 4)), 1:20:100, 1:4) | ||
dspace_irrg = HDF5.Dataspace(HDF5.h5s_combine_select( | ||
HDF5.h5s_copy(dspace_slab), HDF5.H5S_SELECT_OR, | ||
HDF5.hyperslab(dataspace((100, 4)), 2, 2))) | ||
|
||
@test sprint(show, dspace_null) == "HDF5.Dataspace: H5S_NULL" | ||
@test sprint(show, dspace_scal) == "HDF5.Dataspace: H5S_SCALAR" | ||
@test sprint(show, dspace_norm) == "HDF5.Dataspace: (100, 4)" | ||
@test sprint(show, dspace_maxd) == "HDF5.Dataspace: (100, 4) / (256, 4)" | ||
@test sprint(show, dspace_slab) == "HDF5.Dataspace: (1:20:81, 1:4) / (1:100, 1:4)" | ||
@test sprint(show, dspace_irrg) == "HDF5.Dataspace: (100, 4) [irregular selection]" | ||
|
||
if HDF5.libversion ≥ v"1.10.7" | ||
dspace_irrg = HDF5.Dataspace(HDF5.h5s_combine_select( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it the Apparently that should be available on 1.10.7 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point... I was testing with 1.10.4, which is why it fails for me. Note that 1.10.7 is relatively recent, as it was released in September. |
||
HDF5.h5s_copy(dspace_slab), HDF5.H5S_SELECT_OR, | ||
HDF5.hyperslab(dataspace((100, 4)), 2, 2))) | ||
@test sprint(show, dspace_irrg) == "HDF5.Dataspace: (100, 4) [irregular selection]" | ||
end | ||
|
||
# Now test printing after closing each object | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/JuliaIO/HDF5.jl/blob/master/Project.toml will also need
~1.10.5
. I'd also update https://github.com/JuliaIO/HDF5.jl/blob/master/HISTORY.md and add a new section with v0.14.3 to mention these recent changes that we brought back v1.10.5 BB support and the minimum guaranteed version.