MantisBT - CMake
View Issue Details
0016096CMakeCMakepublic2016-05-06 15:032016-06-10 14:31
Ryan Desmond 
Kitware Robot 
normalminoralways
closedmoved 
LinuxUbuntu14.04
CMake 3.5.2 
 
0016096: FindCUDA requires dynamic runtime even if building statically
In https://gitlab.kitware.com/cmake/cmake/commit/7fea2b77df2d70283f4918a8ff52836dbc68db6b, [^] support was added to use the static CUDA libraries. The script still checks for and requires that the dynamic libraries are installed in order to build successfully, though they are not needed for a static build.
 - Setup a machine on which to use build CUDA, which has the static libraries available
 - Remove or delete cudart.so
 - Create a cmake script with `find_package(CUDA REQUIRED)`
 - When run, the script will fail with:

CMake Error at /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find CUDA (missing: CUDA_CUDART_LIBRARY) (found version "7.5")
Call Stack (most recent call first):
  /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.5/Modules/FindCUDA.cmake:949 (find_package_handle_standard_args)
  imagery/CMakeLists.txt:43 (find_package)

The dynamic library is located at:

 725 cuda_find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library")

The static library is located at:

 734 cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library")

Later in the script, the variable for the dynamic library is required, even if the library itself is not required for a successful build.

 950 find_package_handle_standard_args(CUDA
 951 REQUIRED_VARS
 952 CUDA_TOOLKIT_ROOT_DIR
 953 CUDA_NVCC_EXECUTABLE
 954 CUDA_INCLUDE_DIRS
 955 CUDA_CUDART_LIBRARY
 956 VERSION_VAR
 957 CUDA_VERSION
 958 )
No tags attached.
Issue History
2016-05-06 15:03Ryan DesmondNew Issue
2016-06-10 14:29Kitware RobotNote Added: 0042999
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042999)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.