skip to Main Content

I need to install a software that needs cmake. Every step till make install work fine. Then at make install this is the error:

CMake Error at Source/kwsys/cmake_install.cmake:46 (file):
  file cannot create directory: /usr/local/doc/cmake-3.18/cmsys.  Maybe need
  administrative privileges.
Call Stack (most recent call first):
  cmake_install.cmake:47 (include)

make: *** [install] Error 1

I don’t have administrative privileges, so i can’t just add sudo.
I am new to working with this, so please be a little bit easy to understand

2

Answers


  1. When running cmake, you can tell CMake to install the software in some other location that you have access to. Just set the CMAKE_INSTALL_PREFIX variable to point to that location. So, your cmake command line might change from:

    cmake ..
    

    to this:

    cmake -DCMAKE_INSTALL_PREFIX=/home/username/software/ ..
    

    See this response for another way to do this in the CMake file itself.

    Login or Signup to reply.
  2. You can also use the good old DESTDIR (ed work, at least, with Makefile generator, and don’t need to reconfigure).
    ref: https://www.gnu.org/prep/standards/html_node/DESTDIR.html

    cmake --build build --target install -- DESTDIR=/home/username/software/
    

    which should install in /home/username/software/usr/local/[bin|lib|include]/...

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search