[CMake] Make install permissions advice for ubuntu 14.04 with cmake 2.8

Roger Leigh rleigh at codelibre.net
Sun Jun 5 16:48:31 EDT 2016


On 05/06/2016 17:01, B00083603 Michael O Brien wrote:

> sudo make install
>
> When I run sudo make install I get the error
> /bin/sh: 1: cd: can't cd to
> /home/michael.obrien/setups/OpenCV/opencv-2.4.13/build
> make[2]: *** [3rdparty/libtiff/CMakeFiles/libtiff.dir/depend] Error 2
> make[1]: *** [3rdparty/libtiff/CMakeFiles/libtiff.dir/all] Error 2
> make: *** [all] Error 2
>
> If I run the command make install the build will complete but I get an
> error "CMake Error at cmake_install.cmake:36 (FILE): file cannot create
> directory /usr/local/include/opencv2. Maybe need administrative privileges
>
> So I'm confused as to how I can resolve this if sudo can't cd to the
> folder but I need su(do) to create the directories
>
> Any pointers on how to solve this would be very welcome.

Can you do this:

   sudo -s
   cd /home/michael.obrien/setups/OpenCV/opencv-2.4.13/build

That will check that root has permission to cd there.  One thought for 
why this might fail: is your homedir on NFS with root_squash enabled? 
That might prevent root access.  What are the permissions on this 
directory, and its parents?

Regards,
Roger



More information about the CMake mailing list