From 7cb63b5fdba860dab75b0911d0caab07bc66594c Mon Sep 17 00:00:00 2001 From: Chris Drain Date: Tue, 27 Jan 2026 11:02:41 +1300 Subject: [PATCH] Fix Could NOT find OpenMP_CUDA (missing: OpenMP_CUDA_FLAGS OpenMP_CUDA_LIB_NAMES) This is a fix for https://github.com/llnl/LEAP/issues/124 The solution to the issue originally was to stay on a specific cmake version. That's inconvenient. This fixes the problem so that newer versions of cmake work correctly. It is based on the discussion and solution found at https://github.com/NVIDIA/cuda-samples/issues/333. I've tested it with cmake 4.2 and CUDA Toolkit 12.9 on Windows, but that thread indicates it resolves the problem in 3.31, 4.0 and 4.1 (on arch linux). --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e2a41e..b793749 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,7 +12,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(CUDA 11.7 REQUIRED) -find_package(OpenMP REQUIRED) +find_package(OpenMP REQUIRED CXX) #set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}; -O3) set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}; -D__INCLUDE_CUFFT) add_compile_options(-D__INCLUDE_CUFFT)