在Ubuntu中安装OpenCV

时间:2015-02-05 11:03:20

标签: opencv

我正在尝试在Xubuntu 4.10中安装OpenCV。我已经尝试了一些可以在网上找到的方法。我更新了我的ubuntu并安装了official文档中指定的所有依赖项。但是在执行make命令时,我不断收到此错误消息。

/home/bipin/Desktop/opencv/opencv-2.4.10/modules/core/src/system.cpp: In function ‘(static initializers for /home/bipin/Desktop/opencv/opencv-2.4.10/modules/core/src/system.cpp)’: /home/bipin/Desktop/opencv/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an ‘asm’ ); ^ make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1 make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 make: *** [all] Error 2

这里` - OpenCV 2.4.10的常规配置

=====================================
--   Version control:               unknown
-- 
--   Platform:
--     Host:                        Linux 3.13.0-45-generic i686
--     CMake:                       2.8.12.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               Release
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ Compiler:                /usr/bin/c++  (ver 4.8.2)
--     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -msse3 -mfpmath=sse -ffunction-sections -O2 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -msse3 -mfpmath=sse -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -msse3 -mfpmath=sse -ffunction-sections -O2 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -msse3 -mfpmath=sse -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      
--     Linker flags (Debug):        
--     Precompiled headers:         YES
-- 
--   OpenCV modules:
--     To be built:                 core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib java python stitching superres ts videostab
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 androidcamera dynamicuda viz
-- 
--   GUI: 
--     QT 5.x:                      YES (ver 5.2.1)
--     QT OpenGL support:           YES (Qt5::OpenGL 5.2.1)
--     OpenGL support:              YES (/usr/lib/i386-linux-gnu/libGLU.so /usr/lib/i386-linux-gnu/libGL.so /usr/lib/i386-linux-gnu/libSM.so /usr/lib/i386-linux-gnu/libICE.so /usr/lib/i386-linux-gnu/libX11.so /usr/lib/i386-linux-gnu/libXext.so)
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/i386-linux-gnu/libz.so (ver 1.2.8)
--     JPEG:                        /usr/lib/i386-linux-gnu/libjpeg.so (ver )
--     PNG:                         /usr/lib/i386-linux-gnu/libpng.so (ver 1.2.50)
--     TIFF:                        /usr/lib/i386-linux-gnu/libtiff.so (ver 42 - 4.0.3)
--     JPEG 2000:                   /usr/lib/i386-linux-gnu/libjasper.so (ver 1.900.1)
--     OpenEXR:                     /usr/lib/i386-linux-gnu/libImath.so /usr/lib/i386-linux-gnu/libIlmImf.so /usr/lib/i386-linux-gnu/libIex.so /usr/lib/i386-linux-gnu/libHalf.so /usr/lib/i386-linux-gnu/libIlmThread.so (ver 1.6.1)
-- 
--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  YES (ver 2.2.1)
--     FFMPEG:                      YES
--       codec:                     YES (ver 54.35.0)
--       format:                    YES (ver 54.20.4)
--       util:                      YES (ver 52.3.0)
--       swscale:                   YES (ver 2.1.1)
--       gentoo-style:              YES
--     GStreamer:                   
--       base:                      YES (ver 0.10.36)
--       video:                     YES (ver 0.10.36)
--       app:                       YES (ver 0.10.36)
--       riff:                      YES (ver 0.10.36)
--       pbutils:                   YES (ver 0.10.36)
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     UniCap:                      NO
--     UniCap ucil:                 NO
--     V4L/V4L2:                    Using libv4l1 (ver 1.0.1) / libv4l2 (ver 1.0.1)
--     XIMEA:                       NO
--     Xine:                        NO
-- 
--   Other third-party libraries:
--     Use IPP:                     NO
--     Use Eigen:                   YES (ver 3.2.0)
--     Use TBB:                     YES (ver 4.2 interface 7000)
--     Use OpenMP:                  NO
--     Use GCD                      NO
--     Use Concurrency              NO
--     Use C=:                      NO
--     Use Cuda:                    NO
--     Use OpenCL:                  YES
-- 
--   OpenCL:
--     Version:                     dynamic
--     Include path:                /home/bipin/Desktop/opencv/opencv-2.4.10/3rdparty/include/opencl/1.2
--     Use AMD FFT:                 NO
--     Use AMD BLAS:                NO
-- 
--   Python:
--     Interpreter:                 /usr/bin/python2 (ver 2.7.6)
--     Libraries:                   /usr/lib/i386-linux-gnu/libpython2.7.so (ver 2.7.6)
--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.2)
--     packages path:               lib/python2.7/dist-packages
-- 
--   Java:
--     ant:                         /usr/bin/ant (ver 1.9.3)
--     JNI:                         /usr/local/java/jdk1.7.0_25/include /usr/local/java/jdk1.7.0_25/include/linux /usr/local/java/jdk1.7.0_25/include
--     Java tests:                  YES
-- 
--   Documentation:
--     Build Documentation:         YES
--     Sphinx:                      /usr/local/bin/sphinx-build (ver 1.2.1)
--     PdfLaTeX compiler:           /usr/bin/pdflatex
-- 
--   Tests and samples:
--     Tests:                       YES
--     Performance tests:           YES
--     C/C++ Examples:              YES
-- 
--   Install path:                  /usr/local
-- 
--   cvconfig.h is in:              /home/bipin/Desktop/opencv/opencv-2.4.10/build
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bipin/Desktop/opencv/opencv-2.4.10/build
`

2 个答案:

答案 0 :(得分:0)

您的GCC编译器似乎无法处理内联汇编代码。 您可以尝试更新GCC并进行检查吗?

我认为这是一个已知问题here

答案 1 :(得分:0)

好的,完成了!我在基本文件夹中的system.cpp中出现了问题。我从github复制了最新的代码并构建它并且它工作得很好。谢谢大家的关注。

这是帮助我https://github.com/Itseez/opencv/commit/ea50be0529c248961e1b66293f8a9e4b807294a6

的提交