<div dir="ltr">Hi Robert<div><br></div><div>   I will put a minimal case together using one of the CUDA samples and sent it through for testing with the new cmake support.</div><div><br></div><div>   On your second point, CUDA_CUBLAS_LIBRARIES should be empty if no cublas libraries are present so that use case should be automatically handled unless I am missing something.</div><div><br></div><div>   I will create a fork and topic branch with the change and submit it for review.</div><div><br></div><div> Thanks</div><div><br></div><div>  Jamil<br><br><div class="gmail_quote"><div dir="ltr">On Fri, 3 Nov 2017 at 18:08 Robert Maynard <<a href="mailto:robert.maynard@kitware.com">robert.maynard@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">HI Jamil,<div><br></div><div>If you are interested in submitting a fix I can review, but I would like to also make sure that this issue doesn't exist inside the new cmake support for CUDA as a first class language. Can you produce a minimal test case that we can rework to use the new support and add to CMake's test suite.</div><div><br></div><div>You will also need to track down what version of CUDA first added <span style="font-size:12.8px">cublas_device so that we properly guard the inclusion.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 3, 2017 at 7:39 AM, Jamil Appa <span dir="ltr"><<a href="mailto:jamil.appa@zenotech.com" target="_blank">jamil.appa@zenotech.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Robert<div><br></div><div>  I am using CUDA_ADD_CUBLAS_TO_TARGET but the error happens during the prelink phase when using separable compilation. (nvcc -dlink phase) </div><div><br></div><div>   My guess is that Nvidia have not included cublas_device.a in their dlink phase as you don't have to provide any other libraries. I have asked the Nvidia team if that is the case, but no reply yet.</div><div><br></div><div>   The general fix seems to be to modify lines 1759/1772 of FindCUDA.cmake (in gitlab master) to include CUBLAS_LIBRARIES</div><div><br></div><div> COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} ${CUDA_CUBLAS_LIBRARIES} -o ${output_file}</div><div><br></div><div> This will have no impact if the cublas symbols are not used in the object files.</div><div><br></div><div>  If you are happy with this I can submit the change for review.</div><span class="m_6221475157359862692HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="m_6221475157359862692HOEnZb"><font color="#888888"> Jamil</font></span><div><div class="m_6221475157359862692h5"><br><div><br><div class="gmail_quote"><div dir="ltr">On Thu, 2 Nov 2017 at 13:53 Robert Maynard <<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Have you tried using the 'CUDA_ADD_CUBLAS_TO_TARGET' command on the target that has FindCUDA separable compilation enabled?</div></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Wed, Nov 1, 2017 at 11:16 AM, Jamil Appa <span dir="ltr"><<a href="mailto:jamil.appa@zenotech.com" target="_blank">jamil.appa@zenotech.com</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi <div><br></div><div>   When using FindCUDA with separable compilation combined with device code that uses cublas_device I get missing symbols when linking the intermediate file at line <a class="m_6221475157359862692m_-2454112459134246165m_3909114914720412354m_-2983343933963725884inbox-inbox-diff-line-num" href="https://gitlab.kitware.com/cmake/cmake/blob/release/Modules/FindCUDA.cmake#L1758" id="m_6221475157359862692m_-2454112459134246165m_3909114914720412354m_-2983343933963725884inbox-inbox-L1758" style="box-sizing:border-box;background-color:rgb(250,250,250);color:rgba(0,0,0,0.3);text-decoration-line:none;border-color:rgb(240,240,240);font-family:Menlo,"DejaVu Sans Mono","Liberation Mono",Consolas,"Ubuntu Mono","Courier New","andale mono","lucida console",monospace;display:inline!important;min-height:19px;white-space:nowrap;text-align:right;font-size:12px" target="_blank">1758</a> FindCUDA.cmake</div><div><br></div><div>   If I  change line 1758 to include the cublas_device library the symbols are resolved correctly.</div><div><br></div><div>   COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} -lcublas_device</div><div><br></div><div>   Is there a way to pass through a library to the CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS function that I am missing?</div><div><br></div><div>   Thanks</div><div><br></div><div> Jamil</div><div><div class="m_6221475157359862692m_-2454112459134246165m_3909114914720412354m_-2983343933963725884GmSign"><div dir="ltr"><br><table border="0" width="500" cellspacing="0" cellpadding="0" style="border-collapse:collapse;font-family:helvetica,arial;color:rgb(107,97,96);width:500px;margin:0px;padding:0px"><tbody><tr><td colspan="3" width="500" style="border-collapse:collapse;font-family:helvetica,arial;padding-bottom:10px;padding-left:10px;width:500px;font-size:13px"><strong>Jamil Appa</strong> | Co-Founder and Director | Zenotech</td></tr><tr style="background-color:rgb(243,243,243)"><td colspan="3" width="500" style="border-collapse:collapse;font-family:helvetica,arial"><img src="https://sites.google.com/a/zenotech.com/external/papercut-top.jpg" width="500px" height="14px" alt="Papercut" title="Papercut" border="0"></td></tr><tr style="background-color:rgb(243,243,243)"><td colspan="1" width="30" height="30" style="border-collapse:collapse;font-family:helvetica,arial;padding-right:10px;padding-left:10px"><img src="https://sites.google.com/a/zenotech.com/external/tel.jpg" width="20px" height="20px" alt="Tel:" title="Tel:" border="0" style="vertical-align:middle"></td><td width="280" style="border-collapse:collapse;font-family:helvetica,arial;font-size:12px"><a href="tel:+44%207747%20606788" value="+447747606788" target="_blank">+44 (0)7747 606 788</a></td><td rowspan="3" style="border-collapse:collapse;font-family:helvetica,arial"><a href="http://www.zenotech.com/" target="_blank"><img src="https://sites.google.com/a/zenotech.com/external/logo.jpg" alt="Zenotech LTD - Simulation Unlimited" title="Zenotech LTD - Simulation Unlimited" border="0"></a></td></tr><tr style="background-color:rgb(243,243,243)"><td width="30" height="30" style="border-collapse:collapse;font-family:helvetica,arial;padding-right:10px;padding-left:10px"><img src="https://sites.google.com/a/zenotech.com/external/email.jpg" width="20px" height="20px" alt="Email:" title="Email:" border="0" style="vertical-align:middle"></td><td width="280" style="border-collapse:collapse;font-family:helvetica,arial;font-size:12px"><a href="mailto:jamil.appa@zenotech.com" style="color:rgb(107,97,96);text-decoration:none" target="_blank">jamil.appa@zenotech.com</a></td></tr><tr style="background-color:rgb(243,243,243)"><td width="30" height="30" style="border-collapse:collapse;font-family:helvetica,arial;padding-right:10px;padding-left:10px"><img src="https://sites.google.com/a/zenotech.com/external/web.jpg" width="20px" height="20px" alt="Web:" title="Web:" border="0" style="vertical-align:middle"></td><td width="280" style="border-collapse:collapse;font-family:helvetica,arial;font-size:12px"><a href="http://www.zenotech.com/" style="color:rgb(107,97,96);text-decoration:none" target="_blank">www.zenotech.com</a></td></tr><tr style="background-color:rgb(243,243,243)"><td colspan="3" width="500" style="border-collapse:collapse;font-family:helvetica,arial"><img src="https://sites.google.com/a/zenotech.com/external/papercut-bottom.jpg" width="500px" height="14px" alt="Papercut" title="Papercut" border="0" style="vertical-align:bottom"></td></tr></tbody></table><table border="0" width="500" cellspacing="0" cellpadding="0" style="border-collapse:collapse;font-family:helvetica,arial;color:rgb(107,97,96);width:500px;margin:0px;padding:0px"><tbody><tr><td rowspan="3" width="85" height="20" style="border-collapse:collapse;font-family:helvetica,arial;padding-right:10px;padding-left:10px"><a href="http://uk.linkedin.com/pub/jamil-appa/1/165/120" target="_blank"><img src="https://sites.google.com/a/zenotech.com/external/linkedin.jpg" width="20px" height="20px" alt="linkedin:" title="linkedin:" border="0" style="padding-right:6px"></a><a href="https://twitter.com/zenotech" target="_blank"><img src="https://sites.google.com/a/zenotech.com/external/twitter.jpg" width="20px" height="20px" alt="Twitter:" title="Twitter:" border="0" style="padding-right:6px"></a><a href="https://www.google.co.uk/maps/place/Bristol+%26+Bath+Science+Park/@51.500921,-2.478567,17z/data=!3m1!4b1!4m2!3m1!1s0x48719ab86a5a9f7d:0xd17394f3400abb0a" target="_blank"><img src="https://sites.google.com/a/zenotech.com/external/location.jpg" width="20px" height="20px" alt="Location:" title="Location:" border="0"></a></td><td colspan="2" width="400" height="20" style="border-collapse:collapse;font-family:helvetica,arial;font-size:10px;padding-top:10px"><p style="line-height:7px">Company Registration No : <span>07926926</span> | VAT No : <span>128198591</span></p><p style="line-height:7px">Registered Office : <span><a href="https://maps.google.com/?q=1+Larkfield+Grove,+Chepstow,+Monmouthshire,+NP16+5UF,+UK&entry=gmail&source=g" target="_blank">1 Larkfield Grove, Chepstow, Monmouthshire, NP16 5UF, UK</a></span></p><p style="line-height:7px">Address : Bristol & Bath Science Park, Dirac Cres, Emersons Green, Bristol BS16 7FR</p><div><br></div></td></tr></tbody></table></div></div></div></div>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>
</blockquote></div></div></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div></div></div>