CPack rpm and failed dependencies when install

In my project, I use below code to import cuda library

  find_package(CUDAToolkit)
  target_link_libraries(${target} PRIVATE CUDA::cudart)
  target_link_libraries(${target} PRIVATE CUDA::cufft)
  target_link_libraries(${target} PRIVATE CUDA::cublas)

It works well, and make rpm using cpack.

When I install the rpm package, it failed:

error: Failed dependencies:
	libcublas.so.11()(64bit) is needed by hello-1.0.0-1.x86_64
	libcublasLt.so.11()(64bit) is needed by hello-1.0.0-1.x86_64
	libcudart.so.11.0()(64bit) is needed by hello-1.0.0-1.x86_64
	libcufft.so.10()(64bit) is needed by hello-1.0.0-1.x86_64

I have installed cuda in /usr/local/cuda, and set path in /etc/ld.so.conf.d/cuda-11-4.conf.

Any idea? Thank you very mach!

Your CUDA installation is not tracked by RPM, so it won’t “see” them. Something needs to tell RPM that these CUDA libraries exist and are associated with some package. I suspect you’ll need to use an RPM installer for CUDA rather than a shell script.

Cc: @robert.maynard

I am not familar with the requirements of RPM, but yes CUDA does offer RPM packages.

If you go with a solution where you package CUDA dependencies, you need to read the CUDA EULA agreement as it has specific redist rules.