FindCUDAToolkit: CUDA::nvToolsExt missing dependency on libdl
NVIDIA's header #include <nvtx3/nvToolsExt.h>
, part of its "NVIDIA Toolkit Extensions" library, requires linking against libdl
on Linux (not sure what it does on Windows). However, the CUDA::nvToolsExt
target created by FindCUDAToolkit does not hang that dependency onto the target it creates, so that merely target_link_library(CUDA::nvToolsExt)
fails to add that link library. The result is a build error:
/usr/bin/ld: main.cpp.o: undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
Please add the missing dependency.
Edited by Brad King