Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch nvbench to allow usage of external fmt #373

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions rapids-cmake/cpm/patches/nvbench/use_existing_fmt.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/cmake/NVBenchDependencies.cmake b/cmake/NVBenchDependencies.cmake
index d0daa90..c058cbc 100644
--- a/cmake/NVBenchDependencies.cmake
+++ b/cmake/NVBenchDependencies.cmake
@@ -1,6 +1,7 @@
################################################################################
# fmtlib/fmt
rapids_cpm_find(fmt 9.1.0
+ GLOBAL_TARGETS fmt fmt::fmt
CPM_ARGS
GITHUB_REPOSITORY fmtlib/fmt
GIT_TAG 9.1.0
9 changes: 8 additions & 1 deletion rapids-cmake/cpm/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@
"version" : "0.0",
"git_shallow" : false,
"git_url" : "https://github.com/NVIDIA/nvbench.git",
"git_tag" : "e477bb386289a11ad8d7e358cff6527cfc593974"
"git_tag" : "e477bb386289a11ad8d7e358cff6527cfc593974",
"patches" : [
{
"file" : "nvbench/use_existing_fmt.diff",
"issue" : "Fix add support for using an existing fmt [https://github.com/NVIDIA/nvbench/pull/125]",
"fixed_in" : ""
}
]
},
"nvcomp" : {
"version" : "2.6.1",
Expand Down
1 change: 1 addition & 0 deletions testing/cpm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ add_cmake_config_test( cpm_libcudacxx-simple.cmake )

add_cmake_config_test( cpm_nvbench-export.cmake )
add_cmake_config_test( cpm_nvbench-simple.cmake )
add_cmake_config_test( cpm_nvbench-already-found-fmt.cmake )

add_cmake_config_test( cpm_nvcomp-export.cmake )
add_cmake_config_test( cpm_nvcomp-proprietary-off.cmake )
Expand Down
26 changes: 26 additions & 0 deletions testing/cpm/cpm_nvbench-already-found-fmt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/nvbench.cmake)

# Fake bring in fmt via find package
add_library(fmt::fmt INTERFACE IMPORTED GLOBAL)

rapids_cpm_init()
rapids_cpm_nvbench()
if(fmt_ADDED)
message(FATAL_ERROR "fmt shouldn't be added if it exists via `find_package`")
endif()