编译64位的OpenCV源代码(Mac)

时间:2012-07-15 01:56:48

标签: opencv 64-bit

我在尝试编译64位OpenCV库时遇到了一些问题。这就是我到目前为止所做的:

  1. 使用svn
  2. 获取源代码
  3. opencvmkdir build然后cd build
  4. cmake -G "Unix Makefiles" -D CMAKE_OSX_ARCHITECTURES=x86_64 -D CMAKE_C_FLAGS=-m64 -D CMAKE_CXX_FLAGS=-m64 ..
  5. 这使我得到输出(下面),这让我担心,因为找不到一些包。我已尝试在此帖Building EmguCV on OSX Snow Leopard中禁用WITH_CUDA标记作为建议,但似乎没有帮助。

    -- Extracting svn version, please wait...
    -- SVNVERSION:  svn:9029
    -- checking for module 'libdc1394-2'
    --   package 'libdc1394-2' not found
    -- checking for module 'libdc1394'
    --   package 'libdc1394' not found
    -- checking for module 'libavcodec'
    --   package 'libavcodec' not found
    -- checking for module 'libavformat'
    --   package 'libavformat' not found
    -- checking for module 'libavutil'
    --   package 'libavutil' not found
    -- checking for module 'libswscale'
    --   package 'libswscale' not found
    -- Looking for libavformat/avformat.h
    -- Looking for libavformat/avformat.h - not found
    -- Looking for ffmpeg/avformat.h
    -- Looking for ffmpeg/avformat.h - not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named sphinx
    -- 
    -- General configuration for OpenCV 2.4.9 =====================================
    -- Version control:                 svn:9029
    -- 
    --   Platform:
    --     Host:                        Darwin 11.4.0 i386
    --     CMake:                       2.8.8
    --     CMake generator:             Unix Makefiles
    --     CMake build tool:            /usr/bin/make
    --     Configuration:               Release
    -- 
    --   C/C++:
    --     Built as dynamic libs?:      YES
    --     C++ Compiler:                /usr/bin/c++
    --     C++ flags (Release):         -m64   -O3 -DNDEBUG 
    --     C++ flags (Debug):           -m64   -g 
    --     C Compiler:                  /usr/bin/gcc
    --     C flags (Release):           -m64   -O3 -DNDEBUG 
    --     C flags (Debug):             -m64   -g 
    --     Linker flags (Release):      
    --     Linker flags (Debug):        
    --     Precompiled headers:         NO
    -- 
    --   OpenCV modules:
    --     To be built:                 core imgproc flann highgui features2d calib3d ml video objdetect contrib nonfree legacy gpu photo python stitching ts videostab
    --     Disabled:                    world
    --     Disabled by dependency:      -
    --     Unavailable:                 androidcamera java
    -- 
    --   GUI: 
    --     QT 4.x:                      NO
    --     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 - 4.0.1)
    --     JPEG 2000:                   build (ver 1.900.1)
    --     OpenEXR:                     NO
    -- 
    --   Video I/O:
    --     DC1394 1.x:                  NO
    --     DC1394 2.x:                  NO
    --     FFMPEG:                      NO
    --       codec:                     NO
    --       format:                    NO
    --       util:                      NO
    --       swscale:                   NO
    --       gentoo-style:              NO
    --     OpenNI:                      NO
    --     OpenNI PrimeSensor Modules:  NO
    --     PvAPI:                       NO
    --     QuickTime:                   NO
    --     QTKit:                       YES
    -- 
    --   Other third-party libraries:
    --     Use IPP:                     NO
    --     Use TBB:                     NO
    --     Use Cuda:                    NO
    --     Use Eigen:                   NO
    --     Use Clp:                     NO
    -- 
    --   Python:
    --     Interpreter:                 /usr/bin/python (ver 2.7.1)
    --     Libraries:                   /usr/lib/libpython2.7.dylib (ver 2.7.1)
    --     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:           /usr/texbin/pdflatex
    -- 
    --   Tests and samples:
    --     Tests:                       YES
    --     Performance tests:           YES
    --     Examples:                    NO
    -- 
    --   Install path:                  /usr/local
    -- 
    --   cvconfig.h is in:              /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/build
    -- -----------------------------------------------------------------
    -- 
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/build
    

    如果我再尝试make -j8,我会得到一些像这样开始的东西并持续一段时间:

    [  0%] [  0%] [  0%] [  1%] [  1%] [  1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/adler32.c.o
    Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/compress.c.o
    Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/crc32.c.o
    Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngerror.c.o
    Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/png.c.o
    Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/deflate.c.o
    [  1%] [  1%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jas_cm.c.o
    Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcapimin.c.o
    In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngerror.c:19:
    /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:45:20: error: stdlib.h: No such file or directory
    In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:127,
                     from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngerror.c:19:
    /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:442:26: error: setjmp.h: No such file or directory
    /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:450:24: error: time.h: No such file or directory
    In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.c:14:
    /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:45:20: error: stdlib.h: No such file or directory
    In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/pngpriv.h:127,
                     from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.c:14:
    /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:442:26: error: setjmp.h: No such file or directory
    /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/libpng/png.h:450:24: error: time.h: No such file or directory
    In file included from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/zlib/zlib.h:34,
                     from /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/3rdparty/zlib/compress.c:9:
    /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/myOpencv/trunk/opencv/build/3rdparty/zlib/zconf.h:403:48: error: sys/types.h: No such file or directory
    

    说明

    1. https://github.com/Itseez/opencv
    2. 下载邮政编码
    3. 当你解压缩它时,你应该留下一个名为'opencv-master'的文件夹,cd进去。
    4. mkdir build
    5. cmake -D CMAKE_BUILD_TYPE = RELEASE -D CMAKE_INSTALL_PREFIX = / usr / local -D BUILD_PYTHON_SUPPORT = ON ..
    6. 使
    7. sudo make install

0 个答案:

没有答案