# Seeing cmake install failure with STATIC libraries

**URL:** https://discourse.cmake.org/t/seeing-cmake-install-failure-with-static-libraries/10879
**Category:** Usage
**Tags:** os:linux
**Created:** [May 21, 2024, 6:22pm UTC](https://discourse.cmake.org/t/seeing-cmake-install-failure-with-static-libraries/10879 "2024-05-21T18:22:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ramana](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/b4bc9f/32.png) [@ramana](https://discourse.cmake.org/u/ramana)
#### Post date: [May 21, 2024, 6:22pm UTC](https://discourse.cmake.org/t/seeing-cmake-install-failure-with-static-libraries/10879/1 "2024-05-21T18:22:43Z")

</div>

Trying to run install command and seeing the following issue:  
Install the project…  
– Install configuration: “Release”  
– Installing: /usr/lib/libcares.a  
CMake Error at cmake\_install.cmake:46 (file):  
file INSTALL cannot copy file  
“/root/grpc/build/third\_party/cares/cares/lib/x86\_64-linux-gnu/libcares.a”  
to “/usr/lib/libcares.a”: No such file or directory.

make: \*\*\* [Makefile:120: install] Error 1

\*\*\*\* Installation failed. Aborting package creation.

Cleaning up…OK

Bye.

The portion of contents of cmake\_install.cmake:  
if(CMAKE\_INSTALL\_COMPONENT STREQUAL “Unspecified” OR NOT CMAKE\_INSTALL\_COMPONENT)  
file(INSTALL DESTINATION “${CMAKE\_INSTALL\_PREFIX}/lib” TYPE STATIC\_LIBRARY FILES “/root/grpc/build/third\_party/cares/cares/lib/x86\_64-linux-gnu/libcares.a”)  
endif()  
And the file location:  
root@abc:~/grpc/build# ls -l “/root/grpc/build/third\_party/cares/cares/lib/x86\_64-linux-gnu/libcares.a”  
-rw-r–r-- 1 root root 201358 May 21 17:22 /root/grpc/build/third\_party/cares/cares/lib/x86\_64-linux-gnu/libcares.a  
Not understanding why we are seeing this issue even the file is present in the specified folder.

Thanks & Regards,  
Ramana

---

<div class="post-metadata">

### Author: ![jtxa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jtxa/32/1535_2.png) [@jtxa](https://discourse.cmake.org/u/jtxa)
#### Post date: [May 21, 2024, 10:52pm UTC](https://discourse.cmake.org/t/seeing-cmake-install-failure-with-static-libraries/10879/2 "2024-05-21T22:52:45Z")

</div>

Does the target directory `/usr/lib` exist?  
Files cannot be copied to non-existent directories.

---

<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: [June 10, 2024, 1:37pm UTC](https://discourse.cmake.org/t/seeing-cmake-install-failure-with-static-libraries/10879/3 "2024-06-10T13:37:25Z")

</div>

> [@ramana](#):
>
> Cleaning up…OK
> 
> Bye.

What packaging system makes this output? Something isn’t communicating expected `lib` directory names properly.
