From b9ddf60306de7979ff42e5015b5eff70e28cdbed Mon Sep 17 00:00:00 2001 From: scivision Date: Wed, 31 Jul 2024 18:37:39 -0400 Subject: [PATCH] cmake >= 3.20 tested in CI --- .github/workflows/ci.yml | 4 ++-- .github/workflows/composite-cmake/action.yml | 14 ++++++++++---- CMakeLists.txt | 2 +- cmake/FindSCALAPACK.cmake | 2 +- example/CMakeLists.txt | 2 +- example/metis/CMakeLists.txt | 2 +- example/scotch/CMakeLists.txt | 2 +- scripts/CMakeLists.txt | 4 ++-- scripts/build_metis.cmake | 2 +- scripts/build_scotch.cmake | 2 +- 10 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4792b28..b581f0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,10 +65,10 @@ jobs: uses: ./.github/workflows/composite-example - cmake-320: + cmake-older: timeout-minutes: 30 - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/composite-cmake/action.yml b/.github/workflows/composite-cmake/action.yml index 02031fa..af67e35 100644 --- a/.github/workflows/composite-cmake/action.yml +++ b/.github/workflows/composite-cmake/action.yml @@ -3,17 +3,23 @@ runs: using: "composite" steps: + - name: environment + shell: bash + run: | + echo "osarch=linux-x86_64" >> $GITHUB_ENV + echo "archive=linux-x86_64.tar.gz" >> $GITHUB_ENV + - name: Install CMake ${{ matrix.cmake_version }} shell: bash run: | - curl -LO "https://github.com/Kitware/CMake/releases/download/v${{ matrix.cmake_version }}/cmake-${{ matrix.cmake_version }}-linux-x86_64.tar.gz" - tar -xf cmake-${{ matrix.cmake_version }}-linux-x86_64.tar.gz + curl -LO "https://github.com/Kitware/CMake/releases/download/v${{ matrix.cmake_version }}/cmake-${{ matrix.cmake_version }}-$archive" + tar -xf cmake-${{ matrix.cmake_version }}-$archive - name: CMake path shell: bash run: | - echo "CMAKE=$GITHUB_WORKSPACE/cmake-${{ matrix.cmake_version }}-linux-x86_64/bin/cmake" >> $GITHUB_ENV - echo "CTEST=$GITHUB_WORKSPACE/cmake-${{ matrix.cmake_version }}-linux-x86_64/bin/ctest" >> $GITHUB_ENV + echo "CMAKE=$GITHUB_WORKSPACE/cmake-${{ matrix.cmake_version }}-$osarch/bin/cmake" >> $GITHUB_ENV + echo "CTEST=$GITHUB_WORKSPACE/cmake-${{ matrix.cmake_version }}-$osarch/bin/ctest" >> $GITHUB_ENV - name: echo CMake version shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index a2abaf6..483a0b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.19...3.30) +cmake_minimum_required(VERSION 3.20...3.30) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) message(FATAL_ERROR "Please use out of source build: diff --git a/cmake/FindSCALAPACK.cmake b/cmake/FindSCALAPACK.cmake index f8c4cdc..9b2e056 100644 --- a/cmake/FindSCALAPACK.cmake +++ b/cmake/FindSCALAPACK.cmake @@ -174,7 +174,7 @@ DOC "SCALAPACK library" # some systems have libblacs as a separate file, instead of being subsumed in libscalapack. if(NOT DEFINED BLACS_ROOT) - get_filename_component(BLACS_ROOT ${SCALAPACK_LIBRARY} DIRECTORY) + cmake_path(GET SCALAPACK_LIBRARY PARENT_PATH BLACS_ROOT) endif() find_library(BLACS_LIBRARY diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 3d4102e..77cb70d 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -52,7 +52,7 @@ endif() if(WIN32) get_property(imp_mumps TARGET MUMPS::COMMON PROPERTY IMPORTED_LOCATION_RELEASE) if(imp_mumps) - get_filename_component(imp_mumps_dir ${imp_mumps} DIRECTORY) + cmake_path(GET imp_mumps PARENT_PATH imp_mumps_dir) endif() set_property(TEST ${test_names} PROPERTY ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${imp_mumps_dir};PATH=path_list_prepend:${CMAKE_PREFIX_PATH}/bin" diff --git a/example/metis/CMakeLists.txt b/example/metis/CMakeLists.txt index d6b8a7e..5a5b9d0 100644 --- a/example/metis/CMakeLists.txt +++ b/example/metis/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.20) project(MUMPSmetisExamples LANGUAGES C Fortran diff --git a/example/scotch/CMakeLists.txt b/example/scotch/CMakeLists.txt index 663c62e..07a8757 100644 --- a/example/scotch/CMakeLists.txt +++ b/example/scotch/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.20) project(MUMPSscotchExamples LANGUAGES C Fortran diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 85e4479..5713b3b 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.20) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) message(FATAL_ERROR "please use out of source build @@ -105,7 +105,7 @@ if(NOT bison) endif() message(STATUS "Bison found: ${bison}") -get_filename_component(bison_root ${bison} DIRECTORY) +cmake_path(GET bison PARENT_PATH bison_root) set(BISON_ROOT ${bison_root} PARENT_SCOPE) diff --git a/scripts/build_metis.cmake b/scripts/build_metis.cmake index ac59472..9197426 100644 --- a/scripts/build_metis.cmake +++ b/scripts/build_metis.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.20) option(intsize64 "use 64-bit integers in C and Fortran--METIS must be consistent with MUMPS") diff --git a/scripts/build_scotch.cmake b/scripts/build_scotch.cmake index 6533653..2a63248 100644 --- a/scripts/build_scotch.cmake +++ b/scripts/build_scotch.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.20) option(intsize64 "use 64-bit integers in C and Fortran--Scotch must be consistent with MUMPS")