From 24042400eef4a9880b019950cd9c92ed5bb89e79 Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Wed, 2 Feb 2022 14:02:07 -0500 Subject: [PATCH 1/3] Add CMake `install` rules for tests This PR adds a CMake `install` rule for test and benchmark targets. This step is a prerequisite to being able to package tests/benchmarks in their own `conda` package, which will enable us to deprecate _Project Flash_. --- benchmarks/CMakeLists.txt | 7 ++++++- tests/CMakeLists.txt | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 9f7a0d304..fc5db73eb 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -32,7 +32,8 @@ function(ConfigureBench BENCH_NAME) ${BENCH_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON RUNTIME_OUTPUT_DIRECTORY "$" - CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}") + CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}" + INSTALL_RPATH "\$ORIGIN/../lib") target_link_libraries(${BENCH_NAME} benchmark::benchmark pthread rmm) target_compile_definitions(${BENCH_NAME} PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}") @@ -55,6 +56,10 @@ function(ConfigureBench BENCH_NAME) PUBLIC $<$:-Wno-deprecated-declarations>) endif() + install( + TARGETS ${BENCH_NAME} + COMPONENT testing + EXCLUDE_FROM_ALL) endfunction(ConfigureBench) # random allocations benchmark diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1a8ca6cb8..bd538bfcd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -27,7 +27,8 @@ function(ConfigureTestInternal TEST_NAME) ${TEST_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON RUNTIME_OUTPUT_DIRECTORY "$" - CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}") + CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}" + INSTALL_RPATH "\$ORIGIN/../lib") target_compile_definitions(${TEST_NAME} PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}") if(DEFINED CUDA_MALLOC_ASYNC_SUPPORT AND NOT CUDA_MALLOC_ASYNC_SUPPORT) @@ -71,6 +72,11 @@ function(ConfigureTestInternal TEST_NAME) endif() add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME}) + + install( + TARGETS ${TEST_NAME} + COMPONENT testing + EXCLUDE_FROM_ALL) endfunction() # Wrapper around `ConfigureTestInternal` that builds tests both with and without per thread default From a54a66419728c4812b0dc60dfb132133f916944b Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Fri, 4 Feb 2022 12:00:13 -0500 Subject: [PATCH 2/3] add install DESTINATION --- benchmarks/CMakeLists.txt | 1 + tests/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index fc5db73eb..02c728b1d 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -59,6 +59,7 @@ function(ConfigureBench BENCH_NAME) install( TARGETS ${BENCH_NAME} COMPONENT testing + DESTINATION bin/benchmarks/librmm EXCLUDE_FROM_ALL) endfunction(ConfigureBench) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bd538bfcd..8c21cbd58 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -76,6 +76,7 @@ function(ConfigureTestInternal TEST_NAME) install( TARGETS ${TEST_NAME} COMPONENT testing + DESTINATION bin/gtests/librmm EXCLUDE_FROM_ALL) endfunction() From db85bcfe2fbfe56c84d73912dd7bd277ae4f9046 Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Fri, 4 Feb 2022 12:26:44 -0500 Subject: [PATCH 3/3] update RPATH to account for new DESTINATION --- benchmarks/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 02c728b1d..61e420638 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -33,7 +33,7 @@ function(ConfigureBench BENCH_NAME) PROPERTIES POSITION_INDEPENDENT_CODE ON RUNTIME_OUTPUT_DIRECTORY "$" CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}" - INSTALL_RPATH "\$ORIGIN/../lib") + INSTALL_RPATH "\$ORIGIN/../../../lib") target_link_libraries(${BENCH_NAME} benchmark::benchmark pthread rmm) target_compile_definitions(${BENCH_NAME} PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8c21cbd58..69fbfb6aa 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -28,7 +28,7 @@ function(ConfigureTestInternal TEST_NAME) PROPERTIES POSITION_INDEPENDENT_CODE ON RUNTIME_OUTPUT_DIRECTORY "$" CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}" - INSTALL_RPATH "\$ORIGIN/../lib") + INSTALL_RPATH "\$ORIGIN/../../../lib") target_compile_definitions(${TEST_NAME} PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}") if(DEFINED CUDA_MALLOC_ASYNC_SUPPORT AND NOT CUDA_MALLOC_ASYNC_SUPPORT)