[Rtk-users] CUDA library linking issues with CMake

Edmunds, David Michael DMEDMUNDS at mgh.harvard.edu
Fri Apr 7 17:34:09 CEST 2017


Hi all,

This is my first post. I am really enjoying the RTK library so far!

I have a question about including RTK in my own project using CMake. I include it in my own CMakeLists.txt file using:

find_package(RTK)
include(${RTK_USE_FILE})

Then later:

target_link_libraries(MyExecutable ${RTK_LIBRARIES} ${SOME_OTHER_LIBRARIES})

The problem is, ${RTK_LIBRARIES} includes a reference to cudart.lib, the non-static version of the CUDA RT. This happens regardless of whether CUDA_USE_STATIC_CUDA_RUNTIME is checked or unchecked when I configure RTK.
The other libraries I depend on include references to cudart_static.lib, the static version of the CUDA RT. This leads to multiple definition errors at link time in my project, since symbols are present in both cudart.lib and cudart_static.lib. I can resolve this problem by removing cudart.lib from ${RTK_LIBRARIES} manually in my CMakeLists.txt, but this seems like a hack.

Is this a problem with the RTK CMake files, or am I making some other mistake? Thanks for your help,

Dave




The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20170407/7a4305c3/attachment.htm>


More information about the Rtk-users mailing list