我正在使用Centos 7.2。我尝试使用opencv
编译并安装cmake
。
我运行这些命令:
git clone https://github.com/opencv/opencv
cd opencv
mkdir -p build
cd build
运行命令时会出现问题:
cmake -D BUILD_opencv_gpu=OFF -D WITH_EIGEN=ON -D WITH_TBB=ON -D WITH_CUDA=OFF -D WITH_1394=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/ghome/mypath/software/try_opencv/installed ..
我尝试了很多解决方案,例如下载最新版本,使用-D BUILD_opencv_ts=0
进行编译。但它们都没有帮助。
我已经陷入这个问题几个小时了,我无法解决它。问题消息如下:
-- Detected version of GNU GCC: 48 (408)
-- FP16: Feature disabled
-- Found ZLIB: /lib64/libz.so (found suitable version "1.2.7", minimum required is "1.2.3")
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR)
-- Found ZLIB: /lib64/libz.so (found version "1.2.7")
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
-- Checking for module 'gtk+-3.0'
-- No package 'gtk+-3.0' found
-- Checking for module 'gtk+-2.0'
-- No package 'gtk+-2.0' found
-- Checking for module 'gstreamer-base-1.0'
-- No package 'gstreamer-base-1.0' found
-- Checking for module 'gstreamer-video-1.0'
-- No package 'gstreamer-video-1.0' found
-- Checking for module 'gstreamer-app-1.0'
-- No package 'gstreamer-app-1.0' found
-- Checking for module 'gstreamer-riff-1.0'
-- No package 'gstreamer-riff-1.0' found
-- Checking for module 'gstreamer-pbutils-1.0'
-- No package 'gstreamer-pbutils-1.0' found
-- Checking for module 'gstreamer-base-0.10'
-- No package 'gstreamer-base-0.10' found
-- Checking for module 'gstreamer-video-0.10'
-- No package 'gstreamer-video-0.10' found
-- Checking for module 'gstreamer-app-0.10'
-- No package 'gstreamer-app-0.10' found
-- Checking for module 'gstreamer-riff-0.10'
-- No package 'gstreamer-riff-0.10' found
-- Checking for module 'gstreamer-pbutils-0.10'
-- No package 'gstreamer-pbutils-0.10' found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Checking for modules 'libavcodec;libavformat;libavutil;libswscale'
-- No package 'libavcodec' found
-- No package 'libavformat' found
-- No package 'libavutil' found
-- No package 'libswscale' found
-- Checking for module 'libavresample'
-- No package 'libavresample' found
-- Checking for module 'libgphoto2'
-- No package 'libgphoto2' found
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:243 (include)
cmake/OpenCVFindLibsPerf.cmake:37 (include)
CMakeLists.txt:567 (include)
-- ICV: Downloading ippicv_linux_20151201.tgz...
CMake Error at 3rdparty/ippicv/downloader.cmake:73 (file):
file DOWNLOAD HASH mismatch
for file: [/ghome/mypath/software/try_opencv/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:243 (include)
cmake/OpenCVFindLibsPerf.cmake:37 (include)
CMakeLists.txt:567 (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:243 (include)
cmake/OpenCVFindLibsPerf.cmake:37 (include)
CMakeLists.txt:567 (include)
-- Configuring incomplete, errors occurred!
See also "/ghome/mypath/software/try_opencv/opencv/build/CMakeFiles/CMakeOutput.log".
See also "/ghome/mypath/software/try_opencv/opencv/build/CMakeFiles/CMakeError.log".
谢谢大家的帮助!!!
答案 0 :(得分:0)
由于在下载ippicv时出现错误,如果您不严格需要,可以在cmake配置行中添加-D WITH_IPP=OFF
来禁用它。
提出了一个非常相似的问题here。
也可能是更新CMake可能会解决问题。为此,如果您在Linux环境中,请考虑this guide。