25 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
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
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
Allen Byrne 1602e1fbfe Remove autotools files and docs (#5358) 2025-03-14 13:28:44 -05: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 7ce8c6f81a Add options to allow tools type selection and naming (#4046) 2024-03-04 06:53:52 -08: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