Skip to content

Commit

Permalink
Bring key changesets from develop (HDFGroup#3052)
Browse files Browse the repository at this point in the history
* Bump GitHub action macOS version to 13 (HDFGroup#2999, HDFGroup#3009)
* Bump GitHub action gcc/g++/gfortran version to 12 (HDFGroup#3015)
* Bump Autoconf version to 2.71 (HDFGroup#2944)
* Fix missing h5_reset() calls in accum test (HDFGroup#3001)
* Only run ttsafe in GitHub thread-safe actions (HDFGroup#2777)
* Fix Java debug asserts on Windows (HDFGroup#3012)
* Fix long double dt_arith bug on macOS (HDFGroup#3038)
  • Loading branch information
derobins authored and brtnfld committed Oct 5, 2023
1 parent 39a78a8 commit bece7c1
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 39 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
# We could also build with the Autotools via brew installing them,
# but that seems unnecessary
- name: "MacOS Clang CMake"
os: macos-11
os: macos-13
cpp: ON
fortran: OFF
java: ON
Expand Down Expand Up @@ -324,10 +324,10 @@ jobs:
run: |
sudo apt update
sudo apt install automake autoconf libtool libtool-bin
sudo apt install gcc-11 g++-11 gfortran-11
echo "CC=gcc-11" >> $GITHUB_ENV
echo "CXX=g++-11" >> $GITHUB_ENV
echo "FC=gfortran-11" >> $GITHUB_ENV
sudo apt install gcc-12 g++-12 gfortran-12
echo "CC=gcc-12" >> $GITHUB_ENV
echo "CXX=g++-12" >> $GITHUB_ENV
echo "FC=gfortran-12" >> $GITHUB_ENV
sudo apt install libaec0 libaec-dev
if: (matrix.generator == 'autogen') && (matrix.parallel != 'enable')

Expand All @@ -347,7 +347,7 @@ jobs:

- name: Install Dependencies (macOS)
run: brew install ninja
if: matrix.os == 'macos-11'
if: matrix.os == 'macos-13'

- name: Set environment for MSVC (Windows)
run: |
Expand Down Expand Up @@ -429,10 +429,23 @@ jobs:
if: (matrix.generator == 'autogen') && (matrix.run_tests) && ! (matrix.thread_safety.enabled)

- name: CMake Run Tests
run: ctest --build . --parallel 2 -C ${{ matrix.build_mode.cmake }} -V
run: ctest . --parallel 2 -C ${{ matrix.build_mode.cmake }} -V
working-directory: ${{ runner.workspace }}/build
# Skip Debug MSVC while we investigate H5L Java test timeouts
if: (matrix.generator != 'autogen') && (matrix.run_tests) && ! ((matrix.name == 'Windows MSVC CMake') && (matrix.build_mode.cmake == 'Debug'))
if: (matrix.generator != 'autogen') && (matrix.run_tests) && ! (matrix.thread_safety.enabled)

# THREAD-SAFE

- name: Autotools Run Thread-Safe Tests
run: |
cd test
./ttsafe
working-directory: ${{ runner.workspace }}/build
if: (matrix.generator == 'autogen') && (matrix.run_tests) && (matrix.thread_safety.enabled)

- name: CMake Run Thread-Safe Tests
run: ctest . --parallel 2 -C ${{ matrix.build_mode.cmake }} -V -R ttsafe
working-directory: ${{ runner.workspace }}/build
if: (matrix.generator != 'autogen') && (matrix.run_tests) && (matrix.thread_safety.enabled)

#
# INSTALL (note that this runs even when we don't run the tests)
Expand Down
5 changes: 5 additions & 0 deletions config/cmake/HDF5_Examples.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ if(WIN32)
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else(APPLE)
set(ENV{DYLD_LIBRARY_PATH} "${INSTALLDIR}/lib")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
else()
set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
Expand Down
2 changes: 2 additions & 0 deletions config/cmake/jrunTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ endif ()

if (WIN32)
set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}")
elseif (APPLE)
set (ENV{DYLD_LIBRARY_PATH} "$ENV{DYLD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
else ()
set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
endif ()
Expand Down
2 changes: 2 additions & 0 deletions config/cmake_ext_mod/grepTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
if (TEST_LIBRARY_DIRECTORY)
if (WIN32)
set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
elseif (APPLE)
set (ENV{DYLD_LIBRARY_PATH} "$ENV{DYLD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
else ()
set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
endif ()
Expand Down
2 changes: 2 additions & 0 deletions config/cmake_ext_mod/runTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
if (TEST_LIBRARY_DIRECTORY)
if (WIN32)
set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
elseif (APPLE)
set (ENV{DYLD_LIBRARY_PATH} "$ENV{DYLD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
else ()
set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
endif ()
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## ----------------------------------------------------------------------
## Initialize configure.
##
AC_PREREQ([2.69])
AC_PREREQ([2.71])

## AC_INIT takes the name of the package, the version number, and an
## email address to report bugs. AC_CONFIG_SRCDIR takes a unique file
Expand Down
8 changes: 4 additions & 4 deletions java/src/jni/h5lImp.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ Java_hdf_hdf5lib_H5_H5Lexists(JNIEnv *env, jclass clss, jlong loc_id, jstring na
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Lget_1info(JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_id)
{
H5L_info2_t infobuf;
H5L_info2_t infobuf = {H5L_TYPE_ERROR, FALSE, -1, H5T_CSET_ERROR, 0};
const char *linkName = NULL;
jvalue args[5];
herr_t status = FAIL;
Expand Down Expand Up @@ -340,7 +340,7 @@ JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Lget_1info_1by_1idx(JNIEnv *env, jclass clss, jlong loc_id, jstring name,
jint index_field, jint order, jlong link_n, jlong access_id)
{
H5L_info2_t infobuf;
H5L_info2_t infobuf = {H5L_TYPE_ERROR, FALSE, -1, H5T_CSET_ERROR, 0};
const char *groupName = NULL;
jvalue args[5];
herr_t status = FAIL;
Expand Down Expand Up @@ -454,7 +454,7 @@ JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Lget_1value(JNIEnv *env, jclass clss, jlong loc_id, jstring name,
jobjectArray link_value, jlong access_id)
{
H5L_info2_t infobuf;
H5L_info2_t infobuf = {H5L_TYPE_ERROR, FALSE, -1, H5T_CSET_ERROR, 0};
const char *file_name = NULL;
const char *obj_name = NULL;
const char *linkName = NULL;
Expand Down Expand Up @@ -544,7 +544,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1value_1by_1idx(JNIEnv *env, jclass clss, jlong loc_i
jint index_field, jint order, jlong link_n,
jobjectArray link_value, jlong access_id)
{
H5L_info2_t infobuf;
H5L_info2_t infobuf = {H5L_TYPE_ERROR, FALSE, -1, H5T_CSET_ERROR, 0};
const char *file_name = NULL;
const char *obj_name = NULL;
const char *grpName = NULL;
Expand Down
8 changes: 8 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,14 @@ Bug Fixes since HDF5-1.12.2 release

Configuration
-------------
- The accum test now passes on macOS 12+ (Monterey) w/ CMake

Due to changes in the way macOS handles LD_LIBRARY_PATH, the accum test
started failing on macOS 12+ when building with CMake. CMake has been
updated to set DYLD_LIBRARY_PATH on macOS and the test now passes.

Fixes GitHub #2994, #2261, and #1289

- Fixed syntax of generator expressions used by CMake

Adding quotes around the generator expression should allow CMake to
Expand Down
6 changes: 0 additions & 6 deletions src/H5FDtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
* VFD feature flags (which do not exist until the driver
* is instantiated).
*
* See test/Makefile.am for a list of the VFD strings.
*
* This function is only intended for use in the test code.
*
* Return: TRUE (1) if the VFD supports SWMR I/O or vfd_name is
Expand All @@ -82,10 +80,6 @@
*
* This function cannot fail at this time so there is no
* error return value.
*
* Programmer: Dana Robinson
* Fall 2014
*
*-------------------------------------------------------------------------
*/
hbool_t
Expand Down
24 changes: 22 additions & 2 deletions src/H5Tconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,17 @@ done:
/* Macro defining action on source data which needs to be aligned (before main action) */
#define H5T_CONV_LOOP_PRE_SALIGN(ST) \
{ \
H5MM_memcpy(&src_aligned, src, sizeof(ST)); \
/* The uint8_t * cast is required to avoid tripping over undefined behavior. \
* \
* The typed pointer arrives via a void pointer, which may have any alignment. \
* We then cast it to a pointer to a type that is assumed to be aligned, which \
* is undefined behavior (section 6.3.2.3 paragraph 7 of the C99 standard). \
* In the past this hasn't caused many problems, but in some cases (e.g. \
* converting long doubles on macOS), an optimizing compiler might do the \
* wrong thing (in the macOS case, the conversion uses SSE, which has stricter \
* requirements about alignment). \
*/ \
H5MM_memcpy(&src_aligned, (const uint8_t *)src, sizeof(ST)); \
}

/* Macro defining action on source data which doesn't need to be aligned (before main action) */
Expand Down Expand Up @@ -919,7 +929,17 @@ done:
/* Macro defining action on destination data which needs to be aligned (after main action) */
#define H5T_CONV_LOOP_POST_DALIGN(DT) \
{ \
H5MM_memcpy(dst, &dst_aligned, sizeof(DT)); \
/* The uint8_t * cast is required to avoid tripping over undefined behavior. \
* \
* The typed pointer arrives via a void pointer, which may have any alignment. \
* We then cast it to a pointer to a type that is assumed to be aligned, which \
* is undefined behavior (section 6.3.2.3 paragraph 7 of the C99 standard). \
* In the past this hasn't caused many problems, but in some cases (e.g. \
* converting long doubles on macOS), an optimizing compiler might do the \
* wrong thing (in the macOS case, the conversion uses SSE, which has stricter \
* requirements about alignment). \
*/ \
H5MM_memcpy((uint8_t *)dst, &dst_aligned, sizeof(DT)); \
}

/* Macro defining action on destination data which doesn't need to be aligned (after main action) */
Expand Down
12 changes: 6 additions & 6 deletions test/accum_swmr_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ const char *FILENAME[] = {"accum", "accum_swmr_big", NULL};
*
* Return: Success: EXIT_SUCCESS
* Failure: EXIT_FAILURE
*
* Programmer: Vailin Choi; June 2013
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
hid_t fid = -1; /* File ID */
hid_t fapl = -1; /* file access property list ID */
H5F_t *f = NULL; /* File pointer */
hid_t fid = H5I_INVALID_HID; /* File ID */
hid_t fapl = H5I_INVALID_HID; /* file access property list ID */
H5F_t *f = NULL; /* File pointer */
char filename[1024];
unsigned u; /* Local index variable */
uint8_t rbuf[1024]; /* Buffer for reading */
uint8_t buf[1024]; /* Buffer for holding the expected data */
char *driver = NULL; /* VFD string (from env variable) */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */

/* Testing setup */
h5_reset();

/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
Expand Down
22 changes: 11 additions & 11 deletions test/swmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -7728,12 +7728,15 @@ test_multiple_same(hid_t in_fapl, hbool_t new_format)
int
main(void)
{
int nerrors = 0; /* The # of errors */
hid_t fapl = -1; /* File access property list ID */
char *driver = NULL; /* VFD string (from env variable) */
char *lock_env_var = NULL; /* file locking env var pointer */
hbool_t use_file_locking; /* read from env var */
hbool_t file_locking_enabled = FALSE; /* Checks if the file system supports locks */
int nerrors = 0; /* The # of errors */
hid_t fapl = H5I_INVALID_HID; /* File access property list ID */
char *driver = NULL; /* VFD string (from env variable) */
char *lock_env_var = NULL; /* file locking env var pointer */
hbool_t use_file_locking; /* read from env var */
hbool_t file_locking_enabled = FALSE; /* Checks if the file system supports locks */

/* Testing setup */
h5_reset();

/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
Expand All @@ -7742,7 +7745,7 @@ main(void)
if (!H5FD__supports_swmr_test(driver)) {
HDprintf("This VFD does not support SWMR I/O\n");
return EXIT_SUCCESS;
} /* end if */
}

/* Check the environment variable that determines if we care
* about file locking. File locking should be used unless explicitly
Expand All @@ -7761,9 +7764,6 @@ main(void)
return EXIT_FAILURE;
}

/* Set up */
h5_reset();

/* Get file access property list */
fapl = h5_fileaccess();

Expand Down Expand Up @@ -7822,7 +7822,7 @@ main(void)
*/
nerrors += test_file_lock_swmr_same(fapl);
nerrors += test_file_lock_swmr_concur(fapl);
} /* end if */
}

/* Tests SWMR VFD compatibility flag.
* Only needs to run when the VFD is the default (sec2).
Expand Down

0 comments on commit bece7c1

Please sign in to comment.