【问题标题】:How to compile OpenCV 2.4.0 (beta2) by Cmake on Mac OS X Lion?如何在 Mac OS X Lion 上通过 Cmake 编译 OpenCV 2.4.0 (beta2)?
【发布时间】:2012-04-19 11:54:55
【问题描述】:

我想在我的 Mac OS X Lion 系统上将 Opencv 2.4.0 (beta2) 与 EmguCV 和 MonoDevelop 一起使用。但是我通过Cmake编译OpenCV 2.4.0失败,显示缺少一些highgui的dylib文件。

谁能告诉我在 Mac OS X 中编译 OpenCV 2.4.0 的整个配置和过程?谢谢。

【问题讨论】:

  • 您是否尝试过第 2 节中the Wiki 的说明?忽略下载修订版 3059 的说明。

标签: macos image-processing opencv cmake computer-vision


【解决方案1】:

要消除有关 python 的 sphinx 包的错误,请使用安装它

sudo easy_install -U Sphinx

或者,如果您使用 MacPorts:

sudo port install py26-sphinx

在检查默认python解释器“python --version”的版本之前。在我的示例中是 2.6。

【讨论】:

    【解决方案2】:

    我从存储库 (rev 8301) 下载了 OpenCV 2.4.0 源代码,并且在 Mac OS X 10.7.3 上编译它没有问题:

    $ svn info
    Path: .
    URL: http://code.opencv.org/svn/opencv/tags/2.4.0/opencv
    Repository Root: http://code.opencv.org/svn/opencv
    Repository UUID: c5418bc3-7546-4aae-8bad-fa6f2f3e53e6
    Revision: 8301
    Node Kind: directory
    Schedule: normal
    Last Changed Author: marina.kolpakova
    Last Changed Rev: 8282
    Last Changed Date: 2012-04-30 16:06:37 -0300 (Mon, 30 Apr 2012)
    
    $ mkdir build
    $ cd build
    $ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..
    
    -- The CXX compiler identification is GNU
    -- The C compiler identification is GNU
    -- Checking whether CXX compiler has -isysroot
    -- Checking whether CXX compiler has -isysroot - yes
    -- Checking whether CXX compiler supports OSX deployment target flag
    -- Checking whether CXX compiler supports OSX deployment target flag - yes
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Checking whether C compiler has -isysroot
    -- Checking whether C compiler has -isysroot - yes
    -- Checking whether C compiler supports OSX deployment target flag
    -- Checking whether C compiler supports OSX deployment target flag - yes
    -- Check for working C compiler: /usr/bin/gcc
    -- Check for working C compiler: /usr/bin/gcc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detected version of GNU GCC: 42 (402)
    -- Extracting svn version, please wait...
    -- SVNVERSION:  svn:8301
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of off64_t
    -- Check size of off64_t - failed
    -- Looking for fseeko
    -- Looking for fseeko - found
    -- Looking for unistd.h
    -- Looking for unistd.h - found
    -- Looking for assert.h
    -- Looking for assert.h - found
    -- Looking for fcntl.h
    -- Looking for fcntl.h - found
    -- Looking for io.h
    -- Looking for io.h - not found
    -- Looking for jbg_newlen
    -- Looking for jbg_newlen - not found
    -- Looking for mmap
    -- Looking for mmap - found
    -- Looking for search.h
    -- Looking for search.h - found
    -- Looking for string.h
    -- Looking for string.h - found
    -- Looking for unistd.h
    -- Looking for unistd.h - found
    -- checking for module 'libavcodec'
    --   found libavcodec, version 52.76.0
    -- checking for module 'libavformat'
    --   found libavformat, version 52.68.0
    -- checking for module 'libavutil'
    --   found libavutil, version 50.19.0
    -- checking for module 'libswscale'
    --   found libswscale, version 0.11.0
    -- Looking for libavformat/avformat.h
    -- Looking for libavformat/avformat.h - found
    -- Looking for ffmpeg/avformat.h
    -- Looking for ffmpeg/avformat.h - not found
    -- checking for module 'libdc1394-2'
    --   package 'libdc1394-2' not found
    -- checking for module 'libdc1394'
    --   package 'libdc1394' not found
    -- Found PythonInterp: /usr/bin/python (found suitable version "2.7.1", required is "2.0")
    -- Found PythonLibs: /usr/lib/libpython2.7.dylib (Required is at least version "2.7.1")
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named sphinx
    -- Could NOT find CUDA: Found unsuitable version "4.0", but required is at least "4.1" (found /usr/local/cuda)
    -- 
    -- General configuration for OpenCV 2.4.0 =====================================
    -- Version control:                 svn:8301
    -- 
    --   Platform:
    --     Host:                        Darwin 11.3.0 i386
    --     CMake:                       2.8.6
    --     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.2.1)
    --     C++ flags (Release):         -Wall -pthread -fomit-frame-pointer -msse -msse2 -O3 -DNDEBUG   -DNDEBUG
    --     C++ flags (Debug):           -Wall -pthread -fomit-frame-pointer -msse -msse2 -g  -O0 -DDEBUG -D_DEBUG -ggdb3
    --     C Compiler:                  /usr/bin/gcc
    --     C flags (Release):           -Wall -pthread -fomit-frame-pointer -msse -msse2 -O3 -DNDEBUG  -DNDEBUG
    --     C flags (Debug):             -Wall -pthread -fomit-frame-pointer -msse -msse2 -g  -O0 -DDEBUG -D_DEBUG -ggdb3
    --     Linker flags (Release):      
    --     Linker flags (Debug):        
    -- 
    --   OpenCV modules:
    --     To be built:                 calib3d contrib core features2d flann gpu highgui imgproc legacy ml nonfree objdetect photo python stitching ts video videostab
    --     Disabled by user:            -
    --     Disabled by dependency:      -
    --     Unavailable:                 androidcamera java
    -- 
    --   GUI: 
    --     Cocoa:                       YES
    --     OpenGL support:              NO
    -- 
    --   Media I/O: 
    --     ZLib:                        build (ver 1.2.6)
    --     JPEG:                        build (ver 62)
    --     PNG:                         build (ver 1.5.9)
    --     TIFF:                        build (ver 42)
    --     JPEG 2000:                   build (ver 1.900.1)
    --     OpenEXR:                     NO
    --     OpenNI:                      NO
    --     OpenNI PrimeSensor Modules:  NO
    -- 
    --   Video I/O:                     QTKit
    --     FFMPEG:                      YES
    --       codec:                     YES (ver Unknown)
    --       format:                    YES (ver Unknown)
    --       util:                      YES (ver Unknown)
    --       swscale:                   YES (ver Unknown)
    --       gentoo-style:              YES
    -- 
    --   Other third-party libraries:
    --     Use IPP:                     NO
    --     Use TBB:                     NO
    --     Use Cuda:                    NO
    --     Use Eigen:                   NO
    -- 
    --   Python:
    --     Interpreter:                 /usr/bin/python (ver 2.7.1)
    --     Libraries:                   /usr/lib/libpython2.7.dylib
    --     numpy:                       /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include (ver 1.5.1)
    --     packages path:               lib/python2.7/site-packages
    -- 
    --   Documentation:
    --     Build Documentation:         NO
    --     Sphinx:                      NO
    --     PdfLaTeX compiler:           NO
    -- 
    --   Tests and samples:
    --     Tests:                       YES
    --     Performance tests:           YES
    --     Examples:                    YES
    -- 
    --   Install path:                  /usr/local
    -- 
    --   cvconfig.h is in:              /Users/karlphillip/installers/OpenCV-2.4.0/opencv/build
    -- -----------------------------------------------------------------
    -- 
    -- Configuring done
    -- Generating done
    CMake Warning:
      Manually-specified variables were not used by the project:
    
        BUILD_PYTHON_SUPPORT
    
    
    -- Build files have been written to: /Users/karlphillip/installers/OpenCV-2.4.0/opencv/build
    

    之后,我执行make进行编译,就这样了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-15
      • 1970-01-01
      • 2011-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多