HighFive 3.0.0
HighFive - Header-only C++ HDF5 interface
|
[!NOTE] HighFive was orignally developed and maintained at https://github.com/BlueBrain/HighFive. To continue maintenance of HighFive as an independent open-source code without support from BBP or EPFL, some (one) of the developers decided to create this repository.
HighFive is a modern, user-friendly, header-only, C++14 interface for libhdf5.
It integrates nicely with other CMake projects through CMake targets:
H5Easy
provides a oneliner API for common, simple usecases.std::string
to/from variable- or fixed-length string datasetHere's an expanded version of the example provided above.
Note: As of 2.8.0, one can use highfive/highfive.hpp
to include everything HighFive. Prior to 2.8.0 one would include highfive/H5File.hpp
.
Note: For advanced usecases the dataset can be created without immediately writing to it. This is common in MPI-IO related patterns, or when growing a dataset over the course of a simulation.
For simple, common usecases the highfive/H5Easy.hpp interface provides single line solution. Here's the example from the introduction again:
where A
in this example can be replaced by other scalar variables or any of the supported containers, i.e. STL, Boost, XTensor, Eigen and (Easy-only) OpenCV. See easy_load_dump.cpp for more details.
Note: Classes such as H5Easy::File
are just short for the regular HighFive
classes (in this case HighFive::File
). They can thus be used interchangeably.
We strive to have one example per usecase or feature of HighFive, see src/examples/ for more examples.
There's two common paths of integrating HighFive into a CMake based project. The first is to "vendor" HighFive, the second is to install HighFive as a normal C++ library. Since HighFive makes choices about how to integrate HDF5, sometimes following the third Bailout Approach is needed.
Regular HDF5 CMake variables can be used. Interesting variables include:
HDF5_USE_STATIC_LIBRARIES
to link statically against the HDF5 library.HDF5_PREFER_PARALLEL
to prefer pHDF5.HDF5_IS_PARALLEL
to check if HDF5 is parallel.Please consult tests/cmake_integration
for examples of how to write libraries or applications using HighFive.
In this approach the HighFive sources are included in a subdirectory of the project (typically as a git submodule), for example in third_party/HighFive
.
The projects CMakeLists.txt
add the following lines
Note: add_subdirectory(third_party/HighFive)
will search and "link" HDF5 but wont search or link any optional dependencies such as Boost.
Note: The two targets HighFive
and HighFive::HighFive
are aliases. The former is older and works with v2, while the latter was introduced in v3, because CMake targets work more nicely if they contain ::
.
Alternatively, HighFive can be install and "found" like regular software. The project's CMakeLists.txt
should add the following:
Note: find_package(HighFive)
will search for HDF5. "Linking" to HighFive
includes linking with HDF5.
To prevent HighFive from searching or "linking" to HDF5 the project's CMakeLists.txt
should contain the following:
HighFive does not attempt to find or "link" to any optional dependencies, such as Boost, Eigen, etc. Any project using HighFive with any of the optional dependencies must include the respective header:
and add the required CMake code to find and link against the dependencies. For Boost the required lines might be
HighFive integrates with the following libraries:
We use semantic versioning. Currently, we're preparing v3
which contains a limited set of breaking changes required to eliminate undesireable behaviour or modernize outdated patterns. We provide a Migration Guide, please report any missing or incorrect information to help others make the switch more easily.
v2.x.y
are stable and any API breaking changes are considered bugs. There's like not going to be very many releases of the v2
line once v3
is stable.v3.0.0-beta?
are pre-releases of v3.0.0
. We predict that one more breaking changes might happen: the string handling is confusing to some of the maintainers and the default encoding is inconsistent (and will likely be made consistent).
For codes that either use std::string
when dealing with strings, or that don't use strings with HDF5 at all, we don't currently have any additional breaking changes planned for 3.0.0.
Please first check if your question/issue has been answered/reported at BlueBrain/HighFive.
Do you have questions on how to use HighFive? Would you like to share an interesting example or discuss HighFive features? Head over to the Discussions forum and join the community.
For bugs and issues please use Issues.
HighFive releases are uploaded to Zenodo. If you wish to cite HighFive in a scientific publication you can use the DOIs for the Zenodo records.
HighFive was created and maintained as part of the BBP from 2015 until Dec 2024 (when BBP closed) at BlueBrain/HighFive.
Please consult its README for funding information by the Blue Brain Project or EPFL.
One of the main contributors to BlueBrain/HighFive wanted to keep the project alive past the end of BBP. This repository was created to provide a seemless continuation of HighFive; and prevent fracturing or capturing of the project.
This repository is not supported by the Blue Brain Project or EPFL.
Boost Software License 1.0 Copyright © 2015-2024 Blue Brain Project/EPFL