From 55e8d258ad1f469af5752c0569b7da986354aa5a Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Wed, 26 Oct 2022 17:18:15 -0400 Subject: [PATCH] CMAKE: update latest CI CMake to 3.23.4 --- .gitlab-ci.yml | 48 ------------------------------------- .gitlab/ci/centos7.yml | 1 + .gitlab/ci/config/cmake.sh | 39 +++++++++++++----------------- .gitlab/ci/ctest_test.cmake | 12 ++++++---- .gitlab/ci/ubuntu1604.yml | 3 +++ CMake/VTKmConfig.cmake.in | 8 +++---- 6 files changed, 33 insertions(+), 78 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0e71394f6..765e67a0c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,51 +1,3 @@ - -# Docker Images: -# -# * .gitlab/ci/docker/centos7/cuda10.2/ -# - cuda -# - gcc 7.3.1 -# * .gitlab/ci/docker/centos8/base/ -# - gcc 8.3.1 -# - clang 8.0.1 -# - openmp -# - asan, ubsan -# * .gitlab/ci/docker/rhel8/cuda10.2/ -# - cuda -# - gcc 8.2.1 -# * .gitlab/ci/docker/ubuntu1604/base/ -# - gcc 5.4.0 -# - clang 3.8 -# - clang 5.0 -# - tbb -# - openmpi -# * .gitlab/ci/docker/ubuntu1604/cuda9.2/ -# - cuda -# - gcc 5.4 -# - tbb -# - openmp -# - openmpi -# * .gitlab/ci/docker/ubuntu1804/base/ -# - gcc 6.5 -# - gcc 7.4 -# - gcc 9 -# - clang 8 -# - tbb -# - openmp -# - mpich2 -# - hdf5 -# * .gitlab/ci/docker/ubuntu1804/cuda11.1/ -# - cuda -# - gcc 7 -# - gcc 8 -# - tbb -# - openmp -# - mpich2 -# * .gitlab/ci/docker/ubuntu2004/doxygen/ -# - gcc 9.3 -# - tbb -# - openmp -# - mpich2 - .docker_image: &docker_image variables: GIT_CLONE_PATH: $CI_BUILDS_DIR/gitlab-kitware-sciviz-ci diff --git a/.gitlab/ci/centos7.yml b/.gitlab/ci/centos7.yml index f07f38a29..c3c0bf052 100644 --- a/.gitlab/ci/centos7.yml +++ b/.gitlab/ci/centos7.yml @@ -31,6 +31,7 @@ test:centos7_gcc73: - .centos7 - .cmake_test_linux - .run_automatically + - .use_minimum_supported_cmake dependencies: - build:centos7_gcc73 needs: diff --git a/.gitlab/ci/config/cmake.sh b/.gitlab/ci/config/cmake.sh index 1f2c74618..1de03fe72 100755 --- a/.gitlab/ci/config/cmake.sh +++ b/.gitlab/ci/config/cmake.sh @@ -1,31 +1,25 @@ #!/usr/bin/env bash # shellcheck disable=SC2079 -set -x +set -ex -version="${1:-3.21.1}" +version="${1:-3.23.4}" case "$( uname -s )" in Linux) - shatool="sha256sum" - # We require CMake >= 3.13 in the CI to support CUDA builds - readonly -A linuxParamsByVersion=( - ['3.13.5']='e2fd0080a6f0fc1ec84647acdcd8e0b4019770f48d83509e6a5b0b6ea27e5864 Linux' - ['3.21.1']='bf496ce869d0aa8c1f57e4d1a2e50c8f2fb12a6cd7ccb37ad743bb88f6b76a1e linux' + readonly -A sumsByVersion=( + # We require CMake >= 3.13 in the CI to support CUDA builds + ['3.13.5']='e2fd0080a6f0fc1ec84647acdcd8e0b4019770f48d83509e6a5b0b6ea27e5864' + ['3.23.4']='3fbcbff85043d63a8a83c8bdf8bd5b1b2fd5768f922de7dc4443de7805a2670d' ) - - if [ -z "${linuxParamsByVersion[$version]}" ] - then - echo "Given version ($version) is unsupported" - exit 1 - fi - sha256sum=$(cut -f 1 <<<"${linuxParamsByVersion[$version]}") - platform=$(cut -f 2 <<<"${linuxParamsByVersion[$version]}") + shatool="sha256sum" + sha256sum="${sumsByVersion[$version]}" + platform="linux" arch="x86_64" ;; Darwin) shatool="shasum -a 256" - sha256sum="9dc2978c4d94a44f71336fa88c15bb0eee47cf44b6ece51b10d1dfae95f82279" + sha256sum="98cac043cdf321caa4fd07f27da3316db6c8bc48c39997bf78e27e5c46c4eb68" platform="macos" arch="universal" ;; @@ -39,16 +33,17 @@ readonly sha256sum readonly platform readonly arch -readonly filename="cmake-$version-$platform-$arch" -readonly tarball="$filename.tar.gz" - cd .gitlab || exit +readonly tarball="cmake-$version-$platform-$arch.tar.gz" +curl -SOL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" + echo "$sha256sum $tarball" > cmake.sha256sum -curl -OL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" $shatool --check cmake.sha256sum -tar xf "$tarball" -mv "$filename" cmake + +# Extract cmake install root into director named cmake +mkdir cmake +tar xf "$tarball" --strip-components=1 -C cmake if [ "$( uname -s )" = "Darwin" ]; then ln -s CMake.app/Contents/bin cmake/bin diff --git a/.gitlab/ci/ctest_test.cmake b/.gitlab/ci/ctest_test.cmake index 2c37cae1b..956856254 100644 --- a/.gitlab/ci/ctest_test.cmake +++ b/.gitlab/ci/ctest_test.cmake @@ -11,7 +11,7 @@ ##============================================================================= # We need this CMake versions for tests -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.12..3.15 FATAL_ERROR) # Read the files from the build directory that contain # host information ( name, parallel level, etc ) @@ -36,6 +36,10 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.21) set(junit_args OUTPUT_JUNIT "${CTEST_BINARY_DIRECTORY}/junit.xml") endif() +if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) + set(repeat_args REPEAT "UNTIL_PASS:${CTEST_REPEAT_UNTIL_PASS}") +endif() + set(PARALLEL_LEVEL "10") if (DEFINED ENV{CTEST_MAX_PARALLELISM}) set(PARALLEL_LEVEL $ENV{CTEST_MAX_PARALLELISM}) @@ -52,7 +56,7 @@ ctest_test(APPEND RETURN_VALUE test_result ${test_exclusions} ${test_inclusions} - REPEAT "UNTIL_PASS:${CTEST_REPEAT_UNTIL_PASS}" + ${repeat_args} ${junit_args} ) message(STATUS "ctest_test RETURN_VALUE: ${test_result}") @@ -66,8 +70,8 @@ if(VTKm_ENABLE_PERFORMANCE_TESTING) endif() if(NOT DEFINED ENV{GITLAB_CI_EMULATION}) - ctest_submit(PARTS Test Notes BUILD_ID build_id) - message(STATUS "Test submission build_id: ${build_id}") + ctest_submit(PARTS Test Notes) + message(STATUS "Test submission done") endif() if (test_result) diff --git a/.gitlab/ci/ubuntu1604.yml b/.gitlab/ci/ubuntu1604.yml index bacc2e628..56300d2c9 100644 --- a/.gitlab/ci/ubuntu1604.yml +++ b/.gitlab/ci/ubuntu1604.yml @@ -32,6 +32,7 @@ test:ubuntu1604_gcc5: - .ubuntu1604_cuda - .cmake_test_linux - .run_automatically + - .use_minimum_supported_cmake dependencies: - build:ubuntu1604_gcc5 needs: @@ -70,6 +71,7 @@ test:ubuntu1804_test_ubuntu1604_gcc5_2: - .ubuntu1804_cuda - .cmake_test_linux - .run_upstream_branches + - .use_minimum_supported_cmake variables: CTEST_EXCLUSIONS: "built_against_test_install" dependencies: @@ -106,6 +108,7 @@ test:ubuntu1604_clang5: - .ubuntu1604 - .cmake_test_linux - .run_automatically + - .use_minimum_supported_cmake dependencies: - build:ubuntu1604_clang5 needs: diff --git a/CMake/VTKmConfig.cmake.in b/CMake/VTKmConfig.cmake.in index a5e07626d..cffbab5c9 100644 --- a/CMake/VTKmConfig.cmake.in +++ b/CMake/VTKmConfig.cmake.in @@ -115,12 +115,12 @@ endif() # replace this with setting `cuda_architecture_flags` as part of the # EXPORT_PROPERTIES of the vtkm_cuda target if(VTKm_ENABLE_CUDA AND VTKM_FROM_INSTALL_DIR) + # Canonical way of setting CUDA arch + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18) + set_target_properties(vtkm::cuda PROPERTIES CUDA_ARCHITECTURES "@CMAKE_CUDA_ARCHITECTURES@") + endif() set_target_properties(vtkm::cuda PROPERTIES - - # Canonical way of setting CUDA arch - CUDA_ARCHITECTURES "@CMAKE_CUDA_ARCHITECTURES@" - # Legacy way of setting CUDA arch cuda_architecture_flags "@VTKm_CUDA_Architecture_Flags@" requires_static_builds TRUE)