summaryrefslogtreecommitdiff
path: root/Modules/FindCUDA.cmake
Commit message (Collapse)AuthorAgeFilesLines
* FindCUDA: Mark CUDA_rt_LIBRARY as advancedAndrey Alekseenko2023-03-161-0/+1
|
* FindCUDA: Disallow with CMP0147 under Visual StudioBrad King2023-03-121-0/+7
| | | | | | | | | | FindCUDA's custom commands invoke `nvcc`, which invokes `cl`. Under VS this is done without a `/FS` flag, so `.pdb` generation races if we use `BuildInParallel`. The FindCUDA module has already been removed by policy CMP0146 after being deprecated since CMake 3.10, so it is simplest to just disallow this combination of features. Issue: #24576
* FindCUDA: Add policy to remove this moduleBrad King2023-03-091-1/+16
| | | | | | The `FindCUDA` module has been deprecated since CMake 3.10. Add a policy to pretend it doesn't exist in order to encourage projects to port away from it.
* FindCUDA: Do not use CUDA_nppicom_LIBRARY in CUDA 11.0+Oleksii Udod2022-11-181-1/+3
| | | | | | | | Extend the change from commit 1d9f2f9714 (FindCUDA: Do not search for the deprecated nppicom when CUDA >= 11, 2020-06-22, v3.18.0-rc3~14^2) to also not use the `CUDA_nppicom_LIBRARY` variable. Issue: #20845
* FindCUDA: Fix varaible reset with CUDA_TOOLKIT_TARGET_DIRJames Bigler2022-06-141-1/+3
| | | | | | | | CUDA_TOOLKIT_TARGET_DIR doesn't always exist in the cache or defined by the user previous to using FindCUDA. In this case it will always reset the variables making it impossible to manually change or set them. This can be fixed by checking to see if the variable is defined before checking against the previously used version stored in CUDA_TOOLKIT_TARGET_DIR_INTERNAL.
* FindCUDA: Make version extraction robust to empty outputDavid Berard2022-01-261-2/+2
| | | | I found that `NVCC_OUT` was sometimes empty when I was building.
* FindCUDA: Improve deprecation guidance wordingRaul Tambre2021-05-221-5/+5
| | | | | | | | | | | Simplified the text regarding adding sources to be more general as there's also target_sources(). Improved the wording for FindCUDAToolkit to be more explicit of its usecase and avoid using "superseded" since the common usecase of FindCUDA was superseded by the language support. Wording suggestions incopropated from discussion on #22203.
* FindCUDA: Make the deprecation notice more prominentRaul Tambre2021-05-221-1/+1
| | | | | | | | | | | | | | FindCUDA is still widely used, but has been superseded by the much more robust native language support. However the deprecation hasn't been noticed well enough and real-world experience shows there's still new code written to use it. Change this particular notice to a warning to get a hard to miss red box. We lose the semantic meaning, but we don't want to make all notices like this. If there are similar cases in the future requiring it would be worth adding a custom variant of the deprecated directive. Fixes #22203.
* CUDA: improve regex for CUDA Toolkit root from nvcc verbose outputRobert Maynard2021-05-061-1/+1
| | | | | | | | | | | | The original regular expression was greedy and would match any environment variable ending with `TOP` (like `DESKTOP`). This is an issue on windows where `nvcc -v` would output all environment variables before the compiler's verbose output. To resolve this issue we use a tighter match algorithm that looks for `#$ TOP=` instead of `TOP=`. Fixes: #22158
* CUDA: Capture all nvcc output when extracting toolkit rootBrad King2021-02-121-3/+4
| | | | | | | | | Since commit fb2afef620 (CUDA: Support nvcc symlinking to ccache, 2021-01-07) and commit 3cef91a321 (CUDA: Always extract CUDA Toolkit root from nvcc verbose output, 2021-02-03) we always run the command `nvcc -v __cmake_determine_cuda` to look for the toolkit root in its stderr. On Windows, that command may print to stdout instead, so capture that as well.
* CUDA: Always extract CUDA Toolkit root from nvcc verbose outputRobert Maynard2021-02-081-12/+9
| | | | | | | | | | | | Fixes #21750, #21763 Given that NVCC can be provided by multiple different sources (NVIDIA HPC SDK, CUDA Toolkit, distro) each of which has a different layout, we need to extract the CUDA toolkit root from the compiler itself, allowing us to support numerious different scattered toolkit layouts. The NVIDIA HPC SDK specifically ships two copies of nvcc one in `compilers/bin/` and one in `cuda/bin`. Thus when using `compilers/bin/nvcc` the Toolkit root logic fails.
* CUDA: Support nvcc symlinking to ccacheRong Ou2021-01-111-1/+14
| | | | | | | Invoke `nvcc -v` to find the real CUDA bin directory. This is needed if `nvcc` is a symlink to `ccache` or `colornvcc`. Fixes: #21177
* Help: Add `.. versionadded` directives to module docsNikita Nemkin2020-12-021-19/+38
| | | | Issue: #19715
* Help: Improve formatting for FindBoost and FindCUDANikita Nemkin2020-12-021-332/+445
| | | | | | | | | * Split large literal blocks into definitions lists. * Add section headers. * Add links to standard commands and variables. * Use inline literals liberally. * Enable code highlighting in literal blocks. * Format command signatures according to modern conventions.
* CUDA: Enable support on QNXjanbernloehr2020-11-021-1/+3
| | | | | | | | | | | This fixes the following two issues with the CUDA support on QNX: * cuda target name is not derived correctly (should be `aarch64-qnx`). * linking `cudart` must not be linked against `rt`, `dl`, `pthread`. This enables to use cmake's native cuda support on QNX. Fixes: #21381
* FindCUDA: Do not search for the deprecated nppicom when CUDA >= 11Robert Maynard2020-06-221-2/+5
| | | | | | | The nppicom library has been removed in preference of nvjpeg starting in CUDA 11. Fixes: #20845
* FindCUDA: Only depend on Threads::Threads on platforms that need itRobert Maynard2020-02-241-1/+5
| | | | | | | In commit 46371132b3 (FindCUDA: CUDA_LIBRARIES doesn't contain raw `-pthread`, 2019-11-11, v3.17.0-rc1~455^2) we introduced use of the `Threads::Threads` target, but we do not `find_package(Threads)` on all platforms. Use the target only if it exists.
* FindCUDAToolkit: Improve usage, library set, and testsRobert Maynard2019-12-161-3/+8
| | | | | | Refined the initial design of FindCUDAToolkit and improve it by adding more library support, more toolkit information and tests.
* Merge topic 'cmake-e-rm'Kyle Edwards2019-11-151-1/+1
|\ | | | | | | | | | | | | | | 2d0100fac7 replace remove and remove_directory with rm in tests 5239fc5c75 cmake -E: Add rm with improved semantics over remove and remove_directory Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3949
| * replace remove and remove_directory with rm in testsJohnny Jazeix2019-11-131-1/+1
| |
* | FindCUDA: CUDA_LIBRARIES doesn't contain raw `-pthread`Robert Maynard2019-11-111-1/+1
|/ | | | | | | If a person tried to pass `CUDA_LIBRARIES` to nvcc compiler it could fail as it might have `-pthread` which nvcc doesn't support. Instead we now use the `Threads::Threads` so that nvcc gets the correct `-Xcompiler -pthread` flag.
* FindCUDA: Use find_program instead of find_path when searching for nvcc.Hong Xu2019-11-041-3/+6
| | | | | Before this commit, nvcc would not be found if it is in env PATH but a non-standard location. This commit fixes this issue.
* FindCUDA: Revert "Use find_program instead of find_path to find nvcc"Brad King2019-11-041-2/+2
| | | | | | Revert commit 067ee518f7 (FindCUDA: Use find_program instead of find_path to find nvcc, 2019-10-31). It causes `CUDA_TOOLKIT_ROOT_DIR` to contain the path to nvcc rather than the toolkit directory.
* FindCUDA: Use find_program instead of find_path to find nvccHong Xu2019-11-011-2/+2
| | | | | Otherwise nvcc is not found if it is in env PATH but a non-standard location.
* FindCUDA: Add nvToolsExt and OpenCL librariesEyal Rozenberg2019-06-181-0/+12
| | | | | | Find these libraries with CUDA 5 and above. Fixes: #19386
* Modules: Consistently use 2 space indentationKitware Robot2019-05-141-1/+1
|
* FindThreads: Drop IRIX-specific options and resultsBrad King2018-12-071-12/+1
| | | | | | | | | We do not need to support IRIX anymore, so drop relevant parts. In particular, the `CMAKE_THREAD_PREFER_PTHREAD` is frequently confused with `THREADS_PREFER_PTHREAD_FLAG`. Also remove references to the IRIX-specific options and results from other modules and tests.
* Help: Use 'deprecated' template, and date deprecation of modulesJoachim Wuttke (o)2018-10-251-13/+16
|
* Help: Convert remaining modules to block-style commentsKitware Robot2018-10-221-375/+376
|
* Merge topic 'FindCUDA-ccbin-env'Brad King2018-09-201-1/+5
|\ | | | | | | | | | | | | 8085799ce3 FindCUDA: Add option to set CUDA_HOST_COMPILER via environment Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2391
| * FindCUDA: Add option to set CUDA_HOST_COMPILER via environmentpeterjc1232018-09-181-1/+5
| | | | | | | | | | Re-use the `CUDAHOSTCXX` environment variable from the first-class CUDA language support to specify the host compiler for FindCUDA.
* | FindCUDA: Fix "alphabetical" typoNikolaus Wittenstein2018-09-141-2/+2
|/
* FindCUDA: Do not find cublas_device on CUDA >= 9.2Kenta Kubo2018-08-231-1/+2
| | | | | | | The `cublas_device` has been deprecated and will be removed in future versions of CUDA. Issue: #18290
* Fix misc. typosluz.paz2018-06-041-1/+1
| | | | Found via `codespell` and `grep`
* Merge topic 'FindCUDA-sccache'Brad King2018-05-111-4/+4
|\ | | | | | | | | | | | | 53ffff2277 FindCUDA: Add support for sccache Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2050
| * FindCUDA: Add support for sccacheWill Feng2018-05-091-4/+4
| | | | | | | | | | When `CMAKE_C_COMPILER` is `sccache`, pass plain `cl` as the host compiler to `nvcc`. Otherwise, `nvcc` does not accept it.
* | Merge topic 'FindCUDA-revert-sepcomp-cublas'Brad King2018-05-081-2/+2
|\ \ | |/ |/| | | | | | | | | 9a66345752 FindCUDA: Fix regression in separable compilation without cublas Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2048
| * FindCUDA: Fix regression in separable compilation without cublasBrad King2018-05-071-2/+2
| | | | | | | | | | | | | | | | | | Revert commit v3.11.0-rc1~274^2 (FindCUDA: Add cublas device library to separable compilation, 2017-11-03). It breaks targets that do not link to cublas. Another solution will be needed to solve the original problem in a more compatible way. Fixes: #17965
* | FindCUDA: Add support for clcacheEdward Z. Yang2018-04-061-0/+5
| | | | | | | | | | | | | | When `CMAKE_C_COMPILER` is `clcache`, pass plain `cl` as the host compiler to `nvcc`. Otherwise, `nvcc` does not accept it. Signed-off-by: Edward Z. Yang <ezyang@fb.com>
* | FindCUDA: Make nvcc configurable via CUDA_NVCC_EXECUTABLE env varEdward Z. Yang2018-03-291-10/+14
| | | | | | | | | | | | | | | | | | | | This is useful if, for example, you want ccache to be used for nvcc. With the current behavior, cmake always picks up /usr/local/cuda/bin/nvcc, even if there is a ccache nvcc stub in the PATH. Allowing for CUDA_NVCC_EXECUTABLE lets us work around the problem. Signed-off-by: Edward Z. Yang <ezyang@fb.com>
* | MAINT: Misc. typosluz.paz2018-02-131-5/+5
|/ | | | Found via `codespell -q 3 -I ../cmake-whitelist.txt`.
* FindCUDA: Fix regression in per-config flagsBrad King2018-01-301-0/+12
| | | | | | | | | Changes in commit 48f7e2d300 (Unhardcode the CMAKE_CONFIGURATION_TYPES values, 2017-11-27) accidentally left `CUDA_configuration_types` undefined, but this is used in a few places to handle per-config flags. Restore it. Fixes: #17671
* MAINT: Misc. typosluz.paz2018-01-101-1/+1
| | | Found via `codespell`
* Merge topic 'unhardcode-configuration-types'Brad King2018-01-101-18/+1
|\ | | | | | | | | | | | | | | 1f4d7a07 Help: Add references and backticks in LINK_FLAGS prop_tgt 48f7e2d3 Unhardcode the CMAKE_CONFIGURATION_TYPES values Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1345
| * Unhardcode the CMAKE_CONFIGURATION_TYPES valuesBeren Minor2018-01-081-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | This removes duplicated code for per-config variable initialization by providing a `cmake_initialize_per_config_variable(<PREFIX> <DOCSTRING>)` function. This function initializes a `<PREFIX>` cache variable from `<PREFIX>_INIT` and unless the `CMAKE_NOT_USING_CONFIG_FLAGS` variable is defined, does the same with `<PREFIX>_<CONFIG>` from `<PREFIX>_<CONFIG>_INIT` for every `<CONFIG>` in `CMAKE_CONFIGURATION_TYPES` for multi-config generators or `CMAKE_BUILD_TYPE` for single-config generators.
* | Merge topic 'FindCUDA-deduplicate-c+std-host-flags'Brad King2018-01-091-1/+1
|\ \ | | | | | | | | | | | | | | | | | | ff41a4b8 FindCUDA: de-duplicates C++11 flag when propagating host flags. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1628
| * | FindCUDA: de-duplicates C++11 flag when propagating host flags.David Hirvonen2018-01-061-1/+1
| | |
* | | Merge topic 'msvc2017-findcuda'Brad King2018-01-091-8/+15
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | fab1b432 FindCUDA: Update to properly find MSVC 2017 compiler tools Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Merge-request: !1631
| * | FindCUDA: Update to properly find MSVC 2017 compiler toolsAaron Bray2018-01-081-8/+15
| |/ | | | | | | | | An implementation that handles the different installation locations of visual studio compiler tools
* | Merge topic 'use_generator_is_multi_config'Brad King2018-01-081-6/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | 3c413e2a GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Modules c267ea1c GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1627