Commit Graph
1908 Commits
Author SHA1 Message Date
Scot Breitenfeld 109e670e73 Fix h5open_f failing to re-initialize the Fortran interface (#6642) (#6649)
h5close_f reset its count of the objects created by h5open_f with

  CALL h5fget_obj_count_f(INT(H5F_OBJ_ALL_F,HID_T), H5F_OBJ_ALL_F, &
                          H5OPEN_NUM_OBJ, error)

passing the H5F module variable H5OPEN_NUM_OBJ as the actual argument for
the INTENT(OUT) obj_count dummy, while h5fget_obj_count_f also reads
H5OPEN_NUM_OBJ by use association. F2018 15.5.2.13 prohibits referencing a
variable through use association once it has been redefined through a dummy
argument in the same call, so the result depended on how the compiler
implemented argument association. Where the actual argument was passed by
reference the subtraction collapsed to 0 - 0 and produced the intended zero;
where the compiler used copy-in/copy-out it evaluated 0 - H5OPEN_NUM_OBJ and
left the count negative.

A negative count then defeats the guard at the top of h5open_f, which returns
early when H5OPEN_NUM_OBJ is non-zero. h5open_f reported success without
calling h5init_types_c, leaving H5T_NATIVE_INTEGER and the other predefined
types holding identifiers that h5close_f had released.

h5close_f now assigns the count directly, which is what the comment there has
always described. h5fget_obj_count_f computes into a local variable so that no
caller can reintroduce the aliasing; note that this change alone would make
the old h5close_f call site produce the negative count on every compiler
rather than only on some, so the two belong together. H5OPEN_NUM_OBJ is also
given an initial value, since h5open_f tests it before anything assigns to it.

h5fget_obj_count_f subtracted every object created by h5open_f from a count of
a single object type, so with the interface open a query such as

  CALL h5fget_obj_count_f(INT(H5F_OBJ_ALL_F,HID_T), H5F_OBJ_FILE_F, n, error)

returned a negative n and hdferr of 0. h5open_f now records what it leaves open
per object type, and a count is adjusted by the recorded value for the types
being counted, so the adjustment does not depend on which types the
initialization creates. The check for a negative count runs both on the value
returned by H5Fget_obj_count and after the adjustment.

h5fget_obj_ids_f applied no such adjustment, so it returned the identifiers
h5open_f opened alongside the application's own and disagreed with
h5fget_obj_count_f about the same query: with only a file and a group open,
H5F_OBJ_ALL_F counted 2 objects but listed 62. The C API reports 2 and 2. An
application walking the list found datatypes it never opened, and closing them
breaks the Fortran interface. h5fget_obj_ids_f now excludes those identifiers,
requesting enough from H5Fget_obj_ids that max_objs of the application's own
can still be returned when the two are interleaved.

The h5open/h5close test verified its object counts by calling
h5fget_obj_count_f after h5close_f, when h5open_f is the only call the Fortran
interface permits. Those checks move to after the interface is reopened, where
they additionally confirm that the predefined types are valid again, that the
preceding h5close_f released the previous h5open_f's types, and that
h5fget_obj_ids_f agrees with h5fget_obj_count_f.

The Fortran tests also aborted unrecoverable failures with STOP, which exits
with a success status whether the stop code is absent or is a string, so a run
that died part way through reported no failure to CTest. They now exit through
h5_exit_f(1). The STOPs that end a run normally, in fflush1 and in the async
test's skip path for a build without MPI_THREAD_MULTIPLE, are unchanged.

Fixes #6642
Fixes #6648

Reported and diagnosed by Dom Heinzeller.
2026-09-01 15:12:55 -05:00
Scot Breitenfeld e4c16e9fca Fortran: simplify H5config_f.inc.cmake to use #cmakedefine directly (#6423)
All #cmakedefine01 CMAKE_H5_* blocks used a five-line pattern:

  #cmakedefine01 CMAKE_H5_HAVE_FOO
  #if CMAKE_H5_HAVE_FOO == 0
  #undef H5_HAVE_FOO
  #else
  #define H5_HAVE_FOO
  #endif

This is exactly what #cmakedefine H5_HAVE_FOO does: it emits
#define H5_HAVE_FOO (no value) when the CMake variable is truthy and
/* #undef H5_HAVE_FOO */ when falsy.  The CMAKE_H5_* intermediate
variables in fortran/src/CMakeLists.txt were only needed to feed these
blocks and are no longer required.

Replace all such blocks with #cmakedefine H5_HAVE_FOO, using the H5_*
variable directly.  MPI_LOGICAL_KIND retains its value via
#cmakedefine H5_MPI_LOGICAL_KIND @H5_MPI_LOGICAL_KIND@.

This also fixes a real bug: H5_FORTRAN_C_BOOL_IS_UNIQUE was emitted as
#define H5_FORTRAN_C_BOOL_IS_UNIQUE 0 when C_BOOL and default LOGICAL
are the same kind (e.g. Apple PowerPC ABI).  #ifdef only tests whether
a macro is defined, not its value, so the guard in H5_test_buildiface.F90
was always true and verify_c_bool was written into tf_gen.F90 regardless,
causing an "Ambiguous interfaces" build failure on that platform.
2026-06-02 08:13:50 -05:00
Dave Allured 8a2fb792ef tf.F90: Comment fix only, remove incorrect names (#6420) 2026-05-31 07:05:39 -05:00
Scot Breitenfeld 71763e74e7 Skip building Doxygen when no documentation inputs have changed (#6245)
Optimize Doxygen build process by skipping rebuilds when input files are unchanged, using timestamp checks in CMake configuration.

Behavior:
Skip Doxygen build if input files unchanged using timestamp check in CMakeLists.txt, hl/src/CMakeLists.txt, and src/CMakeLists.txt.
Introduces stamp files (hdf5lib_doc.stamp, hdf5hllib_doc.stamp) to track changes.
Documentation:
add_custom_command and add_custom_target used to manage Doxygen builds.
Shared Doxygen content inputs defined in top-level CMakeLists.txt for reuse.
Misc:
Reorder add_subdirectory(src) in CMakeLists.txt for visibility of Doxygen variables.
2026-03-10 06:56:39 -05:00
Scot Breitenfeld a7ec64a857 Split static targets into separate optional target [UPDATED] (#6216)
Build-tree exports can't diverge from install-tree exports — the export(EXPORT ...) reads directly from the install export sets. No manual list to keep in sync.

Removed 3 global variables (HDF5_STATIC_LIBRARIES_TO_EXPORT, HDF5_JAVA_LIBRARIES_TO_EXPORT, HDF5_UTILS_TO_EXPORT) and their ~21 set_global_variable calls across tool/utility files.

Fixed the static-only build bug in the PR where the base export set was guarded by BUILD_SHARED_LIBS, breaking tools export.

Removed redundant utils in export files — the PR was dumping tools into all three build-tree export files (java, static, shared). Now they correctly appear only in the base export.
2026-02-24 17:04:25 -06:00
jhendersonHDF 5f430099e9 Add CMake function to extract pkg-config info from libraries (#6220) 2026-02-18 12:12:34 -07:00
Julien Schueller d58638be09 CMake: Fix Fortran cross-compilation support
Refactor the cross-compilation infrastructure to rely on the standard
CMAKE_CROSSCOMPILING_EMULATOR variable instead of the custom
CROSSCOMPILING_PATH environment hack.

Key changes:
- Removed `ENVIRONMENT "${CROSSCOMPILING_PATH}"` from all test definitions.
- Updated custom commands (e.g., H5match_types, H5_gen) to invoke the
  emulator explicitly when cross-compiling.
- Updated ConfigureChecks.cmake and HDF5UseFortran.cmake to enable
  `try_run` checks when an emulator is defined.
- Added config/toolchain/mingw-w64-x86-64-wine.sh wrapper to automatically
  locate MinGW runtime libraries (like libgfortran) for Wine execution.
- Cleaned up toolchain files to remove hardcoded emulator paths, deferring
  configuration to the build environment.
2026-02-13 14:45:02 -06:00
Scot Breitenfeld a46a399230 Fixes the "multiple @param documentation sections" doxygen warnings (#6195)
Addresses the "multiple @ param documentation sections" warnings are caused by the interaction of three things:

1. MACRO_EXPANSION = YES with EXPAND_ONLY_PREDEF = NO in Doxyfile.in

2. Versioned API macros in H5version.h like:

\def documentation in APIVersions.dox like:

3. \def H5Tarray_create \api_vers_2{H5Tarray_create,H5Tarray_create1,H5Tarray_create2}

Because Doxygen expands all macros, it sees H5Tarray_create as an alias for H5Tarray_create1. It then associates documentation from both the \def block (for the macro) and the function's own doc block (with \param entries) with the same function — resulting in "multiple @ param documentation sections."

* Update Doxygen version from 1.16.0 to 1.16.1

Use Doxygen 1.16.1 for all platforms. This version includes the latest
bug fixes and improvements while maintaining compatibility with our
documentation format.

* Fix Windows Doxygen installation for version 1.16.1

Handle different Windows binary naming conventions across Doxygen versions:
- 1.16.1 uses: doxygen-VERSION.windows.x64.bin.zip
- 1.16.0 uses: doxygen-VERSION.x64.bin.zip

Try the newer naming convention first, then fall back to the older one
if the download fails. This ensures compatibility across versions.

* Use ssciwr/doxygen-install in setup-doxygen action

Replace direct installation of official Doxygen binaries with
ssciwr/doxygen-install action. This avoids Java documentation parsing
errors that occur with official binaries but not with distribution
builds.

The setup-doxygen action now serves as a thin wrapper around
ssciwr/doxygen-install@f13be16c83 (v1),
using commit hash for security and reproducibility.

* Remove redundant version specification from workflows

The setup-doxygen action already has a default version (1.16.1),
so explicit version specification in workflows is unnecessary.
This follows DRY principles and makes version updates simpler.
2026-02-12 10:45:17 -06:00
efferre79 476c60961c the targets interface should support HDF5_INSTALL_INCLUDE_DIR (#6142) 2026-01-13 10:27:38 -06:00
jhendersonHDF d1efeba7be Add predefined datatype for FP4 format (#6122)
Adds predefined datatype for FP4 data in E2M1 format

Does not add support for any native FP4 types; datatype conversions are performed in software
2025-12-31 11:44:08 -06:00
H. Joe Lee c0d2cf6993 chore: make comment consistent in tH5T_F03.F90 (#6128)
There is 1 `Creates`. The rest (=87) are `Create`.
Change `Creates` to `Create`.
2025-12-24 07:59:04 -06:00
jhendersonHDF 441d83a896 Add predefined datatypes for FP6 formats (#6097)
Adds predefined datatypes for FP6 data in E2M3 and E3M2 formats

Does not add support for any native FP6 types; datatype conversions are performed in software
2025-12-19 12:56:54 -06:00
Scot Breitenfeld 91ae855c0b Add Fortran SWMR wrappers (#5985)
* Add Fortran wrappers for H5Fstart_swmr_write, H5Dflush, and H5P{set,get}_append_flush
* corrected C doxygen docs for H5Pget_append_flush, clarified Fortran
2025-11-11 15:32:31 -06:00
jhendersonHDF eb72e67ed2 Add predefined datatypes for FP8 formats (#5882)
Adds predefined datatypes for FP8 data in E4M3 and E5M2 formats

Does not add support for any native FP8 types; datatype conversions are performed in software
2025-11-03 15:10:22 -06:00
Scot Breitenfeld a6d7b94c0c Added missing parameters H5F_ACC_SWMR_READ_F and H5F_ACC_SWMR_WRITE_F (#5961) 2025-10-31 12:59:45 -05:00
Neil Fortner 5e03b3a315 Change default file format to 1.8 (#5949)
Change default file format to 1.8 across various tests and examples, updating file creation and access logic accordingly.

Behavior:
Default file format version changed to 1.8 in H5Pfapl.c.
Updated file creation and access to use 1.8 format in h5ex_g_compact.c and test_file_image.c.
Set earliest file format in multiple test files including cache_tagging.c, dtypes.c, and links.c.
Tests:
Modified expected output in tools/test/misc/expected/*.ls files to reflect new file format locations.
Adjusted test logic in test_file_image.c and cache_tagging.c to accommodate format changes.
Misc:
Added comments and TODOs for future format testing in test_file_image.c.
Minor variable renaming for clarity in test_file_image.c.
2025-10-30 15:26:12 -05:00
Scot Breitenfeld 5047b30ff6 Fortran changes to adhere to the filename/module convention (#5914)
Update the documentation table for using H5* API prefixes convention for naming files and modules.

Builds on PR #5912
2025-10-12 17:32:23 -05:00
Allen Byrne fb35cde24a Rework Fortran configure to allow cross compile overrides (#5720)
Behavior:
Modify HDF5UseFortran.cmake to handle cross-compilation by providing default KINDs and sizes when CMAKE_CROSSCOMPILING is true.
Default values for INTEGER and REAL KINDs and their sizes are set when cross-compiling.
Error messages are adjusted to reflect cross-compilation scenarios.
Logic:
Conditional checks added for CMAKE_CROSSCOMPILING to determine if default values should be used.
Default values include INTEGER KINDs {1,2,4,8,16} and REAL KINDs {4,8,10,16}.
Default sizes for native kinds are set to 4 for INTEGER and REAL, and 8 for DOUBLE PRECISION when cross-compiling.
Misc:
Adjustments to verbose messages to indicate when defaults are used during cross-compilation.
2025-10-12 17:30:46 -05:00
Zbigniew Piotrowski 61cfe6ca93 Fix Fortran compilation by adding a missing copy of the h5vfd.mod at the install stage. (#5912) 2025-10-10 16:45:54 -05:00
Matt L ac169ed3e8 Optimize VDS operations with r-tree (#5843)
Optimize VDS operations using R-tree spatial index, adding new API functions and tests for improved performance.

Behavior:
Introduces R-tree spatial index for optimizing VDS operations in H5Dvirtual.c.
Adds H5Pset_dset_use_spatial_tree() and H5Pget_dset_use_spatial_tree() to control R-tree usage.
Default behavior uses R-tree for VDS with more than 1000 mappings.
Implementation:
Adds H5RT.c, H5RTprivate.h, and H5RTpkg.h for R-tree implementation.
Updates H5Pdapl.c and H5Pdcpl.c to include R-tree properties.
Modifies H5Dvirtual.c to integrate R-tree in VDS I/O operations.
Testing:
Adds rtree.c for testing R-tree creation, search, and copy operations.
Tests R-tree integration with VDS in test/dsets.c.
Verifies R-tree behavior with different dataset access property list settings.
2025-10-07 12:13:28 -05:00
jhendersonHDF 748875a7d7 Add predefined datatypes for bfloat16 data (#5402)
Adds predefined datatypes for little- and big-endian bfloat16 data

Does not add support for any native bfloat16 types; datatype conversions are performed in software

Also adds missing float16 predefined types to fortran
2025-09-26 13:33:56 -05:00
Scot Breitenfeld 877cbf79a7 Adds new subfiling API H5FDsubfiling_get_file_mapping() (#5828)
Adds H5FDsubfiling_get_file_mapping() API to map logical HDF5 files to physical subfiles, with Fortran support and comprehensive testing.

Adds H5FDsubfiling_get_file_mapping() in H5FDsubfiling.c to retrieve subfile paths for a logical HDF5 file.
Updates Fortran interface in H5VFDff.F90 to include h5fdsubfiling_get_file_mapping_f().

Updates h5fuse.in to support a list of subfiles for processing with a new -l option.
2025-09-26 11:30:16 -05:00
Dana Robinson de775251ab Fix an snprintf warning in H5match_types.c (#5825)
gcc complains about writing too many characters into a buffer since
we're writing from a 2D array. This limits the output and quiets
the warnings.
2025-09-15 08:06:36 -05:00
Allen Byrne 63803d7115 allow better CMake version testing (#5727)
* add cmake latest workflow with lukka/get-cmake@latest
* Upgrade minimum CMake version to 3.26
2025-08-23 06:43:20 -05:00
Allen Byrne 497b65ad0f Add file header comments to CMake files (#5688) 2025-08-13 07:19:57 -05:00
jhendersonHDF 4a12cfec19 Align CMake compiler wrappers with old Autotools versions (#5649)
Implemented missing --help/-h, -c, -echo and -shlib/-noshlib options

Added new -nohl option to avoid building and linking against
high-level HDF5 libraries if desired

Implemented adding of HDF5 installation library directory to rpath of
resulting executable/library and added new -norpath option to avoid
this behavior if desired

Added parsing of HDF5_USE_SHLIB environment variable to determine
whether to link against shared or static HDF5 libraries

Added parsing of HDF5_PKG_CONFIG_ARGS environment variable to separate
pkg-config-specific options from compiler-specific options and prevent
conflicts
2025-07-28 07:42:52 -05:00
Allen Byrne 968cc9dd44 Add script to test examples with h5*cc pkg-config wrappers (#5486) 2025-07-16 13:57:43 -05:00
Allen Byrne f9ebbb9ab2 Move fortran flags processing after fortran enabled (#5627) 2025-07-10 10:31:47 -05:00
Allen Byrne 7dd078d9bf Add windows test deprecated CI (#5604)
* Disable directvfd for windows
* Windows must have config mode
2025-06-17 13:46:08 -05:00
Neil Fortner 1ca48703e3 Add H5Dread_chunk2() (#5506) 2025-06-17 11:11:13 -05:00
Allen Byrne d6ca8411de Correct name of CMake option to HDF5_ENABLE_DEPRECATED_SYMBOLS (#5587) 2025-06-12 18:47:01 -05:00
Allen Byrne 3f615e9eff Add static only workflows to CI (#5553) 2025-05-30 12:00:39 -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 0802170065 Move define check out of windows only block (#5536) 2025-05-15 13:06:03 -05:00
Dana Robinson 07e995d472 Clean up API decorations in H5api_adpt.h (#5511)
* Simplify H5api_adpt.h

This change also uses the shared markup (e.g., __declspec) in both
static and shared libraries as the shared markup is ignored when
building static libs.

* Renamed some API decorations

Some API decorations (used to hide __declspec on Windows, among other
things) have been renamed:

    H5_DLLCPP(VAR)           --> H5CPP_DLL(VAR)
    H5_HLDLL(VAR)            --> H5HL_DLL(VAR)
    H5_HLCPPDLL(VAR)         --> H5CPP_HL_DLL(VAR)
    H5_FCDLL(VAR)            --> H5FC_DLL(VAR)
    H5_FCTESTDLL(VAR)        --> H5FC_TEST_DLL(VAR)
    HDF5_HL_F90CSTUBDLL(VAR) --> H5FC_HL_DLL(VAR)

The shared library decorations are also now used when building static
libraries (where they are meaningless and ignored).
2025-05-06 09:00:56 -05:00
Michał Górny edb930f367 h5cc: Allow overriding the compilers written into the file (#5467)
* h5cc: Allow overriding the compilers written into the file

Add a set of `HDF5_H5CC_C_COMPILER`, `HDF5_H5CC_CXX_COMPILER`
and `HDF5_H5CC_Fortran_COMPILER` CMake variables that can be used to
override the compiler string written into `h5cc`, `h5c++`, etc.  This is
particularly useful when e.g. using ccache during the build,
as the ccache path otherwise ends up in `h5cc`.
2025-04-25 17:00:48 -05:00
Allen Byrne 57f179ca57 Do not install H5fortran_types.F90 in include diretory #4985 (#5408) 2025-03-28 07:44:51 -05:00
Allen Byrne 1602e1fbfe Remove autotools files and docs (#5358) 2025-03-14 13:28:44 -05:00
Matt L 331c000e6a Add H5Tdecode2, rename and deprecate H5Tdecode (#5213) 2025-01-24 08:13:43 -06:00
Scot Breitenfeld 980117be30 removed link creation related c-wrappers (#5190) 2024-12-31 12:31:03 -06:00
H. Joe Lee cd7682cd18 Remove CMake-3.31.0 warnings (#5091) 2024-11-19 13:09:31 -06:00
Scot Breitenfeld 35df4fb6a6 Fix parsing error of h(p)*c wrappers (#5060)
Add quotes to correctly handle whitespace.
2024-11-02 12:40:07 -07:00
jhendersonHDF 90429f5e7d Implement support for complex number datatypes (#4630)
* Implement support for complex number datatypes

Adds the new datatype class H5T_COMPLEX

Adds the new API function H5Tcomplex_create which creates a complex
number datatype from an ID of a base floating-point datatype

Adds the new feature check macros H5_HAVE_COMPLEX_NUMBERS and
H5_HAVE_C99_COMPLEX_NUMBERS

Adds the new datatype size macros H5_SIZEOF_FLOAT_COMPLEX,
H5_SIZEOF_DOUBLE_COMPLEX and H5_SIZEOF_LONG_DOUBLE_COMPLEX

Adds the new datatype ID macros H5T_NATIVE_FLOAT_COMPLEX,
H5T_NATIVE_DOUBLE_COMPLEX, H5T_NATIVE_LDOUBLE_COMPLEX,
H5T_CPLX_IEEE_F16LE, H5T_CPLX_IEEE_F16BE,
H5T_CPLX_IEEE_F32LE, H5T_CPLX_IEEE_F32BE,
H5T_CPLX_IEEE_F64LE and H5T_CPLX_IEEE_F64BE

Adds hard and soft datatype conversion paths between complex number
datatypes and all the integer and floating-point datatypes, as well as
between other complex number datatypes

Adds a special conversion path between complex number datatypes and
array or compound datatypes where the in-memory layout of data is the
same between the datatypes and data can be converted directly

Adds support for complex number datatypes to the h5dump, h5ls and
h5diff/ph5diff tools. Allows h5dump '-m' option to change floating-point
printing format for float complex and double complex datatypes, as well
as long double complex if it has the same size as double complex

Adds minimal support to the h5watch and h5import tools

Adds support for the predefined complex number datatypes and
H5Tcomplex_create function to the Java wrappers. Also adds initial,
untested support to the JNI for future use with HDFView

Adds support for just the H5T_COMPLEX datatype class to the Fortran
wrappers

Adds support for the predefined complex number datatypes and
H5Tcomplex_create function to the high level library H5LT interface
for use with the H5LTtext_to_dtype and H5LTdtype_to_text functions

Changes some usages of "complex" in the library since it conflicts with
the "complex" keyword from the complex.h header. Also changes various
usages of the word "complex" throughout the library to distinguish
compound datatypes from complex datatypes.
2024-10-31 13:54:25 -07: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
Scot Breitenfeld 610648efd2 The h5(p)*c parser retains escaped whitespace character (#4967) 2024-10-18 09:03:42 -07:00
Scot Breitenfeld ad307bf61f Updated hyperslab documentation (#4965)
* corrected Fortran docs for hyperslab selection

* updated hyperslab op doc
2024-10-17 09:17:20 -07:00
Scot Breitenfeld 6b43197b08 Fixed data typing errors discovered by promoting integers and reals. (#4947) 2024-10-11 16:18:48 -07:00
Dana Robinson 54f8f12ed9 Update clang-format to 17 (#4931)
Also bump the clang-format GitHub actions to 17
2024-10-04 19:49:35 -07:00
Quincey Koziol 767282f68a VOL refactor and cleanup (#4856)
Cleanup and prepare for thread-safety changes.

Big ideas:

* Wrap H5VL_class_t with H5VL_connector_t, so use of the class can be refcounted within the H5VL package, instead of relying on storing an ID within the H5VL_t struct and incrementing & decrementing the ID's refcount.
* Register H5VL_connector_t* for VOL connector IDs, instead of the H5VL_class_t*
* Stop other packages from rummaging around inside H5VL_connector_t and H5VL_object_t data structures, so that the H5VL package can change implementation details without coupled changes throughout the library

Small things:

* Simplified the coding for creating links
* Moved some routines into more logical locations
2024-10-03 12:19:33 -07:00