You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Including cub/util_debug.cuh (or any others that use it) from multiple .cpp files causes linking to fail with:
/usr/bin/ld: b.o: in function `cub::CUB_200400___CUDA_ARCH_LIST___NS::Debug(cudaError, char const*, int)':
b.cpp:(.text+0x0): multiple definition of `cub::CUB_200400___CUDA_ARCH_LIST___NS::Debug(cudaError, char const*, int)'; a.o:a.cpp:(.text+0x0): first defined here
This only happens with CUB 2.4.0 from CUDA 12.5.40. CUB 2.3.2 from CUDA 12.4 and older versions work fine.
I am using GCC 11 as the compiler and linker.
How to Reproduce
Create files a.cpp and b.cpp with #include <cub/util_debug.cuh> as their contents.
/usr/bin/ld: b.o: in function `cub::CUB_200400___CUDA_ARCH_LIST___NS::Debug(cudaError, char const*, int)':
b.cpp:(.text+0x0): multiple definition of `cub::CUB_200400___CUDA_ARCH_LIST___NS::Debug(cudaError, char const*, int)'; a.o:a.cpp:(.text+0x0): first defined here
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
Expected behavior
No linker errors.
Reproduction link
No response
Operating System
Ubuntu Linux
nvidia-smi output
No response
NVCC version
No response
The text was updated successfully, but these errors were encountered:
Is this a duplicate?
Type of Bug
Compile-time Error
Component
CUB
Describe the bug
Including
cub/util_debug.cuh
(or any others that use it) from multiple .cpp files causes linking to fail with:This only happens with CUB 2.4.0 from CUDA 12.5.40. CUB 2.3.2 from CUDA 12.4 and older versions work fine.
I am using GCC 11 as the compiler and linker.
How to Reproduce
a.cpp
andb.cpp
with#include <cub/util_debug.cuh>
as their contents.Fails with
Expected behavior
No linker errors.
Reproduction link
No response
Operating System
Ubuntu Linux
nvidia-smi output
No response
NVCC version
No response
The text was updated successfully, but these errors were encountered: