From 1b7722d771f07a640998ea0e5d4a3ff98de6d881 Mon Sep 17 00:00:00 2001 From: Wayne Franz Date: Fri, 31 Oct 2025 14:16:07 -0400 Subject: [PATCH] Add minimum version in find_package call for Google Benchmark In the rocPRIM and hipCUB cmake dependencies files, no minimum Google Benchmark version is specified in the call to find_package. This can cause CMake to grab an incompatible version of the library, causing the build to fail. This change adds a minimum version. I've set it to the version that's downloaded when the library isn't present. --- projects/hipcub/cmake/Dependencies.cmake | 3 ++- projects/rocprim/cmake/Dependencies.cmake | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/hipcub/cmake/Dependencies.cmake b/projects/hipcub/cmake/Dependencies.cmake index 36a5310c422..2cdbe0e4c95 100644 --- a/projects/hipcub/cmake/Dependencies.cmake +++ b/projects/hipcub/cmake/Dependencies.cmake @@ -336,6 +336,7 @@ if(USER_BUILD_TEST) endif(USER_BUILD_TEST) if(USER_BUILD_BENCHMARK) + set(BENCHMARK_VERSION 1.8.0) if(NOT EXTERNAL_DEPS_FORCE_DOWNLOAD) find_package(benchmark CONFIG QUIET) endif() @@ -346,7 +347,7 @@ if(USER_BUILD_BENCHMARK) FetchContent_Declare( googlebench GIT_REPOSITORY https://github.com/google/benchmark.git - GIT_TAG v1.8.0 + GIT_TAG v${BENCHMARK_VERSION} ) FetchContent_MakeAvailable(googlebench) if(NOT TARGET benchmark::benchmark) diff --git a/projects/rocprim/cmake/Dependencies.cmake b/projects/rocprim/cmake/Dependencies.cmake index 885e1f6953c..3ee02289300 100644 --- a/projects/rocprim/cmake/Dependencies.cmake +++ b/projects/rocprim/cmake/Dependencies.cmake @@ -120,8 +120,9 @@ if(BUILD_TEST) endif(BUILD_TEST) if(BUILD_BENCHMARK) + set(BENCHMARK_VERSION 1.8.0) if(NOT DEPENDENCIES_FORCE_DOWNLOAD) - find_package(benchmark CONFIG QUIET) + find_package(benchmark ${BENCHMARK_VERSION} CONFIG QUIET) endif() if(NOT TARGET benchmark::benchmark) message(STATUS "Google Benchmark not found. Fetching...") @@ -130,7 +131,7 @@ if(BUILD_BENCHMARK) FetchContent_Declare( googlebench GIT_REPOSITORY https://github.com/google/benchmark.git - GIT_TAG v1.8.0 + GIT_TAG v${BENCHMARK_VERSION} ) set(HAVE_STD_REGEX ON) set(RUN_HAVE_STD_REGEX 1)