Expand description
§zarrs_ffi
FFI bindings for the zarrs crate, a rust library for the Zarr V3 storage format for multidimensional arrays and metadata.
Developed at the Department of Materials Physics, Australian National University, Canberra, Australia.
zarrs
and zarrs_ffi
are experimental and in limited production use. Use at your own risk!
Example usage can be found in the examples.
Currently zarrs_ffi
only supports a small subset of the zarrs API.
§CMake Quickstart
- Install the rust compiler (and cargo).
- Put Findzarrs.cmake in your
CMAKE_MODULE_PATH
find_package(zarrs 0.6 REQUIRED COMPONENTS zarrs/bz2)
zarrs
is retrieved fromGitHub
using FetchContent and built using corrosion- Components are optional zarrs codecs
- the
zarrs
FFI library is available as thezarrs::zarrs
target
A complete CMake
example can be found in examples/cmake_project.
§Manual Build
§Basic Build
Building generates a header, and a platform-dependent static and dynamic library.
cargo build --release --features cbindgen # -> zarrs.h and target/release/[lib]zarrs_ffi{.a,.so,.dll,.dylib}
zarrs.h
is only re-generated if the cbindgen
feature is enabled.
§Enabling SIMD intrinsics
Encoding and decoding performance may be improved with avx2
/sse2
enabled (if supported).
Compile with either of:
RUSTFLAGS="-C target-cpu=native"
RUSTFLAGS="-C target-feature=+avx2,+sse2"
§Enabling non-default zarrs
codecs
Non-default zarrs
codecs (see zarrs
crate features) can be enabled by passing them as feature flags.
For example:
cargo build --release --features cbindgen --features zarrs/bitround,zarrs/zfp,zarrs/bz2,zarrs/pcodec
§Licence
zarrs_ffi
is licensed under either of
- the Apache License, Version 2.0 LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0 or
- the MIT license LICENSE-MIT or http://opensource.org/licenses/MIT, at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Enums§
- A zarrs data type.
Functions§
- Return the number of chunks in the chunk grid.
- Get the origin of a chunk.
- Get the shape of a chunk.
- Get the size of a chunk in bytes.
- Return the chunks indicating the chunks intersecting
array_subset
. - Returns the data type of the array.
- Returns the dimensionality of the array.
- Returns the shape of the array.
- Get the size of a subset in bytes.
- Retrieve a chunk from an array.
- Retrieve a subset from an array.
- Store a chunk.
- Store array metadata.
- Store an array subset.
- Create a handle to an existing array (read/write capability).
- Create a handle to a new array (read/write capability).
- Create a storage handle to a filesystem store.
- Destroy array.
- Destroy storage.
- Get the last error string.
- Get the zarrs version.
- Get the zarrs major version.
- Get the zarrs minor version.
- Get the zarrs patch version.
Type Aliases§
- An opaque handle to a zarr array.
- An opaque handle to a zarr store or storage transformer.