From 16863c35e111a1f00c62a6a10f65c3ae9fa27722 Mon Sep 17 00:00:00 2001 From: Brian Manh Hien Han Date: Mon, 18 Mar 2024 07:47:51 -0700 Subject: [PATCH 1/3] Increase minimum required cmake, remove mpi hack for using with cmake example --- src/examples/using-with-cmake/CMakeLists.txt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/examples/using-with-cmake/CMakeLists.txt b/src/examples/using-with-cmake/CMakeLists.txt index 14142882f0..40a893d6f6 100644 --- a/src/examples/using-with-cmake/CMakeLists.txt +++ b/src/examples/using-with-cmake/CMakeLists.txt @@ -20,7 +20,7 @@ # #------------------------------------------------------------------------------ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.18) project(using_with_cmake) @@ -70,14 +70,6 @@ if(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE) ${BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE}) endif() -# HACK: Define the `mpi` target as an alias to `axom::mpi` if/when necessary -# Details: An axom dependency has a link dependency to `mpi`, but it might -# not be a target. Need to mark axom::mpi as global to use it for an alias. -if(NOT TARGET mpi AND TARGET axom::mpi) - set_target_properties(axom::mpi PROPERTIES IMPORTED_GLOBAL TRUE) - add_library(mpi ALIAS axom::mpi) -endif() - #------------------------------------------------------------------------------ # Set up example target that depends on axom #------------------------------------------------------------------------------ From 05a04f088bf51c5a951be8c1afea528da60173ac Mon Sep 17 00:00:00 2001 From: Brian Manh Hien Han Date: Mon, 18 Mar 2024 11:31:50 -0700 Subject: [PATCH 2/3] Bump cmake version --- src/examples/using-with-cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/examples/using-with-cmake/CMakeLists.txt b/src/examples/using-with-cmake/CMakeLists.txt index 40a893d6f6..e9b19d7f31 100644 --- a/src/examples/using-with-cmake/CMakeLists.txt +++ b/src/examples/using-with-cmake/CMakeLists.txt @@ -20,7 +20,7 @@ # #------------------------------------------------------------------------------ -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.20) project(using_with_cmake) From abdeab05a4859427adcce86e894e2f2583987f21 Mon Sep 17 00:00:00 2001 From: Brian Manh Hien Han Date: Mon, 18 Mar 2024 13:28:08 -0700 Subject: [PATCH 3/3] Make 3.21 the minimum requirement for CUDA/HIP, 3.18 otherwise for example --- .gitlab/build_rzansel.yml | 2 +- src/examples/using-with-cmake/CMakeLists.txt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab/build_rzansel.yml b/.gitlab/build_rzansel.yml index 37ad6b482b..390c387dbe 100644 --- a/.gitlab/build_rzansel.yml +++ b/.gitlab/build_rzansel.yml @@ -12,7 +12,7 @@ - rzansel before_script: - module load cuda/11.2.0 - - module load cmake/3.18.0 + - module load cmake/3.21.1 #### # Template diff --git a/src/examples/using-with-cmake/CMakeLists.txt b/src/examples/using-with-cmake/CMakeLists.txt index e9b19d7f31..63eeca1150 100644 --- a/src/examples/using-with-cmake/CMakeLists.txt +++ b/src/examples/using-with-cmake/CMakeLists.txt @@ -20,7 +20,11 @@ # #------------------------------------------------------------------------------ -cmake_minimum_required(VERSION 3.20) +if (ENABLE_HIP OR AXOM_ENABLE_HIP OR ENABLE_CUDA OR AXOM_ENABLE_CUDA) + cmake_minimum_required(VERSION 3.21) +else() + cmake_minimum_required(VERSION 3.18) +endif() project(using_with_cmake)