681 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
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
efferre79 476c60961c the targets interface should support HDF5_INSTALL_INCLUDE_DIR (#6142) 2026-01-13 10:27:38 -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
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
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
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
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
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
Allen Byrne f9ebbb9ab2 Move fortran flags processing after fortran enabled (#5627) 2025-07-10 10:31:47 -05:00
Neil Fortner 1ca48703e3 Add H5Dread_chunk2() (#5506) 2025-06-17 11:11:13 -05:00
Allen Byrne 3f615e9eff Add static only workflows to CI (#5553) 2025-05-30 12:00:39 -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
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
H. Joe Lee cd7682cd18 Remove CMake-3.31.0 warnings (#5091) 2024-11-19 13:09:31 -06: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
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
Allen Byrne 07756c87f5 Update develop to 1.18 API 2024-10-02 19:53:38 -05:00
Allen Byrne f77b70859f Rework Dynamic Analysis and sanitize testing (#4681)
* Ignore predetermined failing test and check pointer before use

* Rework Analysis process
2024-08-05 09:53:53 -05:00
Dana Robinson 9b5d9680af Clean up Fortran __float128 configure-time checks (#4649)
* Always use DECIMAL_DIG instead of LDBL_DIG. This was controlled by
  an ifdef that is always true in C99 or greater

It's confusing to use float.h C constants as variable names in
configure.ac and the PAC_FC_LDBL_DIG macro.

* Directly compare MY_FLT128_DIG and MY_LDBL_DIG

* Make uniform across CMake and Autotools
* Don't export quadmath.h variables to H5pubconf.h
2024-07-15 07:38:13 -05:00
jhendersonHDF 773831f3cb Add H5F_LIBVER_V116 to internal library version structures (#4619)
Also add H5F_LIBVER_V116 flag to Fortran wrappers
2024-07-02 09:26:05 -05:00
Scot Breitenfeld dfc6295c1d Fixed failures with xl compilers. (#4458)
* type cast constant

* fixed return types
2024-05-02 15:33:20 -05:00
Scot Breitenfeld abf8b01f55 H5R Fortran wrappers and misc. H5R API/DOC updates (#4446)
- Add Fortran H5R APIs:
      h5rcreate_attr_f, h5rcreate_object_f, h5rcreate_region_f,
      h5ropen_attr_f, h5ropen_object_f, h5ropen_region_f,
      h5rget_file_name_f, h5rget_attr_name_f, h5rget_obj_name_f,
      h5rcopy_f, h5requal_f, h5rdestroy_f, h5rget_type_f

    - Fixed function H5Requal actually to compare the reference pointers

      Fixed an issue with H5Requal always returning true because the
      function was only comparing the ref2_ptr to itself.
2024-05-01 05:39:01 -07:00
Scot Breitenfeld df9d2eafab MPI type correction (#4268)
* corrected type for MPI_*_f2c APIs

* fixed return type of callback

* reset compilation flags of logical test program
2024-03-27 22:20:25 -05:00
H. Joe Lee ce3784de25 Replace user-define with user-defined (#4261) 2024-03-27 13:55:44 -07:00
Scot Breitenfeld 6837fe5bc8 Addressed Fortran issues with promoted integers and reals via compilation flags, part 2 (#4221)
* addressed issue wit promoted integers and reals

* fixed h5fcreate_f

* added option to use mpi_f08

* change the kind of logical in the parallel tests

* addressed missing return value from callback
2024-03-25 07:42:03 -05:00
Scot Breitenfeld c1a56f432e Revert "Addressed Fortran issues with promoted integers and reals via compil…" (#4220)
This reverts commit 06c42ff038.
2024-03-23 07:16:43 -07:00
Scot Breitenfeld 06c42ff038 Addressed Fortran issues with promoted integers and reals via compilation flags (#4209)
* addressed issue wit promoted integers and reals

* added option to use mpi_f08
2024-03-22 11:52:58 -05:00
Scot Breitenfeld 8621663b99 Reworked H5Epush_f (#4153) 2024-03-19 04:59:32 -07:00
Scot Breitenfeld ece121b415 Fixed misc. H5E fortran failures due to previous PR (#4138)
* fixed promotion of integers and reals tests and check-passthrough-vol failure

* fixed cygwin issue
2024-03-15 07:37:22 -05:00
Scot Breitenfeld f22f538ab7 fixes compilation failures due to H5E additions (#4090) 2024-03-08 10:57:05 -08:00
Scot Breitenfeld 9d8e882496 Added new H5E with tests. (#4049)
Added Fortran H5E APIs:
h5eregister_class_f, h5eunregister_class_f, h5ecreate_msg_f, h5eclose_msg_f
h5eget_msg_f, h5epush_f, h5eget_num_f, h5ewalk_f, h5eget_class_name_f,
h5eappend_stack_f, h5eget_current_stack_f, h5eset_current_stack_f, h5ecreate_stack_f,
h5eclose_stack_f, h5epop_f, h5eprint_f (C h5eprint v2 signature)

Addresses Issue #3987
2024-03-07 03:34:55 -08:00
Allen Byrne 0be892585a Rename incorrectly named option (#4067)
* Rename incorrectly named option

* Restore the correct uses of USING_MEMCHECKER

* Update release note
2024-03-05 09:07:16 -08:00
Scot Breitenfeld e7f41a2fbf Fix the datatype passed to H5*exists_async APIs in tests. (#4033)
Add a new testing function to verify C_BOOL values.
2024-02-23 07:57:30 -06:00
Scot Breitenfeld 791915e92a Fixed XL and gfortran errors (#3968)
* fixed XL and Gfortran errors

* fixed data type len array
2024-01-30 09:05:20 -08:00
Scot Breitenfeld 424f3803ea fixed BIND name (#3957)
* update H5Ssel_iter_reset_f test
2024-01-24 10:19:47 -06:00
Scot Breitenfeld 54fb809382 Fortran API work. (#3941)
* - Added Fortran APIs:
      H5FGET_INTENT_F, H5SSELECT_ITER_CREATE_F, H5SSEL_ITER_GET_SEQ_LIST_F,
      H5SSELECT_ITER_CLOSE_F, H5S_mp_H5SSELECT_ITER_RESET_F

    - Added Fortran Parameters:
      H5S_SEL_ITER_GET_SEQ_LIST_SORTED_F, H5S_SEL_ITER_SHARE_WITH_DATASPACE_F

    - Added tests for new APIs
    - Removed H5F C wrapper stubs
    - Documentation misc. cleanup.
2024-01-23 07:59:10 -08:00
Scot Breitenfeld 2fc140079b Added H5Fdelete_f with test (#3912) 2023-12-30 17:33:31 -06:00
Allen Byrne 3ea21ccb3e Add HDF5_DISABLE_TESTS_REGEX option to skip tests (#3859) 2023-11-22 07:51:30 -06:00
Allen Byrne 66786fa036 Add intel oneapi windows build to CI CMake (#3836) 2023-11-10 07:36:46 -06:00
Scot Breitenfeld 6a3c859e58 Fortran Wrappers H5VLnative_addr_to_token_f and H5VLnative_token_to_address_f (#3801)
* Added H5VLnative_addr_to_token_f and H5VLnative_token_to_address_f

* Added H5VLnative_addr_to_token_f and H5VLnative_token_to_address_f tests

* Added H5VLnative_addr_to_token_f and H5VLnative_token_to_address_f tests
2023-11-03 09:22:00 -07:00
Scot Breitenfeld da3b7ff945 Add h5pget_actual_selection_io_mode fortran wrapper (#3746)
* added h5pget_actual_selection_io_mode_f test

* added tests for h5pget_actual_selection_io_mode_f

* fixed int_f type conversion
2023-10-23 14:55:47 -05:00
Scot Breitenfeld 5672fd8177 Attempt to quiet some warnings with cray compilers. (#3724) 2023-10-19 14:40:08 -07:00
Allen Byrne 405b0c62f8 Correct fortran CMake generator expressions (#3670) 2023-10-13 23:41:17 -05:00
Scot Breitenfeld 6aaa960d90 Fixes test failure for gfortran -O2 and -O3, -fdefault-real-16 (#3662)
* added cmake ieee flag for nagfor

* fixes gfortran -O2 and -O3, -fdefault-real-16

* fixed sync

* updated release notes
2023-10-13 09:39:06 -07:00