CMake OpenCV 安装问题

app*_*ges 3 compiling opencv cmake software-installation

这让我在过去的三个小时里发疯了。我只是想安装CMake,然后安装OpenCV 3.1,但我得到一个Unsupported protocol错误(请参见下文)。

我安装了 CMake 3.4.3。像这样:

wget https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz
tar xf cmake-3.4.3.tar.gz
cd cmake-3.4.3
./configure
make
sudo make install
Run Code Online (Sandbox Code Playgroud)

然后运行这个:

./bootstrap --prefix=/usr
make
sudo make install
Run Code Online (Sandbox Code Playgroud)

在 OpenCV 的安装过程中运行此命令时出错:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..

这是我得到的确切错误:

CMake Warning at 3rdparty/ippicv/downloader.cmake:56 (message):
  ICV: Local copy of ICV package has invalid MD5 hash:
  d41d8cd98f00b204e9800998ecf8427e (expected:
  808b791a6eac9ed78d32a7666804320e)
Call Stack (most recent call first):
  3rdparty/ippicv/downloader.cmake:110 (_icv_downloader)
  cmake/OpenCVFindIPP.cmake:237 (include)
  cmake/OpenCVFindLibsPerf.cmake:12 (include)
  CMakeLists.txt:537 (include)


-- ICV: Downloading ippicv_linux_20151201.tgz...
CMake Error at 3rdparty/ippicv/downloader.cmake:73 (file):
  file DOWNLOAD HASH mismatch

    for file: [/home/ao/opt/opencv/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e/ippicv_linux_20151201.tgz]
      expected hash: [808b791a6eac9ed78d32a7666804320e]
        actual hash: [d41d8cd98f00b204e9800998ecf8427e]
             status: [1;"Unsupported protocol"]

Call Stack (most recent call first):
  3rdparty/ippicv/downloader.cmake:110 (_icv_downloader)
  cmake/OpenCVFindIPP.cmake:237 (include)
  cmake/OpenCVFindLibsPerf.cmake:12 (include)
  CMakeLists.txt:537 (include)


CMake Error at 3rdparty/ippicv/downloader.cmake:77 (message):
  ICV: Failed to download ICV package: ippicv_linux_20151201.tgz.
  Status=1;"Unsupported protocol"
Call Stack (most recent call first):
  3rdparty/ippicv/downloader.cmake:110 (_icv_downloader)
  cmake/OpenCVFindIPP.cmake:237 (include)
  cmake/OpenCVFindLibsPerf.cmake:12 (include)
  CMakeLists.txt:537 (include)
Run Code Online (Sandbox Code Playgroud)

所以显然存在哈希不匹配。我猜这是 CMake 的事情(也许我的安装不正确?)。我必须如何解决这个问题,安装 OpenCV 不可能那么难,对吧?

app*_*ges 7

我在此评论中找到了解决方案。基本上我只需要手动下载文件ippicv_linux_20151201.tgz(从这里)并将 zip 文件移动到正确的位置(/home/ao/opt/opencv/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e/)。

然后它可以编译:)