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

B00083603 Michael O Brien B00083603 at student.itb.ie
Sun Jun 5 13:01:16 EDT 2016


I'm trying to install OpenCV2 and the process requires the use of cmake which I'm not familiar with so I was hoping I could ask the cmake mailing list for some advice.

I have a virtual machine where I have sudo permissions and I download the OpenCV2 zip file from, create a directory for the build and run the following commands in my Bash terminal


cd build
cmake -D CUDA_ARCH_BIN=3.2 -D CUDA_ARCH_PTX=3.2 -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D BUILD_TIFF=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
make -j$(nproc)
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.

Michael



ITB Email Disclaimer This is a confidential communication and is intended only for the addressee indicated in the message (or duly authorised to be responsible for the delivery of the message to such person). You are specifically prohibited from copying this message or delivering the same, or any part thereof, to any other person, whomsoever or howsoever, unless you receive written authorisation from us to do. If you are anyone other than the intended addressee, or person duly authorised and responsible for the delivery of this message to the intended addressee, you should destroy this message and notify us immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160605/abb4737e/attachment.html>


More information about the CMake mailing list