opencv3.1 python ubuntu gnome 16.04 中的“make -j4”错误
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/<user_name>/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
请帮忙。我不知道该怎么做。
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 ..
我的cmake配置好吗?请帮忙。
当我拥有 ubuntu-gnome 15.10 时,我已经遵循了本教程 http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/。
一切正常,但在 ubuntu-gnome 16.04 中我无法安装。
伙计们,我不知道出了什么问题,但在收到上述错误后我按照以下步骤操作:
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
之后我能够在 ipython
中 import cv2
。查看版本
import cv2
cv2.__version__
非常感谢所有试图提供帮助的人:)
[ 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/<user_name>/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
请帮忙。我不知道该怎么做。
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 ..
我的cmake配置好吗?请帮忙。
当我拥有 ubuntu-gnome 15.10 时,我已经遵循了本教程 http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/。
一切正常,但在 ubuntu-gnome 16.04 中我无法安装。
伙计们,我不知道出了什么问题,但在收到上述错误后我按照以下步骤操作:
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
之后我能够在 ipython
中 import cv2
。查看版本
import cv2
cv2.__version__
非常感谢所有试图提供帮助的人:)