From 69c720bffa4980779dc06d3cf9cd9f271bc8588b Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Fri, 14 Apr 2023 15:14:38 -0700 Subject: Merge "Use additional CPUs" and related fixes (#2742) * 2720 Fix java depends and pdb lib install * 2695 Use additional CPUs in GitHub actions --- .github/workflows/main.yml | 8 ++++---- config/cmake/HDFMacros.cmake | 2 +- java/examples/datasets/CMakeLists.txt | 7 ++++++- java/examples/datatypes/CMakeLists.txt | 5 +++++ java/examples/groups/CMakeLists.txt | 7 +++++++ java/examples/intro/CMakeLists.txt | 5 +++++ 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a08848e..f5534ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -434,12 +434,12 @@ jobs: # - name: Autotools Build - run: make + run: make -j3 working-directory: ${{ runner.workspace }}/build if: matrix.generator == 'autogen' - name: CMake Build - run: cmake --build . --config ${{ matrix.build_mode.cmake }} + run: cmake --build . --parallel 3 --config ${{ matrix.build_mode.cmake }} working-directory: ${{ runner.workspace }}/build if: matrix.generator != 'autogen' @@ -448,12 +448,12 @@ jobs: # - name: Autotools Run Tests - run: make check + run: make check -j2 working-directory: ${{ runner.workspace }}/build if: (matrix.generator == 'autogen') && (matrix.run_tests) - name: CMake Run Tests - run: ctest --build . -C ${{ matrix.build_mode.cmake }} -V + run: ctest --build . --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')) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index fc04d17..1157283 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -75,7 +75,7 @@ endmacro () macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) if (WIN32 AND MSVC AND NOT DISABLE_PDB_FILES) get_target_property (target_type ${libtarget} TYPE) - if (${libtype} MATCHES "SHARED") + if (${target_type} MATCHES "SHARED") set (targetfilename $) else () get_property (target_name TARGET ${libtarget} PROPERTY $,$>,OUTPUT_NAME_DEBUG,OUTPUT_NAME_RELWITHDEBINFO>) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 4403336..a9a5643 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -82,6 +82,7 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$,$>:${CMAKE_DEBUG_POSTFIX}>;") + set (last_test "") foreach (example ${HDF_JAVA_EXAMPLES}) if (example STREQUAL "H5Ex_D_External") add_test ( @@ -97,6 +98,9 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) endif () + if (last_test) + set_tests_properties (JAVA_datasets-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME JAVA_datasets-${example}-copy-objects @@ -137,9 +141,10 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) + endif () set_tests_properties (JAVA_datasets-${example}-clean-objects PROPERTIES DEPENDS JAVA_datasets-${example} ) - endif () + set (last_test "JAVA_datasets-${example}-clean-objects") endforeach () endif () diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 1690701..5860429 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -67,12 +67,16 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$,$>:${CMAKE_DEBUG_POSTFIX}>;") + set (last_test "") foreach (example ${HDF_JAVA_EXAMPLES}) add_test ( NAME JAVA_datatypes-${example}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) + if (last_test) + set_tests_properties (JAVA_datatypes-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME JAVA_datatypes-${example}-copy-objects @@ -107,5 +111,6 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) set_tests_properties (JAVA_datatypes-${example}-clean-objects PROPERTIES DEPENDS JAVA_datatypes-${example} ) + set (last_test "JAVA_datatypes-${example}-clean-objects") endforeach () endif () diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 1d63c15..fc9eb94 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -66,6 +66,7 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$,$>:${CMAKE_DEBUG_POSTFIX}>;") + set (last_test "") foreach (example ${HDF_JAVA_EXAMPLES}) if (NOT example STREQUAL "H5Ex_G_Iterate" AND NOT example STREQUAL "H5Ex_G_Visit") if (example STREQUAL "H5Ex_G_Compact") @@ -88,6 +89,9 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) COMMAND ${CMAKE_COMMAND} -E echo "${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 exists" ) endif () + if (last_test) + set_tests_properties (JAVA_groups-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME JAVA_groups-${example}-copy-objects @@ -132,6 +136,9 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) set_tests_properties (JAVA_groups-${example}-clean-objects PROPERTIES DEPENDS JAVA_groups-${example} ) + set (last_test "JAVA_groups-${example}-clean-objects") + else () + set (last_test "JAVA_groups-${example}") endif () endforeach () endif () diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index a1e2a51..685ef90 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -56,12 +56,16 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME) set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$,$>:${CMAKE_DEBUG_POSTFIX}>;") + set (last_test "") foreach (example ${HDF_JAVA_EXAMPLES}) add_test ( NAME JAVA_intro-${example}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) + if (last_test) + set_tests_properties (JAVA_intro-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME JAVA_intro-${example}-copy-objects @@ -97,6 +101,7 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) set_tests_properties (JAVA_intro-${example}-clean-objects PROPERTIES DEPENDS JAVA_intro-${example} ) + set (last_test "JAVA_intro-${example}-clean-objects") endforeach () endif () -- cgit v0.12