- HDF5 C library can now be built from source and linked in statically, enabled
via
hdf5-sys/static
feature (as of this release, the version of the bundled sources of the library is 1.10.6). CMake is required for building. For further details, see the docs forhdf5-sys
. - Thanks to static build option, the documentation will now be built on docs.rs; if it builds successfully, this will be the official documentation source from now on.
- Add support for HDF5 1.12 on all platforms and include it in CI.
- Switched CI from Travis/AppVeyor to GitHub Actions; for each pull request, we now run around 30 concurrent builds which provides with a much wider coverage than previously and has already revealed some issues that have been fixed. Platforms covered: macOS 10.15, Windows Server 2019, Ubuntu 16.04/18.04/20.04; HDF5 installation methods covered: conda, apt, homebrew, also official binaries on Windows. We now also test MPI versions of the library for both MPICH and OpenMPI on macOS / Linux.
- We now force the variable-length allocator that HDF5 uses when reading data
to use
libc::malloc
andlibc::free
, so that they can be deallocated properly byVarLenString
andVarLenArray
inhdf5-types
. Previously, this could cause a rare but serious failure for Windows builds when the default allocator used for vlen types by HDF5 was not matching the libc deallocator. - Use
std::panic::catch_unwind
in all cases where we uses extern C callbacks, so that they are panic-safe. Reader::read_raw
andReader::read_slice
should now beDrop
-safe in the event where the read operation fails and the destination type is not trivial.
- Implement
Default
forH5D_layout_t
,H5D_alloc_time_t
,H5T_cset_t
,H5D_fill_time_t
,H5D_fill_value_t
(based on what their values are set to in default property lists). - Derive
Debug
forErrorFrame
andErrorStack
. - Implement
Display
forTypeDescriptor
. - Implement
Dimension
for[Ix]
,&[Ix]
,[Ix; N]
and&[Ix; N]
.
h5check!
,h5lock!
,h5try!
,h5call!
andh5check()
are now public.globals
module containing HDF5 runtime constants is now also public.- Switch to using 1.0 versions of
syn
,quote
andproc-macro2
(which required a bit of a rewrite ofhdf5-derive
). - Bump
ascii
to 1.0, updatehdf5-types
to be compatible. - Bump other dependencies to their latest versions (
parking_lot
to 0.10,ndarray
to 0.13,bitflags
to 1.2,lazy_static
to 1.4,libloading
to 0.6,winreg
to 0.7). - Remove implementations of deprecated
Error::description()
. - Switch to
trybuild
instead ofcompiletest_rs
for derive-macro testing; enable full tests (including hdf5-derive) on both AppVeyor and Travis. - Update the minimum Rust version to 1.40 (because of
ndarray
andlibloading
).
- Use
H5_free_memory()
instead oflibc::free()
to free HDF5-allocated resources if possible (1.8.13+); this fixes some deallocation errors. - Fix wrong
H5D_DONT_FILTER_PARTIAL_CHUNKS
constant value. H5Z_filter_t
is changed toc_int
(was wrongfully set tohid_t
).
- Added support for HDF5 1.10.5 with bindings for new functions.
File::access_plist()
orFile::fapl()
to get file access plist.File::create_plist()
orFile::fcpl()
to get file creation plist.- Added high-level wrappers for dataset access H5P API (
plist::DatasetAccess
). - Added
hdf5::is_library_threadsafe()
function. - Added
Group::member_names()
. - Added
Datatype::byte_order()
. - Added
Dataset::num_chunks()
(1.10.5+). - Added
Dataset::chunk_info()
(1.10.5+).
- Changed
File
constructors, getting rid of string access modes:File::open(path, "r")
is nowFile::open(path)
File::open(path, "r+")
is nowFile::open_rw(path)
File::open(path, "w")
is nowFile::create(path)
File::open(path, "x" | "w-")
is nowFile::create_excl(path)
File::open(path, "a")
is nowFile::append(path)
- Also added
File::open_as(path, mode)
which accepts the mode enum. - Rewritten
FileBuilder
: it no longer accepts userblock, driver etc; all of these parameters can be set in the corresponding FAPL / FCPL:FileBuilder::set_access_plist()
orFileBuilder::set_fapl()
to set the active file access plist to a given one.FileBuilder::access_plist()
orFileBuilder::fapl()
to get a mutable reference to the FAPL builder - any parameter of it can then be tweaked as desired.FileBuilder::with_access_plist()
orFileBuilder::with_fapl()
to get access to the FAPL builder in an inline way via a closure.- Same as the three above for
create_plist
/fcpl
.
- As a result, all of the newly added FAPL / FCPL functionality is
fully accessible in the new
FileBuilder
. Also, driver strings are gone, everything is strongly typed now. - It's no longer prohibited to set FCPL options when opening a file and not creating it -- it will simply be silently ignored (this simplifies the behavior and allows using a single file builder).
- Added an explicit
hdf5_types::string::StringError
error type, as a resulterror-chain
dependency has been dropped. hdf5::Error
is now convertible fromndarray::ShapeError
;hdf5::ResultExt
trait has been removed.- Renamed
hdf5::hdf5_version()
tohdf5::library_version()
.
- Replaced deprecated
std::mem::uninitialized
withstd::mem::MaybeUninit
. - Fixed a serde-related problem with building
hdf5-sys
on Windows.
- Allow chunk dimensions to exceed dataset dimensions for resizable datasets.
- Default HDF5 location should now be detected automatically on Fedora Linux.
- Added
Group::link_exists()
. - Re-export
silence_errors()
at the crate root. - Added
from_id()
unsafe method at the crate root.
- Using
#[derive(H5Type)]
no longer requires addinghdf5-types
as a dependency.
- Added support for HDF5 1.10.
- Added Rust equivalents of HDF5 primitives: arrays, Unicode strings and ASCII strings – all of
them available in both fixed-size or variable-length flavours (
hdf5-types
crate). - Added
H5Type
trait that unifies the types that can be handled by the HDF5 library. This trait is implemented by default for all scalar types, tuples, fixed-size arrays and all types inhdf5-types
and can be used to createDatatype
objects. - Implemented
#[derive(H5Type)]
proc macro that allows for seamless mapping of user-defined structs and enums to their HDF5 counterparts. - Added high-level wrappers for file-creation H5P API (
plist::FileCreate
) and file-access H5P API (plist::FileAccess
), covering almost the entirety of FCPL and FAPL property list functionality. - Various improvements and additions to
PropertyList
type. - Added support for various file drivers (sec2/stdio/core/family/multi/split/log).
- Added support for MPIO driver (HDF5 has to be built with H5_HAVE_PARALLEL and the crate has to be built with "mpio" feature enabled).
- Added support for direct VFD driver (HDF5 has to be built with H5_HAVE_DIRECT).
- Added some missing bindings to
hdf5-sys
: driver-related FAPL bindings in h5p/h5fd (including MPIO and direct VFD drivers), MPIO bindings in h5p/h5f/h5fd. - Added core reading/writing API in
Container
, with support for reading/writing scalars, 1-d, 2-d, and dynamic-dimensional arrays, and raw slices. As a side effect, the main crate now depends onndarray
.Dataset
now dereferences toContainer
. - Added basic support for reading and writing dataset slices.
- When creating datasets, in-memory type layouts are normalized (converted to C repr).
- Added
packed
option toDatasetBuilder
(for creating packed HDF5 datasets). - All high-level objects now implement
Clone
(shallow copy, increases refcount).
- Renamed
hdf5-rs
crate (importable ash5
) tohdf5
(importable simply ashdf5
). - Renamed
libhdf5-sys
crate tohdf5-sys
(importable ashdf5_sys
). - Renamed GitHub repository to
aldanor/hdf5-rust
. - Updated the bindings and tests to the latest HDF5 versions (1.10.4 and 1.8.21).
- The build system has been reworked from the ground up:
hdf5-lib
crate has been removed; all of the build-time logic now resides in the build script ofhdf5-sys
.- The environment variables the build script reacts to are now
HDF5_DIR
andHDF5_VERSION
. pkg-config
is now only launched on Linux.- On macOS, the build scripts detects Homebrew installations, for both 1.8 and 1.10 versions.
- On Windows, we now scan the registry to detect official system-wide installations.
- Dynamic linking now works with conda envs;
HDF5_DIR
can be now pointed to a conda env. - A few definitions from
H5pubconf.h
are now exposed as cfg definitions, likeh5_have_parallel
,h5_have_threadsafe
andh5_have_direct
(this requires us to locate the include folder and parse the header at build time).
- Various clean ups in
hdf5-sys
: implementedDefault
andClone
where applicable, moved a few types and methods to matching parent modules. - Major refactor: trait-based type hierarchy has been replaced with a
Deref
-based hierarchy instead (53eff4f).ID
andFromID
traits have been removed. Traits likeLocation
,Object
and a few other have been replaced with real types (wrappers around HDF5 handles, same as the concrete types likeFile
). Subtypes then dereference into parent types, so the user can user methods of the parent type without having to import any traits into scope (for instance,File
dereferences intoGroup
, which dereferences intoLocation
, which dereferences intoObject
). - Dataspaces and property lists can now be copied via
.copy()
method (instead of.clone()
).
hbool_t
is now mapped to unsigned integer of proper size (either 1 byte or 4 bytes), depending on how the HDF5 library was built and on which platform.- Added missing bindings for previous versions (mostly in
h5p
andh5fd
modules). - Querying the HDF5 error stack is now thread-safe.
- Error silencing (
silence_errors()
) is now thread-safe. - Fixed wrong bindings for
H5AC_cache_config_t
.
- Removed
hdf5-lib
crate (merged it intohdf5-sys
, see above). - Removed
remutex
crate, using locking primitives fromparking_lot
crate instead. Container
trait has been removed, all of its functionality merged intoGroup
type.
- The version number jump is due to renaming crates
hdf5-rs
andlibhdf5-sys
tohdf5
andhdf5-sys
, respectively. Since there were already published crates with those names and the crates registry is meant to be immutable even if the crates are yanked, we had to bump the version so that it shadows all of the older versions.
- Full support of
msvc
target on Windows. CI tests on AppVeyor now use official reeases of HDF5 binaries (1.8.16, VS2015, x86_x64). Thegnu
target are still unofficially supported but won't be tested. - If
HDF5_LIBDIR
is not specified when building on Windows andPATH
contains what looks like thebin
folder of HDF5 installation, the library directory will be inferred automatically. The official HDF5 installers add thebin
folder to user path, so the official MSVC releases should just work out of the box without having to set any environment variables. - The library is now split into three crates:
hdf5-lib
(requests linkage to HDF5),hdf5-sys
(contains bindings, requireshdf5-lib
at build time in order to conditionally enable or disable certain HDF5 functionality), andhdf5
(the user-facing crate, requires both lower-level crates at build time). - Added
hdf5::hdf5_version
function. - The minimum required version of the HDF5 library is now 1.8.4.
- Both
hdf5-sys
andhdf5
crates can now use version attributes at compile time to enable/disable/change functionality. All functions and definitions that appeared in HDF5 versions past 1.8.4 are now conditionally enabled inhdf5-sys
. - Added bindings for HDF5 functions that were added in releases 1.8.15 and 1.8.16.
- Static global variables in HDF5 (H5E, H5P, H5T) are now linked based on HDF5 version and not
the target platform (
_ID_g
variables were introduced in 1.8.14). Whenmsvc
target is used, the dllimport stub prefixes are also accounted for. The constants exposed byhdf5-sys
are now of reference type and need to be dereferenced upon use (formsvc
, they have to be dereferenced twice).
- API simplification: many methods previously expecting
Into<String>
inputs now just take&str
. util::to_cstring
now takesBorrow<str>
instead ofInto<String>
so as to avoid unnecessary allocations, and the return value is now wrapped inResult
so that interior null bytes in input strings trigger an error.
- Fixed dangling pointer problems when strings were being passed as pointers to the C API.
- Fixed target path not being passed correctly in
Container::link_soft
.
Initial public version.