Windows CUDART link #354
Labels
is:help-wanted
Need ideas on how to solve this.
mod:cuda
This is related to the CUDA module.
plat:windows
This is related to the Windows Operating system
In #351 , how do we link cudart in Windows?
We set
CUDA_RUNTIME_LIBS
as the cudart shared libraries, but nvcc will use -cudart=static as its default.It works fine in Linux, but it can not be resolved in Windows.
The problem is in
benchmark/spmv
which links to static and shared library.The following are workaround solutions
benchmark/spmv
in Windowsginkgo/benchmark/spmv/CMakeLists.txt
Lines 5 to 9 in a983181
-cudart=shared
in Windows.cudart_static needs rt, dl, and pthread, so it needs to add them into the libraries.
ginkgo/cuda/CMakeLists.txt
Lines 45 to 55 in 01ee57c
ginkgo/benchmark/spmv/CMakeLists.txt
Lines 5 to 9 in 01ee57c
it seems to be failed withThreads::Threads
but successful with-pthread
.I prefer to choose 2 or 3
I think
option 1
is weird.option 2 does not change too many things in CMake, but it maybe reduces usability in Windows.
option 3 works fine but
benchmark/spmv
needs to include threads to useThreads::threads
correctly.Which option do you think better way? Alternatively, is there any idea to solve this problem?
edit:
delete the fail with
Threads::Threads
The text was updated successfully, but these errors were encountered: