pyofey pyofey - 1 month ago 30
Python Question

Error in `make -j4` in opencv3.1 python ubuntu gnome 16.04

[ 41%] Building CXX object modules/dpm/CMakeFiles/opencv_dpm.dir/src/dpm_feature.cpp.o
[ 41%] Building CXX object modules/bioinspired/CMakeFiles/opencv_bioinspired.dir/src/retinacolor.cpp.o
[ 41%] Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/ocl_test.cpp.o
[ 41%] Building CXX object modules/dpm/CMakeFiles/opencv_dpm.dir/src/dpm_model.cpp.o
[ 41%] Building CXX object modules/bioinspired/CMakeFiles/opencv_bioinspired.dir/src/retina.cpp.o
[ 43%] Building CXX object modules/xphoto/CMakeFiles/opencv_xphoto.dir/src/grayworld_white_balance.cpp.o
/home/vutsal/opencv_contrib/modules/xphoto/src/grayworld_white_balance.cpp:43:39: fatal error: opencv2/core/hal/intrin.hpp: No such file or directory
compilation terminated.
modules/xphoto/CMakeFiles/opencv_xphoto.dir/build.make:134: recipe for target 'modules/xphoto/CMakeFiles/opencv_xphoto.dir/src/grayworld_white_balance.cpp.o' failed
make[2]: *** [modules/xphoto/CMakeFiles/opencv_xphoto.dir/src/grayworld_white_balance.cpp.o] Error 1
CMakeFiles/Makefile2:8817: recipe for target 'modules/xphoto/CMakeFiles/opencv_xphoto.dir/all' failed
make[1]: *** [modules/xphoto/CMakeFiles/opencv_xphoto.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 43%] Building CXX object modules/bioinspired/CMakeFiles/opencv_bioinspired.dir/src/retinafilter.cpp.o
[ 43%] Building CXX object modules/bioinspired/CMakeFiles/opencv_bioinspired.dir/src/parvoretinafilter.cpp.o
[ 43%] Building CXX object modules/bioinspired/CMakeFiles/opencv_bioinspired.dir/opencl_kernels_bioinspired.cpp.o
[ 43%] Building CXX object modules/dpm/CMakeFiles/opencv_dpm.dir/src/dpm_cascade_detector.cpp.o
[ 43%] Building CXX object modules/dpm/CMakeFiles/opencv_dpm.dir/src/dpm_convolution.cpp.o
[ 43%] Linking CXX shared library ../../lib/libopencv_bioinspired.so
[ 43%] Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/cuda_test.cpp.o
[ 43%] Built target opencv_bioinspired
[ 43%] Building CXX object modules/dpm/CMakeFiles/opencv_dpm.dir/src/dpm_nms.cpp.o
[ 43%] Building CXX object modules/dpm/CMakeFiles/opencv_dpm.dir/src/precomp.cpp.o
[ 43%] Linking CXX shared library ../../lib/libopencv_dpm.so
[ 43%] Built target opencv_dpm
[ 43%] Linking CXX static library ../../lib/libopencv_ts.a
[ 43%] Built target opencv_ts
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2


Please help. I'm not able to understand what to do.

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..


Is my cmake config alright? Please help.

When I had ubuntu-gnome 15.10, I had followed this tutorial http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/.

Everything worked just fine but in ubuntu-gnome 16.04 I'm not able to install.

Answer

Guys i had no idea what was wrong but I followed the following steps after getting the error above:

sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip
sudo apt-get install libopencv-contrib-dev
sudo apt-get update && sudo apt-get upgrade

make clean
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D WITH =_GSTREAMER=ON \
-D BUILD_EXAMPLES=ON ..

make -j4
sudo make install
sudo ldconfig

after that I was able to import cv2 in ipython. To check the version

import cv2
cv2.__version__

thanks a lot anyway to all those who tried to help :)