[CMake] Does enable_language(CUDA) still have the problem with reconfiguring?

JR Cary cary at txcorp.com
Sat Mar 30 16:07:25 EDT 2019


Re the thread below,

Does the newer, enable_languagedo a better job of not having the
repeated reconfigurations and full project rebuilds as described at

https://cmake.org/pipermail/cmake/2011-January/042173.html

and many times after?

John



On 3/30/19 6:45 AM, cmake-request at cmake.org wrote:
> -----------------------------
> Message: 4
> Date: Sat, 30 Mar 2019 12:45:07 +0000
> From: Luis Caro Campos <julius.caro at gmail.com>
>
> I believe the closest equivalent to settinga CUDA_TOOLKIT_ROOT_DIR when
> using enable_language(CUDA) is to set either the environment variable
> CUDACXX or the CMake cache entry CMAKE_CUDA_COMPILER to point to the
> location of the nvcc compiler.
>
> However I think there are still some "features" of FindCUDA that
> enable_language don't support, e.g. variables and/or import targets with
> locations, see https://gitlab.kitware.com/cmake/cmake/issues/17816
>
> Kind regards,
> Luis
>
> On Fri, Mar 29, 2019 at 4:57 PM Dustyn Blasig <dustyn at blasig.us> wrote:
>
>> "we should not try to combine enable_language(CUDA) with
>> find_package(CUDA). They do not work together, either use one or another."
>>
>> Absolutely, my goal is to move to the new built-in language support. I'm
>> having trouble doing that because I can't find any documentation on it. For
>> instance, what is the new equivalent CUDA_TOOLKIT_ROOT_DIR? Without
>> find_package(CUDA), I don't see anything set that have the equivalent.
>> Also, in some cases the CUDA include directory is added to targets, and in
>> other cases it isn't, even if the target depends on source with .cu. What
>> is the documented behavior for this?
>>
>> I'm sure there has to be a page somewhere on this, but going to page 4 on
>> Google search didn't uncover anything, and the first 2 pages all point to
>> various versions of FindCUDA : )
>>
>> On Fri, Mar 29, 2019 at 11:28 AM Dmitry Mikushin <
>> dmitry at parallel-computing.pro> wrote:
>>
>>> Hi,
>>>
>>> That was my confusion as well: to my understanding, we should not try to
>>> combine enable_language(CUDA) with find_package(CUDA). They do not work
>>> together, either use one or another.
>>>
>>> Kind regards,
>>> - Dmitry.
>>>
>>> ??, 29 ???. 2019 ?. ? 19:58, Dustyn Blasig <dustyn at blasig.us>:
>>>
>>>> Hi All,
>>>>
>>>> I can't find any documentation on the new-ish "native" CUDA support. I
>>>> need to know all the variables that we can use, and (for instance) whether
>>>> checking the CUDA version is now supported. When searching online, I'm
>>>> always directed to the old FindCUDA pages which don't seem to match what is
>>>> available with the native language support.
>>>>
>>>> Currently, I'm "hacking" my way through things by using both flows. I
>>>> add CUDA as a language, use the found CUDA compiler to construct a
>>>> CUDA_TOOLKIT_ROOT_DIR and then call find_package(CUDA) to get the old
>>>> environment variables set up.
>>>>
>>>> Cheers!
>>>>



More information about the CMake mailing list