38 Commits
Author SHA1 Message Date
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
Scot Breitenfeld 8f2c548743 Fix runExecute.cmake: restore ERROR_APPEND and fix zero-or-more mask patterns (#6484)
* Fix runExecute.cmake: restore ERROR_APPEND and fix zero-or-more mask patterns

Three bugs were introduced when runTest.cmake was refactored into runExecute.cmake:

1. ERROR_APPEND=1 support was dropped. Tests that redirect their error-stack
   output to stderr and rely on ERROR_APPEND to combine it with stdout before
   comparison (e.g. H5TEST-err_compat, H5TEST-error_test) fail silently because
   the reference file never matches the truncated actual output.

2. " line [0-9]*" uses zero-or-more digits, so it matches " line " (with zero
   digits) in already-masked reference text like " line (number)", prepending
   another "(number)" and producing " line (number)(number)".

3. "HDF5 [1-9]*[.][0-9]*..." has the "HDF5 " prefix and uses [1-9]* (zero-or-
   more), so it does not match "2.2.0" in actual output (blocked by the leading
   "("), and double-masks "version (number)" in the reference.
   "H5Eget_auto[1-2]*" / "H5Eset_auto[1-2]*" have the same zero-or-more issue,
   double-masking "(1 or 2)" already present in reference files.

Fix: restore ERROR_APPEND handling; change * to + for all digit/char class
quantifiers that can match zero occurrences in already-masked reference text;
remove the "HDF5 " prefix from the version pattern. Same fix applied to
HDF5Examples/config/cmake/runExecute.cmake which has identical bugs.

* Fix AOCC CI: source setenv_AOCC.sh from its actual install location

install.sh generates setenv_AOCC.sh inside the aocc-compiler-VERSION/
directory (where it runs from), not in the repo root one level up.

* Fix AOCC CI: replace hardcoded runner paths with GITHUB_WORKSPACE

All /home/runner/work/hdf5/hdf5/ paths were hardcoded to the HDFGroup/hdf5
repo name. Running the workflow in any fork (e.g. brtnfld/hdf5_swmr_2)
puts the checkout under a different path, breaking AOCC/OpenMPI install,
configure, and build steps. Use $GITHUB_WORKSPACE / ${{ github.workspace }}
so the paths resolve correctly regardless of repo name.

* fix(aocc): source setenv_AOCC.sh from workspace root, not compiler subdir

install.sh places setenv_AOCC.sh in the workspace root, not inside the
aocc-compiler-X.X.X/ directory.

* Fix runExecute.cmake: anchor HDF5 version regex to full token

Replace the over-broad version pattern with one that matches the complete
'HDF5 (x.y.z)' token, preventing over-matching of IP addresses and other
version-like strings, and avoiding nested substitution artifacts in .err
reference comparisons. Applied identically to both copies of the file.
2026-06-30 14:05:00 -05:00
jhendersonHDF 2952bb9216 Mark several CMake variables as advanced (#6321) 2026-03-27 11:30:23 -05:00
Allen Byrne b754dcb8f2 Move Java wrappers to FFM using jextract and java 25 (#5957)
FFM build requires Java 25, Jextract 25.
Generates FFM bindings during configure.
JNI is default when the requirements are not met or can be forced.
Presets added for maven and FFM - JNI is default selection.
Enhanced Maven options will work with either JNI or FFM
New Workflows for testing and maven uploads.
Extensive documentation changes for java.
2025-11-04 14:03:06 -06:00
Allen Byrne 4202ae830c Adjust HDF5Examples HDF5 version var to correct version check issue for 2.0 (#5926)
Adjusts H5_LIBVER_DIR in CMakeLists.txt to include release version for major versions above 1, fixing #5925.
2025-10-23 10:40:32 -05:00
Allen Byrne 701b46daed Rename the HDF5Examples build option prefix (#5906)
Renamed all HDF5 examples build options from H5EX_* to H5EXAMPLE_* to better distinguish them from library options when building examples alongside the library.

Updated all CMake files, including:
Main examples CMakeLists.txt files
CMake configuration files in config/ directory
CMake preset files
Updated documentation files to reflect new option names
2025-10-08 15:53:44 -05:00
Larry Knox e3012ddc32 Set *PROVIDES* variables for all that are used in conditions for (#5757) 2025-09-04 08:03:43 -05:00
Allen Byrne 05ce57609c Rename the install config variables to indicate library state (#5716)
This update systematically renames variables across 2.0+ CMake files in the HDF5Examples directory and configuration templates. The goal is to change variables from sounding like build "options" (e.g., HDF5_BUILD_TOOLS, HDF5_ENABLE_PARALLEL) to reflecting library "state" (e.g., what features the installed library provides).
2025-08-28 10:06:37 -05:00
Matt L 01d61245fe Correct h5diff test ref files (#5596) 2025-06-12 13:04:24 -05:00
Matt L b93cd97ba3 Replace filtered temporary files with streams (#5583) 2025-06-06 11:03:08 -05:00
Matt L 17c16b659a Correct filtered test file cleanup paths (#5562) 2025-06-04 12:56:46 -05:00
Matt L b594d01986 Simplify runTest file filtering (#5552) 2025-05-30 12:39:15 -05:00
Allen Byrne 4cc7161fc2 refactor run scripts to a single macros with includes (#5538)
* Refactor the CMake scripts into a single script
* Adjust args to do grep testing
2025-05-24 16:26:46 -05:00
Allen Byrne aa9784ea25 Refactor the config/cmake folder #5446 (#5540)
* Update config/examples/HDF5AsSubdirMacros.cmake
* Move f90 config file and remove m4 dir
2025-05-22 11:20:51 -05:00
Allen Byrne cdc2ae109f Update HDF5Examples cmake files from root files (#5499) 2025-05-06 10:44:29 -05:00
jhendersonHDF 4a0c3b440b Fix usage of string (FIND ...) command in CMake files (#5470) 2025-04-23 07:25:03 -05:00
Allen Byrne aecd1b12f8 Add file exists checks and fix policy 53 warnings (#5422) 2025-04-21 16:15:25 -05:00
Allen Byrne 1602e1fbfe Remove autotools files and docs (#5358) 2025-03-14 13:28:44 -05:00
Harmen Stoppels 55bfec8f41 cmake: remove outdated rpath handling (#5271) 2025-01-29 08:48:25 -06:00
Allen Byrne ad3ea2633a Move hl example into HDF5Examples (#5057) 2024-11-04 05:22:27 -08:00
Allen Byrne 5425a571e0 Convert develop to v2.0.0 (#5006)
Switches previous 1.16/17/18 values to 2.0
2024-10-27 21:51:07 -07:00
Dana Robinson 7f1e49206d Renamed COPYING to LICENSE (#4978)
This is where most people will expect to find license information. The
COPYING_LBNL_HDF5 file has also been renamed to LICENSE_LBNL_HDF5.
The licenses are unchanged.
2024-10-18 21:13:04 -07:00
Allen Byrne a8520298e9 Add workflow that reports to CDash (#4864) 2024-09-26 12:06:05 -05:00
Allen Byrne 5e94301e71 Add THREADS check to configuration file (#4746)
* Cleanup threads package checks

* Check first if package was found

* Remove unnecessary dependent checks

* Remove Unused options and fix names of option prefix
2024-09-07 20:45:12 -05:00
Allen Byrne d309a40325 Fix binary examples process (#4666) 2024-07-30 07:33:46 -05:00
Allen Byrne 1fafdc9da3 Fix the examples for testing java with binaries (#4660) 2024-07-19 10:07:39 -05:00
Allen Byrne 033f2a8cb5 Add python testing for examples (#4628) 2024-07-12 21:28:38 -07:00
Allen Byrne dca6370691 Move C++ and Fortran and examples to HDF5Examples folder (#4552) 2024-06-08 06:46:09 -05:00
Allen Byrne 1dfaef2586 replace deprecated CMAKE_COMPILER_IS_GNU** (#4272) 2024-03-28 09:20:57 -07:00
Allen Byrne 50a6522322 Change compression tests reference files to use masking for compression ratios (#4083)
Rework TEST_FILTER tests to handle slightly different compression ratios
2024-03-10 16:43:37 -07:00
Allen Byrne 7ce8c6f81a Add options to allow tools type selection and naming (#4046) 2024-03-04 06:53:52 -08:00
Allen Byrne 3fd1e90df6 Update and Add general INSTALL (#4016) 2024-02-23 08:02:18 -06:00
Allen Byrne bdddf43f1a Correct String FIND for runTest and grepTest (#4022) 2024-02-15 17:49:32 -06:00
Glenn Song 14ed93e749 Update install texts (#4010)
* Update INSTALL_CMake.txt as necessary

* Update remaining docs that use HDF5_USE_GNU_DIRS

* Update options in HDFMacros in HDF5Examples
2024-02-14 07:37:18 -06:00
Allen Byrne 0a93152541 Fix overwritten preset names (#4000) 2024-02-09 11:03:33 -06:00
Allen Byrne aa734a5d7e Add VDS examples and fix non-standalone build (#3898)
* Choose a size for rdata dimension

* Fix platform naming conflicts

* Fix doxygen references to point within library repo
2023-12-21 09:53:24 -06:00
Allen Byrne 6f2d22d86e Add variable option syncing for examples (#3885) 2023-12-14 12:50:30 -06:00
Allen Byrne fc88fcde10 Develop merge examples (#3851)
* Merge examples repo into library

* Change grepTest to be more fault-tolerant

* Update examples macro file

* Exclude all Fortran examples from doxygen
2023-11-27 15:30:15 -06:00