os x 10.9上的Opencv安装失败

时间:2013-10-30 14:54:49

标签: ruby-on-rails macos opencv homebrew

我错误地更新到os x 10.9,早上太早,并且在发布后不久。然后复合它我酿造卸载opencv然后尝试重新安装它,所以它将使用一个新的库。现在它失败了。

这是非常有帮助的:)错误消息和回溯。我找不到任何有意义的事情,因为它失败了。

任何指针都会非常感激。

enter code here
/usr/local/Library/ENV/4.3/c++     -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 -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -pthread -fomit-frame-pointer -msse -msse2 -msse3 -dynamiclib -Wl,-headerpad_max_install_names   -compatibility_version 2.4.0 -current_version 2.4.6 -o ../../lib/libopencv_video.2.4.6.dylib -install_name /tmp/opencv-IuRF/opencv-2.4.6.1/macbuild/lib/libopencv_video.2.4.dylib
cmakeFiles/opencv_video.dir/src/bgfg_gaussmix.cpp.o
cmakeFiles/opencv_video.dir/src/bgfg_gaussmix2.cpp.o
cmakeFiles/opencv_video.dir/src/bgfg_gmg.cpp.o
cmakeFiles/opencv_video.dir/src/camshift.cpp.o
cmakeFiles/opencv_video.dir/src/kalman.cpp.o
cmakeFiles/opencv_video.dir/src/lkpyramid.cpp.o
cmakeFiles/opencv_video.dir/src/motempl.cpp.o
cmakeFiles/opencv_video.dir/src/optflowgf.cpp.o
cmakeFiles/opencv_video.dir/src/precomp.cpp.o
cmakeFiles/opencv_video.dir/src/simpleflow.cpp.o
cmakeFiles/opencv_video.dir/src/tvl1flow.cpp.o
cmakeFiles/opencv_video.dir/src/video_init.cpp.o ../../lib/libopencv_core.2.4.6.dylib ../../lib/libopencv_imgproc.2.4.6.dylib -framework OpenCL ../../lib/libopencv_core.2.4.6.dylib /usr/lib/libz.dylib -framework OpenCL 
cd /tmp/opencv-IuRF/opencv-2.4.6.1/macbuild/modules/video && /usr/local/Cellar/cmake/2.8.12/bin/cmake -E
cmake_symlink_library ../../lib/libopencv_video.2.4.6.dylib ../../lib/libopencv_video.2.4.dylib ../../lib/libopencv_video.dylib
/usr/local/Cellar/cmake/2.8.12/bin/cmake -E
cmake_progress_report /tmp/opencv-IuRF/opencv-2.4.6.1/macbuild/CMakeFiles  97 98
[ 42%] Built target opencv_video
make: *** [all] Error 2


/usr/local/Library/Homebrew/formula.rb:606:in `system'
/usr/local/Library/Formula/opencv.rb:60:in `install'
/usr/local/Library/Homebrew/extend/fileutils.rb:33:in `mkdir'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:121:in `chdir'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:121:in `chdir'
/usr/local/Library/Homebrew/extend/fileutils.rb:32:in `mkdir'
/usr/local/Library/Formula/opencv.rb:58:in `install'
/usr/local/Library/Homebrew/build.rb:165:in `install'
/usr/local/Library/Homebrew/formula.rb:266:in `brew'
/usr/local/Library/Homebrew/formula.rb:617:in `stage'
/usr/local/Library/Homebrew/resource.rb:56:in `stage'
/usr/local/Library/Homebrew/extend/fileutils.rb:21:in `mktemp'
/usr/local/Library/Homebrew/resource.rb:53:in `stage'
(__FORWARDABLE__):3:in `__send__'
(__FORWARDABLE__):3:in `stage'
/usr/local/Library/Homebrew/formula.rb:615:in `stage'
/usr/local/Library/Homebrew/formula.rb:261:in `brew'
/usr/local/Library/Homebrew/build.rb:144:in `install'
/usr/local/Library/Homebrew/build.rb:45:in `main'
/usr/local/Library/Homebrew/build.rb:12
/usr/local/Library/Formula/opencv.rb:66e here

