-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Labels
Milestone
Description
Description: When PopSift is integrated into another project via add_subdirectory() and built as a static library (BUILD_SHARED_LIBS=OFF), the linker fails with the following errors:
popsift.lib(sift_conf.obj) : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_... referenced in function "void __cdecl __sti____cudaRegisterAll(void)"
popsift.lib(popsift.obj) : error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary_... referenced in function "void __cdecl __sti____cudaRegisterAll(void)"
...
Cause: The root cause seems to be the hardcoded set(CMAKE_CUDA_SEPARABLE_COMPILATION ON) in the main CMakeLists.txt (line 114).
When RDC (Relocatable Device Code) is enabled for a static library, the host project (the executable) is responsible for the final device linking stage. However, most host projects do not enable RDC by default, leading to these unresolved symbols.
Environment:
- OS: Windows 10
- Compiler: MSVC 14.38.33130
- CUDA: 11.3.58
- CMake: 3.31.0