Matt L 767ac04b21 Fix standalone example build issues (#6598)
* Build the examples as C++11 to match the HDF5 C++ library

The standalone examples build forces CMAKE_CXX_STANDARD 98, but
H5public.h includes <cinttypes>, which requires C++11. Any C++
translation unit that includes hdf5.h is therefore affected, not just
users of the C++ API, and the HDF5 C++ library itself is built as C++11
(config/flags/HDFCompilerCXXFlags.cmake). The C++ examples do not
compile as a result, against static or shared HDF5 alike.

Only the standalone build is affected, which is why this is not visible
in ordinary use. The C++98 setting lives in BASIC_SETTINGS, and
HDF5Examples/CMakeLists.txt skips that whole block when
EXAMPLES_EXTERNALLY_CONFIGURED is set -- which HDF5 does for its own
in-tree example build (config/cmake/HDF5ExampleCache.cmake). Built in
tree, the examples inherit HDF5's C++11 and compile normally, and that
is the path the CI workflows exercise. The standalone path, where the
C++98 setting does apply, is driven by the release scripts rather than
by the workflows, and has the C++ examples off by default.

* Select the examples' HL, Fortran and C++ libraries on the right variable

When the examples are built standalone against an installed HDF5, the
HL, Fortran and C++ branches choose between the shared and static
libraries using BUILD_SHARED_LIBS, while the C branch just above them
uses H5EXAMPLE_USE_SHARED_LIBS.

H5EXAMPLE_USE_SHARED_LIBS is what decides whether the "shared" or the
"static" component is requested from find_package, so only the matching
HDF5_<linkage>_<lang>_FOUND variables are ever set. BUILD_SHARED_LIBS
cannot select a linkage on its own; it can only agree or fail to match.
Of its four combinations with H5EXAMPLE_USE_SHARED_LIBS, three produce
no observable difference. In the fourth, H5EXAMPLE_USE_SHARED_LIBS=ON
with BUILD_SHARED_LIBS unset, the shared branch is not taken and the
static branch cannot be, so the HL, Fortran and C++ examples are
disabled with "libs not found" even though the libraries are installed
and were found.

Use H5EXAMPLE_USE_SHARED_LIBS, which is the declared option and is
already what the C branch uses.

A build driven through config/examples/CTestScript.cmake does not reach
the broken combination, because it configures with
HDF5Examples/config/cmake/cacheinit.cmake, which forces
BUILD_SHARED_LIBS=ON. A direct cmake invocation without that cache file
does. In either case the HL, Fortran and C++ examples are off by
default, so this is only visible once they are enabled.

BUILD_SHARED_LIBS remains documented as a user option in
config/examples/HDF5_Examples_options.cmake but no longer influences
library selection; that comment should be revisited separately.
2026-08-19 19:31:41 -05:00
2025-10-06 16:35:59 -05:00
2026-08-19 00:22:44 -07:00
2026-01-21 23:02:49 -06:00
2024-05-23 16:44:33 -05:00

HDF5 Logo

BSD DOI MIME Type develop cmake build status OpenSSF Best Practices


What is HDF5?

This repository contains a high-performance library's source code and a file format specification that implements the HDF5® data model. The model has been adopted across many industries, and this implementation has become a de facto data management standard in science, engineering, and research communities worldwide.

The HDF Group is the developer, maintainer, and steward of HDF5 software. Find more information about The HDF Group, the HDF5 Community, and other HDF5 software projects, tools, and services at The HDF Group's website.

Quick Start

  • New to HDF5? Start with the INSTALL.md guide for compilation and installation instructions.

  • Ready to build? See INSTALL_CMake.md for CMake-based builds.

  • Running on HPC? Check out README_HPC.md for parallel HDF5 configuration.

Table of Contents

Documentation

Documentation for all HDF software is available at:

See the CHANGELOG.md file in the release_docs/ directory for information specific to the features and updates included in this release of the library.

Platform-Specific Guides

Several files in the docs/ directory provide platform-specific details:

File Description
INSTALL General compilation and installation instructions (start here)
INSTALL_CMake.md Building with CMake
README_HPC.md Building and configuring Parallel HDF5 on HPC systems
INSTALL_Windows.md Windows installation
INSTALL_Cygwin.md Cygwin installation
USING_HDF5_CMake.md Building HDF5 applications with CMake
USING_CMake_Examples.md Building and testing HDF5 examples with CMake

Help and Support

The HDF Group staffs a free Help Desk accessible at https://help.hdfgroup.org and also monitors the Forum. Our free support service is community-based and handled as time allows. We'll do our best to respond to your question as soon as possible, but please note that response times may vary depending on the complexity of the issue and staff availability.

If you're interested in guaranteed response and resolution times, a dedicated technical account manager, and more benefits (all while supporting the open-source work of The HDF Group), please check out Priority Support.

Forum and News

The HDF Forum is provided for public announcements, technical questions, and discussions of interest to the general HDF5 Community.

These forums are provided as an open and public service for searching and reading. Posting requires completing a simple registration and allows one to join in the conversation. Please read the quickstart guide for more information on how to get started.

Release Schedule

HDF5 release schedule

HDF5 does not follow a regular release schedule. Instead, updates are based on the introduction of new features and the resolution of bugs. However, we aim to have at least one annual release for each maintenance branch. The chart above shows past HDF5 releases that have reached end of life (EOL).

Release Progress

The badges below track the release currently in development.

Next Release

Latest Release

Critical Priority

High Priority

Medium Priority

Low Priority

The Next Release badge shows the in-development version (derived from H5_VERS_MAJOR/H5_VERS_MINOR in src/H5public.h), annotated with the target due date of the matching GitHub milestone when one is set. The Latest Release badge shows the most recently published release in that same major series, with its release date. The badges below them show the current progress of critical, high, medium, and low priority issues for the in-development release, with colors that reflect completion status:

  • 🟢 Green (90%+): Readying for Deployment - most issues completed
  • 🟡 Yellow (60-89%): Nearing Completion - on track for release
  • 🟠 Orange (40-59%): In Development - attention needed
  • 🔴 Red (<40%): Initial Phase - significant issues remain

Click the badges to view the detailed project board with current release items.

Downloads and Source Code

Snapshots and Releases

HPC Testing Results

View HPC configure/build/test results on CDash

Java Maven Artifacts

HDF5 Java bindings and examples are available as Maven artifacts. For detailed usage instructions including dependency configuration, repository setup, and platform-specific builds, see HDF5Examples/JAVA/README-MAVEN.md.

Contributing

We welcome contributions to HDF5! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.

How to Contribute

  1. Report Issues: Use our GitHub Issues to report bugs or request features
  2. Submit Pull Requests: Fork the repository, make your changes, and submit a PR
  3. Join Discussions: Participate in the HDF Forum

For detailed contribution guidelines, please contact us through the Help Desk.

How to Cite HDF5

If you use HDF5 in your research, please cite it. This repository includes a CITATION.cff file containing standard citation metadata.

Quick DOI: 10.5281/zenodo.17808558

Build Status

Click to expand detailed build status

Continuous Integration

HDF5 develop daily build status CVE regression OSS-Fuzz Status Link Checker Status

Integration Testing

HDF-EOS5 build status netCDF build status h5py build status

HDF5 filter plugins testing

HDF5 plugins testing

VOL and VFD Testing

HDF5 VOL connectors build status HDF5 VFD build status


S
Description
No description provided
Readme Cite this repository
966 MiB
Languages
C 76.4%
Java 9%
Fortran 5.2%
CMake 3.1%
HTML 2.2%
Other 4%