# CPack rpm and failed dependencies when install

**URL:** https://discourse.cmake.org/t/cpack-rpm-and-failed-dependencies-when-install/9285
**Category:** Usage
**Tags:** os:linux
**Created:** [October 26, 2023, 8:37am UTC](https://discourse.cmake.org/t/cpack-rpm-and-failed-dependencies-when-install/9285 "2023-10-26T08:37:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kelvenxu](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/f17d59/32.png) [@kelvenxu](https://discourse.cmake.org/u/kelvenxu)
#### Post date: [October 26, 2023, 8:37am UTC](https://discourse.cmake.org/t/cpack-rpm-and-failed-dependencies-when-install/9285/1 "2023-10-26T08:37:54Z")

</div>

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

```auto
  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:

```auto
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!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [October 29, 2023, 11:59am UTC](https://discourse.cmake.org/t/cpack-rpm-and-failed-dependencies-when-install/9285/2 "2023-10-29T11:59:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![robert.maynard](https://discourse.cmake.org/user_avatar/discourse.cmake.org/robert.maynard/32/4_2.png) [@robert.maynard](https://discourse.cmake.org/u/robert.maynard)
#### Post date: [October 30, 2023, 1:20pm UTC](https://discourse.cmake.org/t/cpack-rpm-and-failed-dependencies-when-install/9285/3 "2023-10-30T13:20:20Z")

</div>

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.
