<div dir="ltr"><div><div>Hi,<br></div>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?<br></div>Simon<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 7, 2017 at 5:34 PM, Edmunds, David Michael <span dir="ltr"><<a href="mailto:DMEDMUNDS@mgh.harvard.edu" target="_blank">DMEDMUNDS@mgh.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="#0563C1" vlink="#954F72" lang="EN-US">
<div class="m_9166015604850876498WordSection1">
<p class="MsoNormal">Hi all,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">This is my first post. I am really enjoying the RTK library so far!<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have a question about including RTK in my own project using CMake. I include it in my own CMakeLists.txt file using:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">find_package(RTK)<u></u><u></u></p>
<p class="MsoNormal">include(${RTK_USE_FILE})<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Then later:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">target_link_libraries(<wbr>MyExecutable ${RTK_LIBRARIES} ${SOME_OTHER_LIBRARIES})<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.
<u></u><u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is this a problem with the RTK CMake files, or am I making some other mistake? Thanks for your help,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Dave <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p></p>

<p>The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/<wbr>complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.</p></div>

<br>______________________________<wbr>_________________<br>
Rtk-users mailing list<br>
<a href="mailto:Rtk-users@public.kitware.com">Rtk-users@public.kitware.com</a><br>
<a href="http://public.kitware.com/mailman/listinfo/rtk-users" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/rtk-users</a><br>
<br></blockquote></div><br></div>