[Rtk-users] CUDA library linking issues with CMake

Simon Rit simon.rit at creatis.insa-lyon.fr
Sun Apr 9 04:27:22 EDT 2017


Hi,
Welcome! It's very likely that there is a problem with the RTK cmake files
but I wouldn't know how to correct them. Maybe you can check in the other
libraries you use how they deal with this. Currently, when CUDA is used, we
always link RTK to the library defined by the cmake variable
${CUDA_CUDART_LIBRARY}. Maybe this is no the correct way of doing it?
Simon

On Fri, Apr 7, 2017 at 5:34 PM, Edmunds, David Michael <
DMEDMUNDS at mgh.harvard.edu> wrote:

> 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.
>
> _______________________________________________
> Rtk-users mailing list
> Rtk-users at public.kitware.com
> http://public.kitware.com/mailman/listinfo/rtk-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20170409/4cb07cf9/attachment.html>


More information about the Rtk-users mailing list