From 72f94bc1f55495edcbeb199e7541c45f8b325919 Mon Sep 17 00:00:00 2001 From: "H. Joe Lee" Date: Thu, 12 Oct 2023 11:37:56 -0500 Subject: [PATCH 01/17] Simplify. (#3659) * Address @jhendersonHDF review --- testpar/t_filters_parallel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 198201abf7b..12156bbe669 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -576,7 +576,7 @@ create_datasets(hid_t parent_obj_id, const char *dset_name, hid_t type_id, hid_t dset_name_ptr = dset_name_multi_buf; n_dsets = (rand() % (MAX_NUM_DSETS_MULTI - 1)) + 2; - /* Select between 1 and (n_dsets - 1) datasets to NOT be filtered */ + /* Select between 1 and (n_dsets - 1) datasets to be unfiltered */ if (test_mode == USE_MULTIPLE_DATASETS_MIXED_FILTERED) { n_unfiltered = (rand() % (n_dsets - 1)) + 1; From 3ec119b5589bfed14ad8a2d242cfa0654b05eafc Mon Sep 17 00:00:00 2001 From: jhendersonHDF Date: Thu, 12 Oct 2023 16:12:57 -0500 Subject: [PATCH 02/17] Add expedited testing support to t_filters_parallel (#3665) --- testpar/t_filters_parallel.c | 94 ++++++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 26 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 12156bbe669..0f08be9344d 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -26,6 +26,8 @@ static MPI_Info info = MPI_INFO_NULL; static int mpi_rank = 0; static int mpi_size = 0; +static int test_express_level_g; + int nerrors = 0; /* Arrays of filter ID values and filter names (should match each other) */ @@ -9705,14 +9707,15 @@ int main(int argc, char **argv) { unsigned seed; - size_t cur_filter_idx = 0; - size_t num_filters = 0; - hid_t file_id = H5I_INVALID_HID; - hid_t fcpl_id = H5I_INVALID_HID; - hid_t group_id = H5I_INVALID_HID; - hid_t fapl_id = H5I_INVALID_HID; - hid_t dxpl_id = H5I_INVALID_HID; - hid_t dcpl_id = H5I_INVALID_HID; + size_t cur_filter_idx = 0; + size_t num_filters = 0; + hid_t file_id = H5I_INVALID_HID; + hid_t fcpl_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; + hid_t dxpl_id = H5I_INVALID_HID; + hid_t dcpl_id = H5I_INVALID_HID; + bool expedite_testing = false; int mpi_code; /* Initialize MPI */ @@ -9763,6 +9766,17 @@ main(int argc, char **argv) TestAlarmOn(); + /* + * Get the TestExpress level setting + */ + test_express_level_g = GetTestExpress(); + if ((test_express_level_g >= 1) && MAINPROCESS) { + printf("** Some tests will be skipped due to TestExpress setting.\n"); + printf("** Exhaustive tests will only be performed for the first available filter.\n"); + printf("** Set the HDF5TestExpress environment variable to 0 to perform exhaustive testing for all " + "available filters.\n\n"); + } + /* * Obtain and broadcast seed value since ranks * aren't guaranteed to arrive here at exactly @@ -9829,9 +9843,26 @@ main(int argc, char **argv) dcpl_id = H5Pcreate(H5P_DATASET_CREATE); VRFY((dcpl_id >= 0), "DCPL creation succeeded"); + /* Add a space after the HDF5_PARAPREFIX notice from h5_fixname */ + if (MAINPROCESS) + puts(""); + /* Run tests with all available filters */ for (cur_filter_idx = 0; cur_filter_idx < num_filters; cur_filter_idx++) { H5D_selection_io_mode_t sel_io_mode; + H5Z_filter_t cur_filter = filterIDs[cur_filter_idx]; + htri_t filter_avail; + + /* Make sure current filter is available before testing with it */ + filter_avail = H5Zfilter_avail(cur_filter); + VRFY((filter_avail >= 0), "H5Zfilter_avail succeeded"); + + if (!filter_avail) { + if (MAINPROCESS) + printf("== SKIPPED tests with filter '%s' - filter unavailable ==\n\n", + filterNames[cur_filter_idx]); + continue; + } /* Run tests with different selection I/O modes */ for (sel_io_mode = H5D_SELECTION_IO_MODE_DEFAULT; sel_io_mode <= H5D_SELECTION_IO_MODE_ON; @@ -9849,13 +9880,11 @@ main(int argc, char **argv) /* Run with each of the test modes (single dataset, multiple datasets, etc.) */ for (test_mode = USE_SINGLE_DATASET; test_mode < TEST_MODE_SENTINEL; test_mode++) { - H5Z_filter_t cur_filter = filterIDs[cur_filter_idx]; - const char *sel_io_str; - const char *alloc_time; - const char *mode; - unsigned filter_config; - htri_t filter_avail; - char group_name[512]; + const char *sel_io_str; + const char *alloc_time; + const char *mode; + unsigned filter_config; + char group_name[512]; switch (sel_io_mode) { case H5D_SELECTION_IO_MODE_DEFAULT: @@ -9902,6 +9931,23 @@ main(int argc, char **argv) mode = "unknown"; } + /* + * If expediting the remaining tests, just run with a single + * configuration that is interesting enough. In this case, + * run with: + * + * - A single dataset + * - Incremental file space allocation timing + * - Linked-chunk (single) I/O + * - The default setting for selection I/O + */ + if (expedite_testing) { + if (test_mode != USE_SINGLE_DATASET || space_alloc_time != H5D_ALLOC_TIME_INCR || + chunk_opt != H5FD_MPIO_CHUNK_ONE_IO || + sel_io_mode != H5D_SELECTION_IO_MODE_DEFAULT) + continue; + } + if (MAINPROCESS) printf("== Running tests in mode '%s' with filter '%s' using selection I/O mode " "'%s', '%s' and '%s' allocation time ==\n\n", @@ -9910,17 +9956,6 @@ main(int argc, char **argv) : "Multi-Chunk I/O", alloc_time); - /* Make sure current filter is available before testing with it */ - filter_avail = H5Zfilter_avail(cur_filter); - VRFY((filter_avail >= 0), "H5Zfilter_avail succeeded"); - - if (!filter_avail) { - if (MAINPROCESS) - printf(" ** SKIPPED tests with filter '%s' - filter unavailable **\n\n", - filterNames[cur_filter_idx]); - continue; - } - /* Get the current filter's info */ VRFY((H5Zget_filter_info(cur_filter, &filter_config) >= 0), "H5Zget_filter_info succeeded"); @@ -9987,6 +10022,13 @@ main(int argc, char **argv) } } } + + /* + * If the TestExpress level setting isn't set for exhaustive + * testing, run smoke checks for the other filters + */ + if (!expedite_testing && (test_express_level_g >= 1)) + expedite_testing = true; } VRFY((H5Pclose(dcpl_id) >= 0), "DCPL close succeeded"); From eda1344a72d0f85e4532c504f1e9ecc025a87a21 Mon Sep 17 00:00:00 2001 From: "H. Joe Lee" Date: Fri, 13 Oct 2023 11:31:50 -0500 Subject: [PATCH 03/17] Remove clang warnings (#3656) --- src/H5FDsubfiling/H5FDsubfiling.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c index d8616c8c1b4..a2daba0d01b 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.c +++ b/src/H5FDsubfiling/H5FDsubfiling.c @@ -1556,7 +1556,7 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined, addr = %" PRIuHADDR, addr); if (REGION_OVERFLOW(addr, size)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, - "addr overflow, addr = %" PRIuHADDR ", size = %" PRIuHADDR, addr, size); + "addr overflow, addr = %" PRIuHADDR ", size = %zu", addr, size); /* Temporarily reject collective I/O until support is implemented (unless types are simple MPI_BYTE) */ { @@ -1789,7 +1789,7 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined, addr = %" PRIuHADDR, addr); if (REGION_OVERFLOW(addr, size)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, - "addr overflow, addr = %" PRIuHADDR ", size = %" PRIuHADDR, addr, size); + "addr overflow, addr = %" PRIuHADDR ", size = %zu", addr, size); /* Temporarily reject collective I/O until support is implemented (unless types are simple MPI_BYTE) */ { From 6aaa960d900b59a442e28c264ca0562449ebd05b Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 13 Oct 2023 11:39:06 -0500 Subject: [PATCH 04/17] 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 --- fortran/test/tH5P_F03.F90 | 3 +-- release_docs/RELEASE.txt | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fortran/test/tH5P_F03.F90 b/fortran/test/tH5P_F03.F90 index 4f390d5fb76..24934eb3e05 100644 --- a/fortran/test/tH5P_F03.F90 +++ b/fortran/test/tH5P_F03.F90 @@ -146,7 +146,6 @@ SUBROUTINE test_create(total_error) ! Compound datatype test f_ptr = C_LOC(fill_ctype) - CALL H5Pget_fill_value_f(dcpl, comp_type_id, f_ptr, error) CALL check("H5Pget_fill_value_f",error, total_error) @@ -184,6 +183,7 @@ SUBROUTINE test_create(total_error) CALL VERIFY("***ERROR: Returned wrong fill value (real)", rfill, 2.0, total_error) ! For the actual compound type + f_ptr = C_LOC(fill_ctype) CALL H5Pset_fill_value_f(dcpl, comp_type_id, f_ptr, error) CALL check("H5Pget_fill_value_f",error, total_error) @@ -254,7 +254,6 @@ SUBROUTINE test_create(total_error) CALL check("H5Dget_create_plist_f", error, total_error) f_ptr = C_LOC(rd_c) - CALL H5Pget_fill_value_f(dcpl, comp_type_id, f_ptr, error) CALL check("H5Pget_fill_value_f", error, total_error) CALL verify("***ERROR: Returned wrong fill value", rd_c%a, fill_ctype%a, total_error) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index bcc91df70d2..bfaab5e030a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -880,7 +880,12 @@ Bug Fixes since HDF5-1.14.0 release configuration information in the HDF5_VOL_CONNECTOR environment variable and would incorrectly report that the specified VOL connector isn't registered due to including the configuration information as part of the VOL connector - name being checked for registration status. This has now been fixed. + name being checked for registration status. This has now been fixed. + + - Fixed Fortran 2003 test with gfortran-v13, optimization levels O2,O3 + + Fixes failing Fortran 2003 test with gfortran, optimization level O2,O3 + with -fdefault-real-16. Fixes GH #2928. Platforms Tested From ffc5fddeb105d2292d444993a3719be1f753f95b Mon Sep 17 00:00:00 2001 From: "H. Joe Lee" Date: Fri, 13 Oct 2023 11:40:13 -0500 Subject: [PATCH 05/17] Fix link error on clang17/gfortran13/macOS-13 (#3666) (#3671) --- fortran/examples/ph5example.f90 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fortran/examples/ph5example.f90 b/fortran/examples/ph5example.f90 index 05fedbd46fd..138969ea17a 100644 --- a/fortran/examples/ph5example.f90 +++ b/fortran/examples/ph5example.f90 @@ -16,10 +16,10 @@ PROGRAM DATASET USE HDF5 ! This module contains all necessary modules + USE MPI IMPLICIT NONE - INCLUDE 'mpif.h' CHARACTER(LEN=10), PARAMETER :: default_fname = "sds.h5" ! Default name CHARACTER(LEN=8), PARAMETER :: dsetname = "IntArray" ! Dataset name @@ -72,10 +72,8 @@ PROGRAM DATASET CALL h5pset_fapl_mpio_f(plist_id, comm, info, error) ! - ! Figure out the filename to use. If your system does not support - ! getenv, comment that statement with this, - ! filename = "" - CALL getenv("HDF5_PARAPREFIX", filename) + ! Figure out the filename to use. + CALL get_environment_variable("HDF5_PARAPREFIX", filename) fnamelen = LEN_TRIM(filename) if ( fnamelen == 0 ) then filename = default_fname From 405b0c62f8d7752d55e677b6b2868619bccade78 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Fri, 13 Oct 2023 23:41:17 -0500 Subject: [PATCH 06/17] Correct fortran CMake generator expressions (#3670) --- fortran/examples/CMakeLists.txt | 18 +++++----- fortran/src/CMakeLists.txt | 24 ++++++------- fortran/test/CMakeLists.txt | 58 +++++++++++++++--------------- fortran/testpar/CMakeLists.txt | 18 +++++----- hl/fortran/examples/CMakeLists.txt | 6 ++-- hl/fortran/src/CMakeLists.txt | 22 ++++++------ hl/fortran/test/CMakeLists.txt | 6 ++-- 7 files changed, 76 insertions(+), 76 deletions(-) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 6cbe8d6daac..ff3f299f583 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -38,9 +38,9 @@ foreach (example ${examples}) target_compile_options(f90_ex_${example} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}>) -# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) + "$<$:${WIN_COMPILE_FLAGS}>") +# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -82,9 +82,9 @@ foreach (example ${F2003_examples}) target_compile_options(f03_ex_${example} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}>) -# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) + "$<$:${WIN_COMPILE_FLAGS}>") +# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET f03_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -126,9 +126,9 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_compile_options(f90_ex_ph5example PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}>) -# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) + "$<$:${WIN_COMPILE_FLAGS}>") +# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET f90_ex_ph5example PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 977d036d4c1..199a0c8f148 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -48,12 +48,12 @@ set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID) add_executable (H5_buildiface ${HDF5_F90_SRC_SOURCE_DIR}/H5_buildiface.F90) target_include_directories (H5_buildiface PRIVATE "${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR}") #if (BUILD_SHARED_LIBS) -# target_compile_definitions(H5_buildiface PRIVATE $<$:/MT>) +# target_compile_definitions(H5_buildiface PRIVATE "$<$:/MT>") #endif () if(MSVC) set_property(TARGET H5_buildiface PROPERTY COMPILE_FLAGS "/MT") endif() -#set_property(TARGET H5_buildiface APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) +#set_property(TARGET H5_buildiface APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") if(MSVC) set_property(TARGET H5_buildiface PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE") endif() @@ -332,8 +332,8 @@ if (BUILD_STATIC_LIBS) target_compile_options(${HDF5_F90_LIB_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_F90_LIB_TARGET} PRIVATE - $<$:HDF5F90_WINDOWS> - $<$:${WIN_COMPILE_FLAGS}> + "$<$:HDF5F90_WINDOWS"> + "$<$:${WIN_COMPILE_FLAGS}>" ) target_link_libraries (${HDF5_F90_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} @@ -341,8 +341,8 @@ if (BUILD_STATIC_LIBS) ${LINK_Fortran_LIBS} "$<$:${MPI_Fortran_LIBRARIES}>" ) -# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET ${HDF5_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -367,17 +367,17 @@ if (BUILD_SHARED_LIBS) target_compile_definitions(${HDF5_F90_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" PRIVATE - $<$:BUILD_HDF5_DLL;HDF5F90_WINDOWS> - $<$:${WIN_COMPILE_FLAGS}> + "$<$:BUILD_HDF5_DLL;HDF5F90_WINDOWS>" + "$<$:${WIN_COMPILE_FLAGS}>" ) target_link_libraries (${HDF5_F90_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS} "$<$:${MPI_Fortran_LIBRARIES}>" ) -# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) -# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-DLL">) -# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def">) +# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") +# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-DLL>") +# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def>") if(MSVC) set_property(TARGET ${HDF5_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} /DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") endif() diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index ff279437602..c9dc48f01d6 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -13,14 +13,14 @@ target_include_directories (H5_test_buildiface ) #if (BUILD_SHARED_LIBS) # target_compile_definitions(H5_test_buildiface -# PRIVATE $<$:/MT> +# PRIVATE "$<$:/MT>" # ) #endif () if(MSVC) set_property(TARGET H5_test_buildiface PROPERTY COMPILE_FLAGS "/MT") endif() #set_property(TARGET H5_test_buildiface APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> +# LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>" #) if(MSVC) set_property(TARGET H5_test_buildiface PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE") @@ -145,12 +145,12 @@ if (NOT BUILD_SHARED_LIBS) target_compile_options(${HDF5_F90_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_F90_TEST_LIB_TARGET} PRIVATE - $<$:HDF5F90_WINDOWS> - $<$:${WIN_COMPILE_FLAGS}> + "$<$:HDF5F90_WINDOWS>" + "$<$:${WIN_COMPILE_FLAGS}>" ) target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} PUBLIC ${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}) -# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -171,13 +171,13 @@ else () target_compile_definitions(${HDF5_F90_TEST_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" PRIVATE - $<$:BUILD_HDF5_TEST_DLL;HDF5F90_WINDOWS> - $<$:${WIN_COMPILE_FLAGS}> + "$<$:BUILD_HDF5_TEST_DLL;HDF5F90_WINDOWS>" + "$<$:${WIN_COMPILE_FLAGS}>" ) target_link_libraries (${HDF5_F90_TEST_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) -# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) -# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-DLL">) +# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") +# set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-DLL>") if(MSVC) set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} -DLL") endif() @@ -215,10 +215,10 @@ add_executable (testhdf5_fortran target_compile_options(testhdf5_fortran PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) -#set_property(TARGET testhdf5_fortran APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -#set_property(TARGET testhdf5_fortran APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +#set_property(TARGET testhdf5_fortran APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +#set_property(TARGET testhdf5_fortran APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET testhdf5_fortran PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -254,10 +254,10 @@ add_executable (testhdf5_fortran_1_8 target_compile_options(testhdf5_fortran_1_8 PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) -#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +#set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET testhdf5_fortran_1_8 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -294,10 +294,10 @@ add_executable (fortranlib_test_F03 target_compile_options(fortranlib_test_F03 PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) -#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +#set_property(TARGET fortranlib_test_F03 APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET fortranlib_test_F03 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -326,10 +326,10 @@ add_executable (fflush1 fflush1.F90) target_compile_options(fflush1 PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) -#set_property(TARGET fflush1 APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -#set_property(TARGET fflush1 APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +#set_property(TARGET fflush1 APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +#set_property(TARGET fflush1 APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET fflush1 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -358,10 +358,10 @@ add_executable (fflush2 fflush2.F90) target_compile_options (fflush2 PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) -#set_property(TARGET fflush2 APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -#set_property(TARGET fflush2 APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +#set_property(TARGET fflush2 APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +#set_property(TARGET fflush2 APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET fflush2 PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -390,10 +390,10 @@ add_executable (vol_connector vol_connector.F90) target_compile_options(vol_connector PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) -#set_property(TARGET vol_connector APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -#set_property(TARGET vol_connector APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +#set_property(TARGET vol_connector APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +#set_property(TARGET vol_connector APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET vol_connector PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index ca241f6d87f..e8f010721fe 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -28,13 +28,13 @@ target_include_directories (parallel_test target_compile_options(parallel_test PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) if (NOT BUILD_SHARED_LIBS) target_link_libraries (parallel_test PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS} - $<$:"ws2_32.lib"> + "$<$:ws2_32.lib>" ) set_target_properties (parallel_test PROPERTIES FOLDER test/fortran @@ -45,7 +45,7 @@ else () target_link_libraries (parallel_test PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_Fortran_LIBS} - $<$:"ws2_32.lib"> + "$<$:ws2_32.lib>" ) set_target_properties (parallel_test PROPERTIES FOLDER test/fortran @@ -68,13 +68,13 @@ target_include_directories (subfiling_test target_compile_options(subfiling_test PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) if (NOT BUILD_SHARED_LIBS) target_link_libraries (subfiling_test PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS} - $<$:"ws2_32.lib"> + "$<$:ws2_32.lib>" ) set_target_properties (subfiling_test PROPERTIES FOLDER test/fortran @@ -85,7 +85,7 @@ else () target_link_libraries (subfiling_test PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_Fortran_LIBS} - $<$:"ws2_32.lib"> + "$<$:ws2_32.lib>" ) set_target_properties (subfiling_test PROPERTIES FOLDER test/fortran @@ -108,13 +108,13 @@ target_include_directories (async_test target_compile_options(async_test PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) if (NOT BUILD_SHARED_LIBS) target_link_libraries (async_test PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS} - $<$:"ws2_32.lib"> + "$<$:ws2_32.lib>" ) set_target_properties (async_test PROPERTIES FOLDER test/fortran @@ -125,7 +125,7 @@ else () target_link_libraries (async_test PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_Fortran_LIBS} - $<$:"ws2_32.lib"> + "$<$:ws2_32.lib>" ) set_target_properties (async_test PROPERTIES FOLDER test/fortran diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index caa5e78ec02..7afe5fc6d1c 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -11,10 +11,10 @@ foreach (example ${examples}) target_compile_options(hl_f90_ex_${example} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) -# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET hl_f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index d9f0af2a766..ed469e57753 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -23,7 +23,7 @@ if (WIN32 AND MSVC) endif () endif () #set_property(TARGET H5HL_buildiface APPEND PROPERTY -# LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE"> +# LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>" #) if(MSVC) set_property(TARGET H5HL_buildiface PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE") @@ -178,12 +178,12 @@ if (BUILD_STATIC_LIBS) ) target_compile_options(${HDF5_HL_F90_LIB_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}") target_compile_definitions(${HDF5_HL_F90_LIB_TARGET} - PUBLIC $<$:HDF5F90_WINDOWS> - PRIVATE $<$:${WIN_COMPILE_FLAGS}> + PUBLIC "$<$:HDF5F90_WINDOWS>" + PRIVATE "$<$:${WIN_COMPILE_FLAGS}>" ) target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() @@ -207,17 +207,17 @@ if (BUILD_SHARED_LIBS) target_compile_definitions(${HDF5_HL_F90_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" PRIVATE - $<$:BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS> - $<$:${WIN_COMPILE_FLAGS}> + "$<$:BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS>" + "$<$:${WIN_COMPILE_FLAGS}>" ) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS} ) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-DLL">) -# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$:"-DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def">) +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-DLL>") +# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$:-DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def>") if(MSVC) set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} -DLL -DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def") endif() diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index f78e52e50eb..23248127f64 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -16,10 +16,10 @@ macro (ADD_H5_FORTRAN_EXE file) target_compile_options(hl_f90_${file} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}" - $<$:${WIN_COMPILE_FLAGS}> + "$<$:${WIN_COMPILE_FLAGS}>" ) -# set_property(TARGET hl_f90_${file} APPEND PROPERTY LINK_FLAGS $<$:"-SUBSYSTEM:CONSOLE">) -# set_property(TARGET hl_f90_${file} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>) +# set_property(TARGET hl_f90_${file} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") +# set_property(TARGET hl_f90_${file} APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") if(MSVC) set_property(TARGET hl_f90_${file} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() From cdf400b916694cda4a337850fd106a271ddbaeaa Mon Sep 17 00:00:00 2001 From: "H. Joe Lee" Date: Sat, 14 Oct 2023 07:53:58 -0500 Subject: [PATCH 07/17] Remove callable action badges. (#3653) --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 26fac451997..043351e2316 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ HDF5 version 1.15.0 currently under development ![HDF5 Logo](doxygen/img/HDF5.png) [![develop build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/main.yml?branch=develop&label=develop)](https://github.com/HDFGroup/hdf5/actions?query=branch%3Adevelop) -[![oneAPI CMake build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/intel-cmake.yml?branch=develop&label=oneAPI-C)](https://github.com/HDFGroup/hdf5/actions?query=branch%3Adevelop) -[![oneAPI Autotools build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/intel-auto.yml?branch=develop&label=oneAPI-A)](https://github.com/HDFGroup/hdf5/actions?query=branch%3Adevelop) [![HDF-EOS5 build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/hdfeos5.yml?branch=develop&label=HDF-EOS5)](https://github.com/HDFGroup/hdf5/actions?query=branch%3Adevelop) [![netCDF build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/netcdf.yml?branch=develop&label=netCDF)](https://github.com/HDFGroup/hdf5/actions?query=branch%3Adevelop) [![h5py build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/h5py.yml?branch=develop&label=h5py)](https://github.com/HDFGroup/hdf5/actions?query=branch%3Adevelop) From 1d06e978b652238809b89dc3602fda9dabd5875d Mon Sep 17 00:00:00 2001 From: "H. Joe Lee" Date: Sat, 14 Oct 2023 15:51:59 -0500 Subject: [PATCH 08/17] Add AOCC GitHub Action (#3504) (#3657) --- .github/workflows/linux-auto-aocc-ompi.yml | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/linux-auto-aocc-ompi.yml diff --git a/.github/workflows/linux-auto-aocc-ompi.yml b/.github/workflows/linux-auto-aocc-ompi.yml new file mode 100644 index 00000000000..76b6452226c --- /dev/null +++ b/.github/workflows/linux-auto-aocc-ompi.yml @@ -0,0 +1,66 @@ +name: linux autotools aocc ompi + +on: + push: + pull_request: + branches: + - develop + paths-ignore: + - '.github/CODEOWNERS' + - '.github/FUNDING.yml' + - 'doc/**' + - 'release_docs/**' + - 'ACKNOWLEDGEMENTS' + - 'COPYING**' + - '**.md' + +# Using concurrency to cancel any in-progress job or run +concurrency: + group: ${{ github.workflow }}-${{ github.sha || github.event.pull_request.number }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install System dependencies + run: | + sudo apt update + sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev doxygen openssl libtool libtool-bin build-essential libncurses-dev libquadmath0 libstdc++6 libxml2 + - name: Install AOCC 4.1.0 + run: | + wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0.tar + tar -xvf aocc-compiler-4.1.0.tar + cd aocc-compiler-4.1.0 + bash install.sh + source /home/runner/work/hdf5/hdf5/setenv_AOCC.sh + which clang + which flang + clang -v + - name: Install OpenMPI 4.1.5 + run: | + export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/usr/local/lib + wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz + tar zxvf openmpi-4.1.5.tar.gz + cd openmpi-4.1.5 + ./configure CC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/clang FC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/flang --prefix=/usr/local + make + sudo make install + - name: Install HDF5 + env: + NPROCS: 2 + run: | + export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/usr/local/lib/openmpi:/usr/local/lib + export LD_RUN_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/usr/local/lib/openmpi:/usr/local/lib + export PATH=/usr/local/bin:$PATH + ./autogen.sh + ./configure --prefix=/tmp --enable-parallel --enable-shared CC=/usr/local/bin/mpicc LDFLAGS="-L/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib -L/usr/local/lib/openmpi" + make -j + make check -j + make install + make uninstall From ef1edba2cea21dce47235664395701bccd41530d Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Sat, 14 Oct 2023 20:34:29 -0700 Subject: [PATCH 09/17] Fix uninitialized subfiling test variable (#3675) Picked up by gcc 10 on skybridge. Probably spurious, but no harm in initializing it to a "bad" value. --- testpar/t_subfiling_vfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_subfiling_vfd.c b/testpar/t_subfiling_vfd.c index 0c64bf2927f..ccece41b846 100644 --- a/testpar/t_subfiling_vfd.c +++ b/testpar/t_subfiling_vfd.c @@ -886,7 +886,7 @@ test_selection_strategies(void) char criteria_buf[256]; char sel_criteria[128]; /* Use char buffer for criteria as we may support the "with config" strategy in the future */ - int expected_num_subfiles; + int expected_num_subfiles = -1; cfg.ioc_selection = strategy; cfg.stripe_size = H5FD_SUBFILING_DEFAULT_STRIPE_SIZE; From d5267f096e6575eb3f08dfb8638346eb87087797 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Sat, 14 Oct 2023 20:39:43 -0700 Subject: [PATCH 10/17] Add support for AOCC & Flang w/ the Autotools (#3674) * Adds a config/clang-fflags options file to support Flang * Corrects missing "-Wl," from linker options in the libtool wrappers when using Flang, the MPI Fortran compiler wrappers, and building the shared library. This would often result in unrecognized options like -soname. * Enable -nomp w/ Flang to avoid linking to the OpenMPI library. CMake can build the parallel, shared library w/ Fortran using AOCC and Flang, so no changes were needed for that build system. Fixes GitHub issues #3439, #1588, #366, #280 --- config/clang-cxxflags | 1 + config/clang-fflags | 139 +++++++++++++++++++++++++++++++++++++++ config/linux-gnulibc1 | 3 + configure.ac | 9 ++- release_docs/RELEASE.txt | 14 ++++ 5 files changed, 163 insertions(+), 3 deletions(-) create mode 100644 config/clang-fflags diff --git a/config/clang-cxxflags b/config/clang-cxxflags index ead31525ec8..2dcd0cbcf81 100644 --- a/config/clang-cxxflags +++ b/config/clang-cxxflags @@ -47,6 +47,7 @@ load_clang_arguments() done) IFS=' ' echo "$*" } + # Get the compiler version in a way that works for clang++ # unless a compiler version is already known # diff --git a/config/clang-fflags b/config/clang-fflags new file mode 100644 index 00000000000..786c729ca91 --- /dev/null +++ b/config/clang-fflags @@ -0,0 +1,139 @@ +# -*- shell-script -*- +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://www.hdfgroup.org/licenses. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. + + +# This file should be sourced into configure if the compiler is the +# Clang Fortran compiler (flang) or a derivative. It is careful not to do +# anything if the compiler is not Clang; otherwise 'cc_flags_set' is set +# to 'yes' +# + +# Get the compiler version in a way that works for clang +# unless a compiler version is already known +# +# cc_vendor: The compiler name: flang +# cc_version: Version number: 6.0.0, 7.3.0, ... 10.0.1 +# +if test "X-" = "X-$f9x_flags_set"; then + # flang -v will return version number following "clang" + f9x_version="`$FC $FCFLAGS $H5_FCFLAGS -v 2>&1 |\ + grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" + if test -n "$f9x_version"; then + f9x_vendor="flang" + fi + if test "X-" != "X-$f9x_version"; then + + # Get the compiler version numbers + f9x_vers_major=`echo $f9x_version | cut -f1 -d.` + f9x_vers_minor=`echo $f9x_version | cut -f2 -d.` + f9x_vers_patch=`echo $f9x_version | cut -f3 -d.` + test -n "$f9x_vers_major" || f9x_vers_major=0 + test -n "$f9x_vers_minor" || f9x_vers_minor=0 + test -n "$f9x_vers_patch" || f9x_vers_patch=0 + fi +fi + +if test "X-flang" = "X-$f9x_vendor"; then + + echo "compiler '$FC' is $f9x_vendor-$f9x_version" + + FC_BASENAME=flang + F9XSUFFIXFLAG="" + FSEARCH_DIRS="" + + ############################### + # Architecture-specific flags # + ############################### + + arch= + # Nothing currently. (Uncomment code below and modify to add any) + #case "$host_os-$host_cpu" in + # *-i686) + # arch="-march=i686" + # ;; + #esac + + H5_FCFLAGS="$H5_FCFLAGS $arch" + + ############## + # Production # + ############## + + PROD_FCFLAGS= + + ######### + # Debug # + ######### + + DEBUG_FCFLAGS= + + ######################## + # Enhanced Diagnostics # + ######################## + + NO_DIAGS_FCFLAGS= + DIAGS_FCFLAGS= + + ########### + # Symbols # + ########### + + NO_SYMBOLS_FCFLAGS= + SYMBOLS_FCFLAGS= + + ############# + # Profiling # + ############# + + PROFILE_FCFLAGS= + + ################ + # Optimization # + ################ + + HIGH_OPT_FCFLAGS="-O3" + NO_OPT_FCFLAGS="-O0" + DEBUG_OPT_FCFLAGS="-O0" + + ############ + # Warnings # + ############ + + ########### + # General # + ########### + + # We don't use OpenMP, so don't link to it + H5_FCFLAGS="$H5_FCFLAGS -nomp" + + ###################### + # Developer warnings # + ###################### + + NO_DEVELOPER_WARNING_FCFLAGS= + DEVELOPER_WARNING_FCFLAGS= + + ############################# + # Version-specific warnings # + ############################# + + ################# + # Flags are set # + ################# + f9x_flags_set=yes +fi + +# Clear f9x info if no flags set +if test "X$f9x_flags_set" = "X"; then + f9x_vendor= + f9x_version= +fi diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 9a7dbdba078..7f3c3398048 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -122,6 +122,9 @@ fi # Figure out Intel FC compiler flags . $srcdir/config/intel-fflags +# Figure out Clang FC compiler flags +. $srcdir/config/clang-fflags + case $FC_BASENAME in # # Absoft compiler diff --git a/configure.ac b/configure.ac index 9e823ceb3f7..02c47d61002 100644 --- a/configure.ac +++ b/configure.ac @@ -4244,15 +4244,18 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ;; esac - ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler + ### libtool does not pass the correct linker options for some Fortran compilers ### on Linux (other OSs have not been tested). - ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to - ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) case "`uname`" in Linux*) + ### NAG Fortran needs to replace "-Wl," with "-Wl,-Wl,," (HDFFV-10037) if test "X$FC_BASENAME" = "Xnagfor"; then cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,-Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fi + ### Flang needs to replace "", with "-Wl," (avoids unknown option: -soname issues) + if test "X$FC_BASENAME" = "Xflang"; then + cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + fi ;; esac fi diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index bfaab5e030a..b50fe611213 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -47,6 +47,20 @@ New Features Configuration: ------------- + - Added support for AOCC and classic Flang w/ the Autotools + + * Adds a config/clang-fflags options file to support Flang + * Corrects missing "-Wl," from linker options in the libtool wrappers + when using Flang, the MPI Fortran compiler wrappers, and building + the shared library. This would often result in unrecognized options + like -soname. + * Enable -nomp w/ Flang to avoid linking to the OpenMPI library. + + CMake can build the parallel, shared library w/ Fortran using AOCC + and Flang, so no changes were needed for that build system. + + Fixes GitHub issues #3439, #1588, #366, #280 + - Converted the build of libaec and zlib to use FETCH_CONTENT with CMake. Using the CMake FetchContent module, the external filters can populate From 882bcd01b9c7caaa0ef2fe27e67bddc340f8855e Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Sun, 15 Oct 2023 13:40:19 -0700 Subject: [PATCH 11/17] Fix a strncpy call to use dest size not src (#3677) A strncpy call in a path construction call used the size of the src buffer instead of the dest buffer as the limit n. This was switched to use the dest size and properly terminate the string if truncation occurs. --- src/H5system.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/H5system.c b/src/H5system.c index 7ff521efb26..30a89a174af 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -620,7 +620,6 @@ H5_build_extpath(const char *name, char **extpath /*out*/) FUNC_ENTER_NOAPI_NOINIT - /* Sanity check */ assert(name); assert(extpath); @@ -634,8 +633,9 @@ H5_build_extpath(const char *name, char **extpath /*out*/) if (H5_CHECK_ABSOLUTE(name)) { if (NULL == (full_path = (char *)H5MM_strdup(name))) HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed"); - } /* end if */ - else { /* relative pathname */ + } + else { + /* relative pathname */ char *retcwd; size_t name_len; int drive; @@ -655,12 +655,12 @@ H5_build_extpath(const char *name, char **extpath /*out*/) drive = HDtoupper(name[0]) - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); strncpy(new_name, &name[2], name_len); - } /* end if */ - /* - * Windows: name[0] is a '/' or '\' - * Get current drive - * Unix: does not apply - */ + } + /* + * Windows: name[0] is a '/' or '\' + * Get current drive + * Unix: does not apply + */ else if (H5_CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) { snprintf(cwdpath, MAX_PATH_LEN, "%c:%c", (drive + 'A' - 1), name[0]); retcwd = cwdpath; @@ -670,28 +670,32 @@ H5_build_extpath(const char *name, char **extpath /*out*/) else { retcwd = HDgetcwd(cwdpath, MAX_PATH_LEN); strncpy(new_name, name, name_len); - } /* end if */ + } if (retcwd != NULL) { size_t cwdlen; size_t path_len; - assert(cwdpath); cwdlen = strlen(cwdpath); - assert(cwdlen); - assert(new_name); + if (cwdlen == 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "cwd length is zero"); path_len = cwdlen + strlen(new_name) + 2; if (NULL == (full_path = (char *)H5MM_malloc(path_len))) HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed"); - strncpy(full_path, cwdpath, cwdlen + 1); + /* path_len will always be greater than zero, so no check before + * setting the terminal NUL byte of full_path + */ + strncpy(full_path, cwdpath, path_len); + full_path[path_len - 1] = '\0'; + if (!H5_CHECK_DELIMITER(cwdpath[cwdlen - 1])) strncat(full_path, H5_DIR_SEPS, path_len - (cwdlen + 1)); strncat(full_path, new_name, path_len - (cwdlen + 1) - strlen(H5_DIR_SEPS)); - } /* end if */ - } /* end else */ + } + } - /* strip out the last component (the file name itself) from the path */ + /* Strip out the last component (the file name itself) from the path */ if (full_path) { char *ptr = NULL; @@ -699,10 +703,9 @@ H5_build_extpath(const char *name, char **extpath /*out*/) assert(ptr); *++ptr = '\0'; *extpath = full_path; - } /* end if */ + } done: - /* Release resources */ if (cwdpath) H5MM_xfree(cwdpath); if (new_name) From 516167d31bd49ca3f291a66f01c132f5d427aae7 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Mon, 16 Oct 2023 05:52:23 -0700 Subject: [PATCH 12/17] Remove CANBE_UNUSED() from subfiling VFD (#3678) This macro was an attempt to quiet warnings about release mode unused variables that only appear in asserts. It resolves to a void cast, which doesn't quiet warnings when an assignment has already taken place. --- src/H5FDsubfiling/H5FDioc.c | 9 ++++----- src/H5FDsubfiling/H5FDsubfile_int.c | 3 ++- src/H5FDsubfiling/H5FDsubfiling_priv.h | 2 -- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index 39766de6594..80771c02a53 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -32,8 +32,6 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ -#define CANBE_UNUSED(X) (void)(X) - /* The driver identification number, initialized at runtime */ static hid_t H5FD_IOC_g = H5I_INVALID_HID; @@ -1219,13 +1217,14 @@ static herr_t H5FD__ioc_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf) { - H5FD_ioc_t *file = (H5FD_ioc_t *)_file; - herr_t ret_value = SUCCEED; +#ifndef NDEBUG + H5FD_ioc_t *file = (H5FD_ioc_t *)_file; +#endif + herr_t ret_value = SUCCEED; H5FD_IOC_LOG_CALL(__func__); assert(file && file->pub.cls); - CANBE_UNUSED(file); assert(buf); /* Check for overflow conditions */ diff --git a/src/H5FDsubfiling/H5FDsubfile_int.c b/src/H5FDsubfiling/H5FDsubfile_int.c index cb210b6e4a6..a8500326dc7 100644 --- a/src/H5FDsubfiling/H5FDsubfile_int.c +++ b/src/H5FDsubfiling/H5FDsubfile_int.c @@ -343,11 +343,12 @@ H5FD__subfiling__get_real_eof(hid_t context_id, int64_t *logical_eof_ptr) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Waitall", mpi_code); for (int i = 0; i < num_subfiles; i++) { +#ifndef NDEBUG int ioc_rank = (int)recv_msg[3 * i]; +#endif assert(ioc_rank >= 0); assert(ioc_rank < n_io_concentrators); - CANBE_UNUSED(ioc_rank); assert(sf_eofs[i] == -1); sf_eofs[i] = recv_msg[(3 * i) + 1]; diff --git a/src/H5FDsubfiling/H5FDsubfiling_priv.h b/src/H5FDsubfiling/H5FDsubfiling_priv.h index 9cc32f14abf..08fef7d1a01 100644 --- a/src/H5FDsubfiling/H5FDsubfiling_priv.h +++ b/src/H5FDsubfiling/H5FDsubfiling_priv.h @@ -63,6 +63,4 @@ H5_DLL herr_t H5FD__subfiling__get_real_eof(hid_t context_id, int64_t *logical_e } #endif -#define CANBE_UNUSED(X) (void)(X) - #endif /* H5FDsubfiling_priv_H */ From 1cbda391c4c709f60707a4ccfac2ebea1ce856e5 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Mon, 16 Oct 2023 05:53:37 -0700 Subject: [PATCH 13/17] Suppress MPI_Waitall warnings w/ MPICH (#3680) MPICH defines MPI_STATUSES_IGNORE (a pointer) to 1, which raises warnings w/ gcc. This is a known issue that the MPICH devs are not going to fix. See here: https://github.com/pmodels/mpich/issues/5687 This fix suppresses those issues w/ gcc --- src/H5FDsubfiling/H5FDioc_int.c | 6 ++++++ src/H5FDsubfiling/H5FDsubfile_int.c | 22 +++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/H5FDsubfiling/H5FDioc_int.c b/src/H5FDsubfiling/H5FDioc_int.c index 674b08ddf94..5528fc8f8ff 100644 --- a/src/H5FDsubfiling/H5FDioc_int.c +++ b/src/H5FDsubfiling/H5FDioc_int.c @@ -423,8 +423,14 @@ ioc__async_completion(MPI_Request *mpi_reqs, size_t num_reqs) assert(mpi_reqs); H5_CHECK_OVERFLOW(num_reqs, size_t, int); + + /* Have to supppress gcc warnings regarding MPI_STATUSES_IGNORE + * with MPICH (https://github.com/pmodels/mpich/issues/5687) + */ + H5_GCC_DIAG_OFF("stringop-overflow") if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int)num_reqs, mpi_reqs, MPI_STATUSES_IGNORE))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Waitall failed", mpi_code); + H5_GCC_DIAG_ON("stringop-overflow") done: H5_SUBFILING_FUNC_LEAVE; diff --git a/src/H5FDsubfiling/H5FDsubfile_int.c b/src/H5FDsubfiling/H5FDsubfile_int.c index a8500326dc7..a7dd86455cb 100644 --- a/src/H5FDsubfiling/H5FDsubfile_int.c +++ b/src/H5FDsubfiling/H5FDsubfile_int.c @@ -143,17 +143,19 @@ H5FD__subfiling__truncate_sub_files(hid_t context_id, int64_t logical_file_eof, } /* Wait for truncate operations to complete */ + H5_GCC_DIAG_OFF("stringop-overflow") if (MPI_SUCCESS != (mpi_code = MPI_Waitall(num_subfiles_owned, recv_reqs, MPI_STATUSES_IGNORE))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Waitall", mpi_code); - - /* sanity check -- compute the file eof using the same mechanism used to - * compute the subfile eof. Assert that the computed value and the - * actual value match. - * - * Do this only for debug builds -- probably delete this before release. - * - * JRM -- 12/15/21 - */ + H5_GCC_DIAG_ON("stringop-overflow") + + /* sanity check -- compute the file eof using the same mechanism used to + * compute the subfile eof. Assert that the computed value and the + * actual value match. + * + * Do this only for debug builds -- probably delete this before release. + * + * JRM -- 12/15/21 + */ #ifndef NDEBUG { @@ -339,8 +341,10 @@ H5FD__subfiling__get_real_eof(hid_t context_id, int64_t *logical_eof_ptr) } /* Wait for EOF communication to complete */ + H5_GCC_DIAG_OFF("stringop-overflow") if (MPI_SUCCESS != (mpi_code = MPI_Waitall(num_subfiles, recv_reqs, MPI_STATUSES_IGNORE))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Waitall", mpi_code); + H5_GCC_DIAG_ON("stringop-overflow") for (int i = 0; i < num_subfiles; i++) { #ifndef NDEBUG From e158217012646896a9da73d2884dce34c70d2996 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Mon, 16 Oct 2023 06:09:48 -0700 Subject: [PATCH 14/17] Fix a possible NULL pointer dereference in tests (#3676) The dtypes test could dereference a NULL pointer if a strdup call failed. --- test/dtypes.c | 218 +++++++++++++++++++++----------------------------- 1 file changed, 92 insertions(+), 126 deletions(-) diff --git a/test/dtypes.c b/test/dtypes.c index 74b6f617f1c..a8def070d0e 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1983,26 +1983,36 @@ test_compound_10(void) cmpd_struct wdata[ARRAY_DIM]; cmpd_struct rdata[ARRAY_DIM]; - hid_t file; - hid_t arr_tid, cmpd_tid, cstr_id, vlstr_id; - hid_t space_id; - hid_t dset_id; + hid_t file = H5I_INVALID_HID; + hid_t arr_tid = H5I_INVALID_HID; + hid_t cmpd_tid = H5I_INVALID_HID; + hid_t cstr_id = H5I_INVALID_HID; + hid_t vlstr_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; hsize_t arr_dim[1] = {ARRAY_DIM}; /* Array dimensions */ hsize_t dim1[1]; - void *t1, *t2; + void *t1 = NULL; + void *t2 = NULL; char filename[1024]; size_t len; int i; TESTING("array datatype of compound type with VL string"); + memset(wdata, 0, sizeof(wdata)); + memset(rdata, 0, sizeof(rdata)); + + /* Initialize */ for (i = 0; i < ARRAY_DIM; i++) { - wdata[i].i1 = i * 10 + i; - wdata[i].str = strdup("C string A"); + wdata[i].i1 = i * 10 + i; + if (NULL == (wdata[i].str = strdup("C string A"))) + FAIL_PUTS_ERROR("Unable to duplicate string"); wdata[i].str[9] = (char)(wdata[i].str[9] + i); wdata[i].i2 = i * 1000 + i * 10; - wdata[i].text.p = (void *)strdup("variable-length text A\0"); + if (NULL == (wdata[i].text.p = (void *)strdup("variable-length text A\0"))) + FAIL_PUTS_ERROR("Unable to duplicate string"); len = wdata[i].text.len = strlen((char *)wdata[i].text.p) + 1; ((char *)(wdata[i].text.p))[len - 2] = (char)(((char *)(wdata[i].text.p))[len - 2] + i); ((char *)(wdata[i].text.p))[len - 1] = '\0'; @@ -2010,160 +2020,116 @@ test_compound_10(void) /* Create File */ h5_fixname(FILENAME[4], H5P_DEFAULT, filename, sizeof filename); - if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - H5_FAILED(); - AT(); - printf("Can't create file!\n"); - goto error; - } /* end if */ + if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; /* Create first compound datatype */ - if ((cmpd_tid = H5Tcreate(H5T_COMPOUND, sizeof(struct cmpd_struct))) < 0) { - H5_FAILED(); - AT(); - printf("Can't create datatype!\n"); - goto error; - } /* end if */ + if ((cmpd_tid = H5Tcreate(H5T_COMPOUND, sizeof(struct cmpd_struct))) < 0) + TEST_ERROR; - if (H5Tinsert(cmpd_tid, "i1", HOFFSET(struct cmpd_struct, i1), H5T_NATIVE_INT) < 0) { - H5_FAILED(); - AT(); - printf("Can't insert field 'i1'\n"); - goto error; - } /* end if */ + if (H5Tinsert(cmpd_tid, "i1", HOFFSET(struct cmpd_struct, i1), H5T_NATIVE_INT) < 0) + TEST_ERROR; - cstr_id = H5Tcopy(H5T_C_S1); - if (H5Tset_size(cstr_id, H5T_VARIABLE) < 0) { - H5_FAILED(); - AT(); - printf("Can't set size for C string\n"); - goto error; - } /* end if */ + if ((cstr_id = H5Tcopy(H5T_C_S1)) < 0) + TEST_ERROR; + if (H5Tset_size(cstr_id, H5T_VARIABLE) < 0) + TEST_ERROR; - if (H5Tinsert(cmpd_tid, "c_string", HOFFSET(cmpd_struct, str), cstr_id) < 0) { - H5_FAILED(); - AT(); - printf("Can't insert field 'str'\n"); - goto error; - } /* end if */ + if (H5Tinsert(cmpd_tid, "c_string", HOFFSET(cmpd_struct, str), cstr_id) < 0) + TEST_ERROR; /* Create vl-string datatype */ - if ((vlstr_id = H5Tvlen_create(H5T_NATIVE_CHAR)) < 0) { - H5_FAILED(); - AT(); - printf("Can't create VL string\n"); - goto error; - } /* end if */ + if ((vlstr_id = H5Tvlen_create(H5T_NATIVE_CHAR)) < 0) + TEST_ERROR; - if (H5Tinsert(cmpd_tid, "vl_string", HOFFSET(cmpd_struct, text), vlstr_id) < 0) { - H5_FAILED(); - AT(); - printf("Can't insert field 'text'\n"); - goto error; - } /* end if */ + if (H5Tinsert(cmpd_tid, "vl_string", HOFFSET(cmpd_struct, text), vlstr_id) < 0) + TEST_ERROR; - if (H5Tinsert(cmpd_tid, "i2", HOFFSET(struct cmpd_struct, i2), H5T_NATIVE_INT) < 0) { - H5_FAILED(); - AT(); - printf("Can't insert field 'i2'\n"); - goto error; - } /* end if */ + if (H5Tinsert(cmpd_tid, "i2", HOFFSET(struct cmpd_struct, i2), H5T_NATIVE_INT) < 0) + TEST_ERROR; /* Create the array datatype for c_string data */ - if ((arr_tid = H5Tarray_create2(cmpd_tid, 1, arr_dim)) < 0) { - H5_FAILED(); - AT(); - printf("Can't create array type\n"); - goto error; - } /* end if */ + if ((arr_tid = H5Tarray_create2(cmpd_tid, 1, arr_dim)) < 0) + TEST_ERROR; dim1[0] = 1; - if ((space_id = H5Screate_simple(1, dim1, NULL)) < 0) { - H5_FAILED(); - AT(); - printf("Can't create space\n"); - goto error; - } /* end if */ + if ((space_id = H5Screate_simple(1, dim1, NULL)) < 0) + TEST_ERROR; - if ((dset_id = H5Dcreate2(file, "Dataset", arr_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < - 0) { - H5_FAILED(); - AT(); - printf("Can't create dataset\n"); - goto error; - } /* end if */ + if ((dset_id = H5Dcreate2(file, "Dataset", arr_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; - if (H5Dwrite(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) { - H5_FAILED(); - AT(); - printf("Can't write data\n"); - goto error; - } /* end if */ + if (H5Dwrite(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) + TEST_ERROR; - if (H5Dread(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) { - H5_FAILED(); - AT(); - printf("Can't read data\n"); - goto error; - } /* end if */ + if (H5Dread(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) + TEST_ERROR; for (i = 0; i < ARRAY_DIM; i++) { if (rdata[i].i1 != wdata[i].i1 || rdata[i].i2 != wdata[i].i2 || - strcmp(rdata[i].str, wdata[i].str) != 0) { - H5_FAILED(); - AT(); - printf("incorrect read data\n"); - goto error; - } /* end if */ + strcmp(rdata[i].str, wdata[i].str) != 0) + FAIL_PUTS_ERROR("incorrect read data\n"); - if (rdata[i].text.len != wdata[i].text.len) { - H5_FAILED(); - AT(); - printf("incorrect VL length\n"); - goto error; - } /* end if */ + if (rdata[i].text.len != wdata[i].text.len) + FAIL_PUTS_ERROR("incorrect VL length\n"); t1 = rdata[i].text.p; t2 = wdata[i].text.p; - if (strcmp((char *)t1, (char *)t2) != 0) { - H5_FAILED(); - AT(); - printf("incorrect VL read data\n"); - goto error; - } - } /* end for */ - if (H5Treclaim(arr_tid, space_id, H5P_DEFAULT, &rdata) < 0) { - H5_FAILED(); - AT(); - printf("Can't reclaim read data\n"); - goto error; - } /* end if */ - if (H5Treclaim(arr_tid, space_id, H5P_DEFAULT, &wdata) < 0) { - H5_FAILED(); - AT(); - printf("Can't reclaim read data\n"); - goto error; - } /* end if */ + if (strcmp((char *)t1, (char *)t2) != 0) + FAIL_PUTS_ERROR("incorrect VL read data\n"); + } + + if (H5Treclaim(arr_tid, space_id, H5P_DEFAULT, &rdata) < 0) + TEST_ERROR; + if (H5Treclaim(arr_tid, space_id, H5P_DEFAULT, &wdata) < 0) + TEST_ERROR; if (H5Dclose(dset_id) < 0) - goto error; + TEST_ERROR; if (H5Tclose(arr_tid) < 0) - goto error; + TEST_ERROR; + arr_tid = H5I_INVALID_HID; if (H5Tclose(cmpd_tid) < 0) - goto error; + TEST_ERROR; if (H5Tclose(cstr_id) < 0) - goto error; + TEST_ERROR; if (H5Tclose(vlstr_id) < 0) - goto error; + TEST_ERROR; if (H5Sclose(space_id) < 0) - goto error; + TEST_ERROR; + space_id = H5I_INVALID_HID; if (H5Fclose(file) < 0) - goto error; + TEST_ERROR; PASSED(); return 0; error: + + H5E_BEGIN_TRY + { + if (arr_tid != H5I_INVALID_HID && space_id != H5I_INVALID_HID) { + H5Treclaim(arr_tid, space_id, H5P_DEFAULT, &rdata); + H5Treclaim(arr_tid, space_id, H5P_DEFAULT, &wdata); + } + else { + /* Clean up memory if we failed out early */ + for (i = 0; i < ARRAY_DIM; i++) { + free(wdata[i].str); + free(wdata[i].text.p); + } + } + + H5Dclose(dset_id); + H5Tclose(arr_tid); + H5Tclose(cmpd_tid); + H5Tclose(cstr_id); + H5Tclose(vlstr_id); + H5Sclose(space_id); + H5Fclose(file); + } + H5E_END_TRY + return 1; } From ccb1a917b6e68bc51a6a4e3d6783edfa056b01bf Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:19:15 -0700 Subject: [PATCH 15/17] Fix printf warnings in t_mpi (#3679) * Fix printf warnings in t_mpi The type of MPI_Offset varies with implementation. In MPICH, it's long, which raises warnings when we attempt to use long long format specifiers. Casting to long long fixes the warnings. --- testpar/t_mpi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 70a76ecdb32..eff39d057e0 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -306,12 +306,14 @@ test_mpio_gb_file(char *filename) for (i = ntimes - 2; i <= ntimes; i++) { mpi_off = (i * mpi_size + mpi_rank) * (MPI_Offset)MB; if (VERBOSE_MED) - fprintf(stdout, "proc %d: write to mpi_off=%016llx, %lld\n", mpi_rank, mpi_off, mpi_off); + fprintf(stdout, "proc %d: write to mpi_off=%016llx, %lld\n", mpi_rank, (long long)mpi_off, + (long long)mpi_off); /* set data to some trivial pattern for easy verification */ for (j = 0; j < MB; j++) *(buf + j) = (int8_t)(i * mpi_size + mpi_rank); if (VERBOSE_MED) - fprintf(stdout, "proc %d: writing %d bytes at offset %lld\n", mpi_rank, MB, mpi_off); + fprintf(stdout, "proc %d: writing %d bytes at offset %lld\n", mpi_rank, MB, + (long long)mpi_off); mrc = MPI_File_write_at(fh, mpi_off, buf, MB, MPI_BYTE, &mpi_stat); INFO((mrc == MPI_SUCCESS), "GB size file write"); if (mrc != MPI_SUCCESS) @@ -345,7 +347,8 @@ test_mpio_gb_file(char *filename) for (i = ntimes - 2; i <= ntimes; i++) { mpi_off = (i * mpi_size + (mpi_size - mpi_rank - 1)) * (MPI_Offset)MB; if (VERBOSE_MED) - fprintf(stdout, "proc %d: read from mpi_off=%016llx, %lld\n", mpi_rank, mpi_off, mpi_off); + fprintf(stdout, "proc %d: read from mpi_off=%016llx, %lld\n", mpi_rank, + (long long)mpi_off, (long long)mpi_off); mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE, &mpi_stat); INFO((mrc == MPI_SUCCESS), "GB size file read"); expected = (int8_t)(i * mpi_size + (mpi_size - mpi_rank - 1)); From 85507981000e5d68788a3ff00f66adb1b0aca842 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:20:18 -0700 Subject: [PATCH 16/17] Fix invalid memory access in S3 comms (#3681) In the ros3 VFD, passing an empty string parameter to an internal API call could result in accessing the -1th element of a string. This would cause failures on big-endian systems like s390x. This parameter is now checked before writing to the string. Fixes GitHub #1168 --- src/H5FDs3comms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index 58fc4355e63..dae1149ae60 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -1713,7 +1713,8 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c } /* end while node is not NULL */ /* remove trailing ';' from signed headers sequence */ - signed_headers_dest[strlen(signed_headers_dest) - 1] = '\0'; + if (*signed_headers_dest != '\0') + signed_headers_dest[strlen(signed_headers_dest) - 1] = '\0'; /* append signed headers and payload hash * NOTE: at present, no HTTP body is handled, per the nature of From 1b62827204d4fd924794c2bcb6456de70f6048b0 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:21:01 -0700 Subject: [PATCH 17/17] Add Doxygen for H5Pset_fapl_sec2() (#3685) * --- src/H5FDsec2.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h index 56f45751d32..a2590aee968 100644 --- a/src/H5FDsec2.h +++ b/src/H5FDsec2.h @@ -23,7 +23,23 @@ extern "C" { #endif -H5_DLL hid_t H5FD_sec2_init(void); +H5_DLL hid_t H5FD_sec2_init(void); + +/** + * \ingroup FAPL + * + * \brief Modifies the file access property list to use the #H5FD_SEC2 driver + * + * \fapl_id + * + * \returns \herr_t + * + * \details H5Pset_fapl_sec2() modifies the file access property list to use the + * #H5FD_SEC2 driver. + * + * \since 1.4.0 + * + */ H5_DLL herr_t H5Pset_fapl_sec2(hid_t fapl_id); #ifdef __cplusplus