A C++17 interface for HDF5
find_package()
calls. This currently supports CMake and Conan package managers. 59c0630 d67313cvarr_t<T>
that occurs when the inner type is also iterable. 196fdb0929c7c2 - Ignore .vs b0bcfef - Fix libaec compilation on windows edb07c6 - Updated the CMake-Conan integration cd41c84 - Updated dependencies in the CMake package installer d761b19 - Updated fmt to 1.10.1 on cmake builds d3f46e9 - Updated documentation build scripts e97f935 - Updated CMakePresets.json for windows 6f019e6 - Verbose ctest output on ci ab7b62b - Add missing include for using h5ppType.h independently 196fdb0 - Fix a leak in varr_t<T> that occurs when the inner type is also iterable. 08b5d3b - fix a typo in h5ppHdf5.h (#20) 269632b - Added a missing include for safe type casting 16a5da8 - Avoid warning in MSVC 600326c - Bump versions for dependencies in conanfile.py 44355aa - Remove const from the custom format signature for in fmt < 9.0.0 92e7c1d - Update hdf5 version compatibility to 1.14.2 c4c7ab5 - Update h5pp version efc9a0d - Clean compiler version log during cmake-conan configuration 48d543f - Updated dependencies b2867e3 - h5ppFstr: Use the type constructor instead of casting when returning 0 941e2e7 - Reverted spdlog due to the custom formatter no longer working for __float128 ee4ea74 - Added a custom fmt formatter for h5pp::fstr_t efce926 - Updated versions of hdf5 and spdlog af59592 - Added custom fmt formatters for h5pp::varr_t and h5pp::vstr_t 1f7f081 - Simplified std::complex formatting a53d2a7 - Fix byte size detection of std::vectorstd::string when writing variable-length arrays with string elements 20f38f4 - Use the data hyperslab dimensions, if present, when appending/extending a dataset 537aa3d - Clarify error message on mismatching bytes per element 45e2590 - Added support for std::array as elements in std::vector, and an accompanying exmaple a9d84c0 - Build tests and examples in release mode also 9208fab - Merge branch 'dev' ae8cd7f - Specify config in multi-config builds ab67985 - Use separaet cache keys for each workflow 3a4d52f - Avoid enforcing static linkage type if HDF5_USE_STATIC_LIBRARIES is not set ddd075d - Fixing minor issues with ci runners fcf4fa3 - New workflow for macos 12 59c975e - Fixed compatibility with older versions of fmt 4c1c78c - Reduce verbosity of tests 2cd600f - Fixed github actions builds 7fd5a77 - Simplified version handling of fmt and spdlog find_package modules 9bd7409 - Deprecated ubuntu 18 github actions workflow c20ad30 - Update apt before installing on the github action runners 2442a8c - Removed version range handling from find_package calls to support a wider version range f17d3fe - Clearer CMake-conan messages 3ec9f70 - Simplified fmt and spdlog find modules 05264c7 - Disable plain find_package build on mac a105183 - Only use the fmt complex formatter for fmt v9 and up 3faaf65 - Only use __float128 when H5PP_USE_FLOAT128 is defined a09ff7a - Removed conan v1 code from conanfile.py 2289953 - Append the module dir if not present d6080ac - Simplified CMake installation and moved to using the new CMake dependency provider mechanism a668e21 - Vastly simplified github actions routines 78f07c1 - Move code for expanding targets to PrintTargetInfo.cmake 507beb9 - Simpler estimate of number of cores using d67313c - Simplified CMake installation and moved to using the new CMake dependency provider mechanism d886ea4 - Fixed and added some of the CMake Presets. Deprecated use of conan v1 8301fb0 - Use #if defined() to detect support for FLOAT128 d4c5930 - Fixed a CMake dev warning about DOWNLOAD_EXTRACT_TIMESTAMP when using CMake 3.24 40801a0 - Updated some wording and installation instructions using CMake Presets 632615a - Default initialize hvl_t to {0, nullptr} to avoid access to uninitialized data afe9af6 - Add support for fstr_t in existing utility functions b4f2204 - Added a fixed-size string wrapper that can convert to and from floating point. ca69a65 - Implementing fstr_t wrapping fix-length string data da4c060 - Revert putting debug_vstr_t into the vstr_t class d337621 - Log resize of std::vectorstd::byte when reading table records a96b10d - Make sure to de-allocate contained types in h5pp::varr_t before deallocating self 24dba7d - Pass dset transfer property list to all H5Dread/write calls cb46921 - Added support for __float128 and quadmath b927c20 - Added new type detection for arrays type and native types in h5pp::type::getH5TypeName eeb8f89 - New free function h5pp::type::getH5ClassName to get the class of a type id. 0ed354a - Added include h5ppEnums.h to allow the inclusion of just h5ppLogger.h 9eec9c8 - Use dataspace instead of dsetspace when tracking vlen reclaims e930258 - Check if the macro H5PP_USE_FLOAT128 is defined instead of == 1 or 0. 412e043 - Added support for casting h5pp::vstr_t to/from floating point. d3982ae - Stricter checks of ptr in vstr_t d9b7b6a - Prettier printing of compound type fields 13760d8 - Added debug development logging when tracking memory reclaim 1d7fef5 - Use dataspace instead of dsetspace when tracking vlen reclaims c941dba - H5TInfo: added memberClass field listing the hdf5 classes of a type id a9e6b26 - constexpr detection of using vlen_type in structs/compound datatypes 63c3682 - Simplify version selection cc8bc04 - Add support for varr_t<vstr_t> to mimic std::vectorstd::string 8b0a1e2 - Use calloc to zero allocated memory in varr_t. 9ab86c1 - Safer preprocessor macros for detecting zlib dd7be0e - Updated github actions to support conan v2 817f24e - Updating conanfile to support conan v2 6840591 - Improved fmt formatter for std::complex c872043 - Added support for __float128 b32d03b - Update versions 1feffe3 - Update the fmt cmake module 3888555 - Transmit property lists through all function calls 848c4d7 - Implement safe casting of integral types with runtime checks for range validity bba5354 - Fixed chunk dimension test that wasn't actually testing chunking 59c0630 - Use CMakePresets.json to simplify installation and to enable conan with the new CMake dependency provider feature 0784f85 - Removed unnecessary const qualifier causing a warning in gcc-12 7182507 - Clarified error message when attributes are created on non-existing links ec4c9aa - Fixed new warnings in CMake 3.25 about missing imported library location c4c182d - Fixed some typos in README.md
Fixes an issue with a test in FindFilesystem.cmake not passing after installing h5pp.
h5pp::varr_t<>
and h5pp::vstr_t
to hold variable-length data in structs for compound types or table fields. See examples 01d, 04c and 04e.
h5pp::File::vlen???(...)
to control tracking of variable-length data allocations made by HDF5. Users can enable/disable tracking and call h5pp::File::vlenReclaim()
to free all allocated memory in one go if tracking is enabled.h5pp::File::deleteAttribute(...)
HDF5
1.12 to 1.13spdlog
1.10.0 to 1.11.0linkPath
before attrName
.
auto A = file.readAttribute<T>("nameOfAttribute", "path/to/link");
// Changes to
auto A = file.readAttribute<T>("path/to/link", "nameOfAttribute");
If this type of mistake is detected, h5pp will throw a runtime exception with a message like:
Could not read attribute [nameOfAttribute] in link [path/to/link]: Link does not exist.
NOTE: h5pp v1.10 and above requires the 'linkPath' argument before 'attrName'
<filesystem>
or <experimental/filesystem>
TableFieldInfo
(and related functions) for more efficient interaction with table fields. The old TableInfo
still exists and now derives from TableFieldInfo
h5pp::File::getTableFieldInfo
to get table field information such as names, sizes and offsets.h5pp::File::fieldExists
to check if table fields exist by name or index.std::optional<T>
. E.g. auto A = file.readDataset<std::optional<double>>("some/dataset")
, which returns std::nullopt
if some/dataset
does not exist on file (instead of throwing an exception).h5pp::Options
, and for reading as a custom h5Type.h5pp::File::attributeExists(...)
.std::byte
container.-1
to read the last element of a table (as in python).h5pp::File::FileHandleToken
to keep the file handle alive during batch IO using RAIIh5pp::File::getLinkInfo(linkpath)
h5pp::File::readTableField
which did not return data at end of scopeh5pp::FilePermission
to h5pp::FileAccess
. The old name still works though.HDF5
1.12.0 to 1.12.1 on conan installs (1.13.1 otherwise).spdlog
1.9.2 to 1.10.0.fmt
8.0.1 to 8.1.1h5pp
should remain compatible with older versions of these dependencies.
README.md
to documentation
cmake_find_package_multi
generator by default.--loglevel=DEBUG
to get more information during CMake configuration)This update brings some bug fixes and many improvements to the internals of h5pp
, in particular to the initialization of a file. In addition, many changes have been made to the CMake build/install process of h5pp
itself and its handling of dependencies.
C++
int8_t
, int16_t
, ...)std::complex
, Scalar2
and Scalar3
much more efficiently.CMake
find_package(h5pp)
should now successfully import a target h5pp::h5pp
in all the different configurations.79ddb1b Added new example showing how to copy datasets between files
e111340 Updated spdlog 1.8.2 -> 1.8.5
9939add Rewrite of compound data type detection: std::complex, Scalar2, Scalar3
3719bca Added coverage support
3fe9273 use std::begin/std::end in templated contexts
97eb1d8 Add ghc::filesystem to cpm-mode
8f3ba74 Add [[maybe_unused]] to avoid warning
47d2ac6 Add support for the CPM package manager
5ae1f8d More robust version checking in Findspdlog.cmake and Findfmt.cmake
c8e5047 Fixing the custom Find<PackageName> modules to find local dependencies
b0a7c5f Fixed setting REQUIRED flag on find_package when H5PP_PACKAGE_MANAGER=find
f2bdc63 Add H5PP_DEPS_INSTALL_DIR as HINTS to find<PackageName> modules
87e9823 Drop support for conda packages.
5b72f2a Fail if HDF5 is not found when H5PP_PACKAGE_MANAGER=find
459bfc8 include cstddef for std::byte
f6d4777 Updated hdf5 build on fetch-mode
76a801e Updated github actions matrix
de10161 More complete CMake configure message
dd817b0 Give find_library/find_path correct hints and path suffixes when finding zlib
f7ae546 Avoid warning with -Wpedantic
85090d9 Add check_required_components(h5pp) to config.in as is recommended
53be358 Improved deprecation notice for old options
e087007 Refactor SetupSearchPaths.cmake to SetupPaths.cmake since it has more general purposes now
602875c Rename H5PP_DEPS_IN_SUBDIR -> H5PP_PREFIX_ADD_PKGNAME
8f39549 Use <PackageName>_ROOT
mechanism to find ZLIB and SZIP when building HDF5
612c9c9 Default H5PP_DEPS_INSTALL_DIR to CMAKE_INSTALL_PREFIX
323c8ea * Rename H5PP_DEPS_IN_SUBDIR -> H5PP_PREFIX_ADD_PKGNAME * Windows: Collect binaries in the same build directory
f30ccda Clarify purpose for setting CMAKE_FIND_LIBRARY_SUFFIXES as a cache variable
0472d06 Use standard path <PackageName>_FOUND
is true after find_package
1c0ce91 Add rpath settings for dependency libraries built by h5pp
afc67c3 Simpler overrideable settings for cxx standard in dependency builds
a8e2ec2 Simplified build externalproject_add call by adding variables to initial cache instead
0670039 Updated build of ghc::filesystem
adaffc4 Make sure find_library() finds static/shared libraries correctly based on BUILD_SHARED_LIBS
9185156 Replace backslash in windows paths with forward slashes to avoid unintended escape
46b6df8 Let CMake autodetect the language during dependency builds
d3398a0 Simplified get_num_threads.
3191264 Rename BuildDependency.cmake to InstallPackage.cmake
35d8e84 Prepend h5pp-
to target names for tests and examples
ac150e3 Use the initial-cache feature of CMake to propagate the build configuration to subprocesses
ff06fab Corrected home directory on windows10.yml
25de94d Debugging FindHDF5.cmake on CI
93815ad Add PATH_SUFFIXES to find_library call so that aec/szip/zlib can be found also when H5PP_DEPS_IN_SUBDIR=OFF
7dd5276 Print install message for aec and zlib
130d155 Transmit -fPIC to depedendency builds
d241d6d Simpler preemption of Threads::Threads
ea1e3cd More careful use of NO_CMAKE_... flags when searching for HDF5
40ed005 Add option H5PP_PACKAGE_MANAGER=fetch to h5ppConfig.cmake
a149a64 Set <PackageName>_ROOT in for dependencies built by h5pp using H5PP_PACKAGE_MANAGER=cmake in generated h5ppConfig.cmake
b94de58 H5PP_PACKAGE_MANAGER=cmake will now handle ZLIB and SZIP dependencies of HDF5 properly
afdcce7 Refactor the setup of std::filesystem to avoid code duplication
8ee6dd4 Set CXX standard when H5PP_PACKAGE_MANAGER=fetch
5b1783d Refactor the setup of std::filesystem to avoid code duplication
3ecc4c7 Github actions: Test some new build configurations
763edb6 Updated steps for preempting the target Thread::Thread in h5ppConfig.cmake.in
f153c6d Updated script for getting the drop-in replacement ghc::filesystem if std::filesystem is missing
639f66f Faster check of std::optional header using try_compile, which works without global variable CMAKE_CXX_STANDARD
81f2044 Set CMAKE_CXX_STANDARD to 17 when building dependencies (if no standard has been set already)
de3eb16 H5PP_PACKAGE_MANAGER=cmake will now handle ZLIB and SZIP dependencies of HDF5 properly
1e20890 Updated check for whether h5pp is being used as subproject (i.e. with add_subdirectory from another project)
870c5c5 New H5PP_PACKAGE_MANAGER option: fetch
d2f9812 Updated dependency build scripts
8a4a23d Fix unusual error when printing target properties on edge-case imported interface libraries.
522db66 Deprecate use of variables <PackageName>_DIRECTORY_HINTS
bcb89e7 When using -DH5PP_PACKAGE_MANAGER=cmake
, use variables H5PP_DEPS_BUILD_DIR
and H5PP_DEPS_INSTALL_DIR
to control the dependency build/install locations
61f35a0 Updated modules Findspdlog.cmake and Findfmt.cmake to enable checking library versions directly on targets
ae18d93 Renamed all targets with a "h5pp-" prefix to avoid target name collisions with other libraries when using FetchContent
09e2bdf Updated dependencies to latest versions
ce68bff Correctly check whether a target is imported so that its location can be queried without failure.
4cfc8ec Stop checking and modifying the default CMAKE_INSTALL_PREFIX.
6c6569f Move headers from "h5pp/include/h5pp/..." to just include/h5pp/..."
ac5e3b6 Rename ResizePolicy enum members to more compact ones
163de06 Fix subtle leak of filehandle on repeated calls to "setKeepFileOpened()"
This is a minor release before a larger upgrade to h5pp 1.9.0 coming soon.
The most important change is the change of variable H5PP_DOWNLOAD_METHOD
--> H5PP_PACKAGE_MANAGER
596e2b8 Separate fmt and spdlog dependencies 8a98b42 Skip Eigen patch in cmake builds b210e82 Read whole name of object identifier 9ec8516 Added deprecation warning for H5PP_DOWNLOAD_METHOD: Use H5PP_PACKAGE_MANAGER instead 6707f12 Updated spdlog to 1.8.2 96769fe Updated fmt to 7.1.3 18f7c43 Updated naming conventions in CMake for automated installation of external libraries 33eede0 Remove .travis.yml -> move all ci to github actions 86429a2 Catch2 test for new user type versioning. (#5) 330a549 Added support for type override when reading datasets 92fdc67 Get the name of unknown types from the h5t class 56340b7 Added move constructors/assignment operators to h5pp::hid e31bfc0 Added [[nodiscard]] to member functions that read data from file 241a0fa Updated naming conventions in CMake for automated installation of external libraries bf59732 Added support for type override when reading datasets 0eafe21 Get the name of unknown types from the h5t class 86ecf92 Added move constructors/assignment operators to h5pp::hid 79cfd40 Added [[nodiscard]] to member functions that read data from file 8b06093 Updated naming conventions in CMake for automated installation of external libraries 9e8f15a Fix for finding precompiled headers e6ea67e Improve zlib detection/linking when building HDF5 from source and add support for szip 49b45f7 Fix FindHDF5.cmake in the case when the executable wrappers are broken 7dbe5a4 Corrected name of eigen conan package 160e02b Bump versions of spdlog and eigen aa19a4d Clarified examples f5cb3bd Fixing found HDF5 version error f2a3896 Separate fmt find routine from spdlog e901d8c New custom Findfmt.cmake module
Changes that affect users are in bold:
ae403b8 Updated bundled FindHDF5.cmake to support CMake 3.19+ ccda1d5 Clearer error message on failure to append to dataset 939181e Updated resizing of datasets and data buffers to account for hyperslab selections 06c1ffc Reorganized routine for selection of hyperslabs and added h5pp::File::readHyperslab and h5pp::File::writeHyperslab functions interact with parts of datasets c3b126a Properly delete constructors in OptDimsType and DimsType to avoid ambiguity e948625 Deleted some constructors in h5pp::Hyperslab to avoid ambiguities 2c4b172 Renamed ResizeMode --> ResizePolicy 49c7734 Added examples showing usage of hyperslabs f324a7c static_cast away compiler warning for implicit conversion a373e73 Replaced usage of strnlen and strncpy with the constructor of string_view 578e091 Added MSVC /EHsc compiler flag to avoid warning 79c2e33 Removed unnecessary include 421c15c Fixed printing of complex range in fmt 7.1.2 c90a593 Improved handling of hyperslab selection 09f2051 Make sure not to shrink a dataset to fit data when writing data to a hyperslab selection on dataset c27a065 Updated static_assert function names 32ee358 Fixed local fileHandle shadowing optional h5pp::File::fileHandle variable 3ce8722 Set default H5F_CLOSE_STRONG as in h5py 7712675 Faster iterator when finding links in a group fb45a26 Speedup by avoiding string composition for logging when not needed d594ae2 A table's parent group has to be checked for existence and created every time ce1ba28 More thorough check for table existence before creating a81367b Use [[nodiscard]] to make sure optional parameters have been set afba3af Check that optional h5type is defined before using cdf92d9 Use the faster attribute link check whenever possible f96cb80 Allow population or creation of new info objets 27e664f Only set info members if they are not not defined yet 22dc86f Assign optionals instead of moving 69e1252 Changed name h5pp::hdf5::checkIfAttributeExists --> h5pp::hdf5::checkIfAttrExists 3245b05 Stopped using short-circuit pattern when checking for existence of links 182a90a Scan missing metadata efficiently when using Info objects directly 36166a4 Allow to keep file open in const contexts b514202 Added feature h5pp::File::setKeepFileOpened() and h5pp::File::setKeepFileClosed() to avoid expensive operations opening and closing the file handle e.g. when doing batch operations in for loops 99112ff Add createTable(TableInfo) to follow the convention on other create___ functions cf9c8b7 No need to assert options when scanning attribute metadata eb39897 Return the AttrInfo object when writing attributes c98ef30 Select appropriate scan function in createDataset d11c9c9 Select appropriate scan function in writeDataset 5934a75 Rename h5pp::scan::makeDsetInfo --> h5pp::scan::makeDsetInfo to clarify intent 6b4646a Rename h5pp::scan::makeAttrInfo --> h5pp::scan::makeAttrInfo to clarify intent db97ed2 Rename h5pp::scan::getTableInfo --> h5pp::scan::makeTableInfo to clarify intent c30d105 Rename h5pp::scan::fillTableInfo --> h5pp::scan::readTableInfo to clarify intent 8bd0c50 New function infers attribute info based entirely on given options ca84694 Rename h5pp::scan::fillDataInfo --> h5pp::scan::scanDataInfo to clarify intent eee3dc5 Rename h5pp::scan::getDsetInfo --> h5pp::scan::inferDsetInfo to clarify intent 742ee41 Rename h5pp::scan::getDsetInfo --> h5pp::scan::inferDsetInfo to clarify intent 75623aa Rename h5pp::scan::fillAttrInfo --> h5pp::scan::readAttrInfo to clarify intent 99835a5 Rename h5pp::scan::fillDsetInfo --> h5pp::scan::readDsetInfo to clarify intent ab84d77 swapped function signature of fillDataInfo to follow convention 619edb7 Improved handling of options when populating metadata 9584baa Renamed some TableInfo members to follow convention on other Info structs 3e0d847 Rename TableInfo::getTableLocId() -> TableInfo::getLocId() 8f440da Permit passing options for interpreting data c9c034d Use path from either info or option to maximize chances of populating metadata 333594e Renamed some TableInfo members to follow convention on other Info structs f37e99b Improved handling of AttrInfo 5893ec3 Improved handling of location ID
This update mainly improves usage of tables. Most notably, h5pp
now supports copying/moving records between tables on the same or different HDF5 files.
Changes that affect users are in bold:
093c865 Improved examples 25dbaa3 Fixes to pass CI tests a10cd61 New options to enable precompiled headers and/or ccache to speed up compilation of examples and tests 5c32254 Use std::filesystem::path where applicable 69fc060 Reverted hid::h5f comparison of file id's to stop using H5Iget_file_id() (performance) 9a943ac New sanity check when reading tables: Just return if there are no records to read e22e140 Changed std::string_view on h5pp::File constructor to an std::filesystem::path for broader compatibility e31b75f Updated internal type detection logic and compile time error messages. a442cba Removed unnecessary compile time check 00fa83a Fixed test by making sections independent b08b752 Log warning when passing empty data container to tables accd0f8 Fixed compression level detection for tables and datasets 84d97ab Fixed some sfinae detection of h5 objects 9308449 Safer checks for when two file_id's point to the same file b6a3705 Add static assert when checking log level type ce26a9b Fixed function call when copying/moving to and from location 4095f7d Added support for moving links within and between files 98318b2 Construct Names/Indices on assigmnent 3e98387 Added error message if no field names or indices are given 94fd1b7 Implement a subset of variant instead of using full variant for name/index argument wrapper ce2309f Continued transition to catch2 for testing 7ef07d7 Reduce log level in test 14ce0b8 Use std::begin/std::end to detect iterables instead of member functions .begin/.end 39b4067 New helper constants for failing static asserts ee6d66c Separate setting of numFields and numRecords when scanning table metadata ec2a16b New wrapper class for taking field indices or names in a flexible way f771897 Make sure hyperslab selection succeeds or throws error 22e5bf2 Added support for reading table records using table selection (like in appendTableRecords) 7a4d411 Added support for reading one or multiple columns of tables by specifying field indices or names 812a5ad Use std::begin()/std::end() instead of dims.begin()/dims.end(), and copy these using the std::vector constructor taking iterators to support more types 620133e Trying out packing and alignment in msvc/gcc/clang 4f54087 Fixing type detection of field names or indices f86d978 clang-format 26fefbe Improving examples f56df2d Reduced width 0cb60e5 Require that fieldNames and fieldTypes are defined before reading from a table ab681b7 Fixed reading table field entries and added support for reading multiple table columns 1c78831 Throw error on failure to read table field 4df65fe Fixed bug when reading individual table fields 69598d1 Simplify example on README.md 672971e Mention new h5du: https://github.com/DavidAce/h5du 2dffcae Add links to conan-center 186ded6 Updated quickstart examples
Minor update: Small changes to the build process to conform with conan-center-index