[CMake] FindCUDA ignores project dependencies when separable compilation is on

James Bigler jamesbigler at gmail.com
Mon Jan 5 15:05:49 EST 2015


The only CMake build dependency changes when doing separable compilation
are found in CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS.  Basically what this
does is create a new rule to build an intermediate link file.  For
everything but some versions of MSVC generators it adds a custom command to
generate this intermediate link file.  The other case adds a custom command
that runs as a PRE_LINK command to generate the object file (the reasons
for this is a bug in VS custom command dependency scanning), but this
should happen during link phase and not compile phase.

Nothing in here should change what happens before the target is built,
though.


On Mon, Jan 5, 2015 at 5:32 AM, Irwin Zaid <irwin.zaid at physics.ox.ac.uk>
wrote:

> Just wanted to send this again, as the problem still exists. While working
> on the libdynd project (https://github.com/libdynd/libdynd), we've
> discovered two CUDA CMake issues that we'd like to help resolve.
>
> Who are the right people to speak with about these?
>
> Irwin
>
> Irwin Zaid wrote:
>
>> Hi all,
>>
>> Just wanted to mention this issue I've run into.
>>
>> I have a project (libdynd -- https://github.com/libdynd/libdynd) that
>> uses FindCUDA to deal with CUDA compilation. A part of our library is
>> generated at compile-time, which we handle by the command
>> "add_dependencies(libdynd some_exe)", where "some_exe" is an executable
>> built with a custom command. This part of our library needs to be
>> present before anything else is built.
>>
>> So far, everything has worked great, with and without CUDA. However, I
>> found that by just turning separable compilation on, via
>> set(CUDA_SEPARABLE_COMPILATION ON), the dependency I've added is then
>> ignored and the necessary files are not generated. Basically, CMake goes
>> straight to NVCC without running the custom command.
>>
>> This seems to me to be something wrong with FindCUDA, but it is of
>> course possible that I've done something wrong. Any help would be
>> appreciated!
>>
>> Irwin
>>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150105/0760e035/attachment.html>


More information about the CMake mailing list