From 69a45b632e7250a9f8f8c45efeef456085c23139 Mon Sep 17 00:00:00 2001 From: Tobias Meyer Andersen Date: Wed, 8 May 2024 14:09:26 +0200 Subject: [PATCH] lower cmake version, keep it for HIP --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72da05344..dfd42c428 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ # Mandatory call to project -cmake_minimum_required (VERSION 3.21) +cmake_minimum_required (VERSION 3.10) project(opm-simulators C CXX) @@ -35,7 +35,8 @@ option(USE_BDA_BRIDGE "Enable the BDA bridge (GPU/AMGCL solvers)" ON) option(USE_TRACY_PROFILER "Enable tracy profiling" OFF) option(CONVERT_CUDA_TO_HIP "Convert CUDA code to HIP (to run on AMD cards)" OFF) -if (CONVERT_CUDA_TO_HIP) +# HIP requires cmake version 3.21 +if (CONVERT_CUDA_TO_HIP AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.21") enable_language(HIP) message("CUDA code will be hipified") set(HAVE_CUDA 1) # we still need this defined so that the preprocessor does not remove the code