From 3181fe00594a16e5e72d334bac46d57b698b52ea Mon Sep 17 00:00:00 2001 From: Jeff Daily Date: Tue, 18 Aug 2026 13:01:49 -0700 Subject: [PATCH] Make rmm build and link on Windows Two changes, both Windows-only in effect. RMM_EXPORT is an ELF visibility attribute under __GNUC__ and empty otherwise, as detail/export.hpp says ("only GLIBC is supported"). The shared library therefore exports nothing when built with clang-cl or MSVC, and consumers fail at link time with undefined references to rmm::cuda_stream_view and friends. WINDOWS_EXPORT_ALL_SYMBOLS makes CMake generate the export table, which is the same set of symbols the visibility attribute yields elsewhere. The property is ignored on other platforms. detail/runtime_capabilities.hpp includes unconditionally and never uses anything from it. The header is not reachable from the six sources that make up the rmm library, so this does not affect that build, but it does break any Windows consumer that includes mr/device/cuda_async_memory_resource.hpp, along with the test suite. Found while building HEonGPU against hipMM on Windows with clang-cl and ROCm 7.14. With the export change and the two matching fixes in rapids-logger, rmm and rapids_logger build and every dependent executable links. Written with assistance from an AI coding agent. --- cpp/CMakeLists.txt | 7 ++++++- cpp/include/rmm/detail/runtime_capabilities.hpp | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index df51896d..fa7eca62 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -175,7 +175,12 @@ set_target_properties( CXX_STANDARD_REQUIRED ON CXX_VISIBILITY_PRESET hidden POSITION_INDEPENDENT_CODE ON - INTERFACE_POSITION_INDEPENDENT_CODE ON) + INTERFACE_POSITION_INDEPENDENT_CODE ON + # RMM_EXPORT is an ELF visibility attribute under __GNUC__ and empty + # otherwise, so a Windows build of this shared library exports nothing + # and every consumer fails to link. Let CMake generate the export + # table there; the property is ignored on other platforms. + WINDOWS_EXPORT_ALL_SYMBOLS ON) target_compile_definitions(rmm PUBLIC LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) # Enable NVTX if necessary diff --git a/cpp/include/rmm/detail/runtime_capabilities.hpp b/cpp/include/rmm/detail/runtime_capabilities.hpp index 40ed5c9e..719a7ed9 100644 --- a/cpp/include/rmm/detail/runtime_capabilities.hpp +++ b/cpp/include/rmm/detail/runtime_capabilities.hpp @@ -44,7 +44,6 @@ #include -#include namespace RMM_NAMESPACE { namespace detail {