2 个答案:

答案 0 :(得分:0)

如果你还没有使用它,请尝试使用brew安装的python。或者将env设置为标准。

我是git我的编译aok,这是我的脚本(我用ffmpeg链接视频写作)

我的问题是从nodejs链接到它,有一些用于在10.8x中工作的链接。

require 'formula'

class Opencv < Formula
  homepage 'http://opencv.org/'
  url 'http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.6.1/opencv-2.4.6.1.tar.gz'
  sha1 'e015bd67218844b38daf3cea8aab505b592a66c0'

  option '64-bit'
  option 'with-qt',  'Build the Qt4 backend to HighGUI'
  option 'with-tbb', 'Enable parallel code in OpenCV using Intel TBB'
  # option 'without-opencl', 'Disable gpu code in OpenCV using OpenCL'
  option 'with-opencl', 'enable gpu code in OpenCV using OpenCL'
  option 'with-ffmpeg', 'enable ffmpeg'

  depends_on 'cmake' => :build
  depends_on 'pkg-config' => :build
  depends_on 'numpy' => :python
  depends_on :python

  depends_on 'eigen'   => :optional
  depends_on 'libtiff' => :optional
  depends_on 'jasper'  => :optional
  depends_on 'tbb'     => :optional
  depends_on 'qt'      => :optional
  depends_on :libpng

  # Can also depend on ffmpeg, but this pulls in a lot of extra stuff that
  # you don't need unless you're doing video analysis, and some of it isn't
  # in Homebrew anyway. Will depend on openexr if it's installed.
  depends_on 'ffmpeglatest'

  def install
    args = std_cmake_args + %W[
      -DCMAKE_OSX_DEPLOYMENT_TARGET=
      -DWITH_CUDA=OFF
      -DBUILD_ZLIB=OFF
      -DBUILD_TIFF=OFF
      -DBUILD_PNG=OFF
      -DBUILD_JPEG=OFF
      -DBUILD_JASPER=OFF
      -DBUILD_TESTS=OFF
      -DBUILD_PERF_TESTS=OFF
      -DPYTHON_INCLUDE_DIR='#{python.incdir}'
      -DPYTHON_LIBRARY='#{python.libdir}/lib#{python.xy}.dylib'
      -DPYTHON_EXECUTABLE='#{python.binary}'
    ]

    if build.build_32_bit?
      args << "-DCMAKE_OSX_ARCHITECTURES=i386"
      args << "-DOPENCV_EXTRA_C_FLAGS='-arch i386 -m32'"
      args << "-DOPENCV_EXTRA_CXX_FLAGS='-arch i386 -m32'"
    end
    args << '-DWITH_QT=ON' if build.with? 'qt'
    args << '-DWITH_TBB=ON' if build.with? 'tbb'
    # OpenCL 1.1 is required, but Snow Leopard and older come with 1.0
    # args << '-DWITH_OPENCL=OFF' if build.without? 'opencl' or MacOS.version < :lion
    # args << '-DWITH_FFMPEG=OFF' unless build.with? 'ffmpeg'

    args << '..'
    mkdir 'macbuild' do
      system 'cmake', *args
      system "make"
      system "make install"
    end
  end


  def caveats
    python.standard_caveats if python
  end
end

答案 1 :(得分:0)

你可以尝试从自制软件安装opencv,我在10.9中遇到了与cmake相同的问题,最后我找到了Chris Muktar的解决方案。以下是步骤:

  1. 确保已安装xcode-select --install Xcode命令行工具5.0.1。
  2. 使用brew - brew install python安装python。
  3. pip update
  4. pip install numpy
  5. brew linkapps
  6. 添加导出PYTHONPATH = / usr / local / Cellar / opencv / 2.4.6.1 / lib / python2.7 / site-packages:$ PYTHONPATH to .bash_profile
  7. brew install opencv
  8. 在最后一步中,我遇到了错误:opencv没有可用的公式。在这种情况下,您应该首先运行命令brew tap homebrew / science。

    祝你好运