I\'m trying to build a program that requires CUDA. To the CMake script I supply:
cmake -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda ..
CUDA is
The C++ file with host calls doesnt know it needs to link to libcudart
. You have to explicitly set dependencies for the file/binary that file is in, eg.
target_link_libraries(clu ${CUDA_LIBRARIES})
The above response is slightly wrong. It looks like libcuda.so is installed in unexpected location for whatever reason. You can try setting CMAKE_LIBRARY_PATH
or/and CUDA_LIB_PATH
to that path.
The CUDA_LIB_PATH needs to be set outside cmake I think, eg export CUDA_LIB_PATH=/usr/local/cuda/lib64/stubs/