HighFive 2.7.1
HighFive - Header-only C++ HDF5 interface
|
Documentation: https://bluebrain.github.io/HighFive/
HighFive is a modern header-only C++11 friendly interface for libhdf5.
HighFive supports STL vector/string, Boost::UBLAS, Boost::Multi-array, Eigen and Xtensor. It handles C++ from/to HDF5 with automatic type mapping. HighFive does not require additional libraries (see dependencies) and supports both HDF5 thread safety and Parallel HDF5 (contrary to the official hdf5 cpp)
It integrates nicely with other CMake projects by defining (and exporting) a HighFive target.
std::vector
and nested std::vector
from/to any dataset with basic typesstd::string
to/from variable length string datasetstd::byte
in C++17 mode (with -DCMAKE_CXX_STANDARD=17
or higher)Note: H5File.hpp
is the top-level header of HighFive core which should be always included.
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.
See select_partial_dataset_cpp11.cpp
See create_attribute_string_integer.cpp
See src/examples/ subdirectory for more info.
For several 'standard' use cases the highfive/H5Easy.hpp interface is available. It allows:
HIGHFIVE_USE_EIGEN
),HIGHFIVE_USE_XTENSOR
).HIGHFIVE_USE_OPENCV
).whereby the int
type of this example can be replaced by any of the above types. 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.
HighFive can easily be used by other C++ CMake projects.
You may use HighFive from a folder in your project (typically a git submodule).
Alternativelly you can install HighFive once and use it in several projects via find_package()
.
A HighFive target will bring the compilation settings to find HighFive headers and all chosen dependencies.
Note: Like with other libraries you may need to provide CMake the location to find highfive: CMAKE_PREFIX_PATH=<highfive_install_dir>
Note: find_package(HighFive)
will search dependencies as well (e.g. Boost if requested). In order to use the same dependencies found at HighFive install time (e.g. for system deployments) you may set HIGHFIVE_USE_INSTALL_DEPS=YES
When installing via CMake, besides the headers, a HighFiveConfig.cmake is generated which provides the HighFive target, as seen before. Note: You may need to set CMAKE_INSTALL_PREFIX
:
As a header-only library, HighFive doesn't require compilation. You may however build tests and examples.
Note: Unit tests require Boost. In case it's unavailable you may use -DHIGHFIVE_USE_BOOST=OFF
. HighFive with disable support for Boost types as well as unit tests (though most examples will build).
If you want to propose pull requests to this project, do not forget to format code with clang-format version 12. The .clang-format is at the root of the git repository.
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.
The development of this software was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government's ETH Board of the Swiss Federal Institutes of Technology.
Copyright © 2015-2022 Blue Brain Project/EPFL
Boost Software License 1.0