Cmake not configuring , showing file download HASH MISMATCH error while installing opencv(3.2.0) on ubuntu 18.04 - opencv

I am installing ros melodic with opencv(3.2.0) on ubuntu 18.04. the ros installation is proper. But im getting stuck in the opencv installation, at the part where you configure cmake.its giving a hash mismatch error
ICV: Downloading ippicv_linux_20151201.tgz...
CMake Error at 3rdparty/ippicv/downloader.cmake:73 (file):
file DOWNLOAD HASH mismatch
for file: [/home/anirudh/opencv-3.2.0/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e/ippicv_linux_20151201.tgz]
expected hash: [808b791a6eac9ed78d32a7666804320e]
actual hash: [d41d8cd98f00b204e9800998ecf8427e]
status: [7;"Couldn't connect to server"]
and when i scroll down theres a line that says:
CMake Error at 3rdparty/ippicv/downloader.cmake:77 (message):
ICV: Failed to download ICV package: ippicv_linux_20151201.tgz.
Status=7;"Couldn't connect to server"
This is the command that i ran with the full errors:
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
How to fix it?
I tried running another command:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
> -D CMAKE_INSTALL_PREFIX=/usr/local \
> -D INSTALL_C_EXAMPLES=ON \
> -D INSTALL_PYTHON_EXAMPLES=ON \
> -D OPENCV_GENERATE_PKGCONFIG=ON \
> -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
> -D BUILD_EXAMPLES=ON ..
But that too gave the same output with the errors

Related

Error compiling openCV 4.1.2 with CUDA 9.0 in Ubuntu 16.04

Here's my cmake command:
cmake -D CMAKE_BUILD_TYPE=DEBUG\
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D CUDA_ARCH_BIN="6.1" \
-D WITH_TBB=ON \
-D WITH_CUDA=ON \
-D BUILD_opencv_cudacodec=OFF \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D WITH_V4L=ON \
-D WITH_QT=OFF \
-D WITH_OPENGL=ON \
-D WITH_GSTREAMER=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_PC_FILE_NAME=opencv.pc \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_PYTHON3_INSTALL_PATH=~/venv/lib/python3.5/site-packages \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv/opencv_contrib/modules \
-D PYTHON_EXECUTABLE=~/venv/bin/python \
-D PYTHON_DEFAULT_EXECUTABLE=~/venv/bin/python3.5 \
-D BUILD_EXAMPLES=ON ..
Configuring and generating are successful. However, when I tried to compile it. This error appears:
...
/home/jaylo/opencv/modules/dnn/src/cuda/math.hpp(30): error: no operator "+" matches these operands
operand types are: __half2 + __half2
/home/jaylo/opencv/modules/dnn/src/cuda/math.hpp(54): error: no operator "+" matches these operands
operand types are: __half2 + __half2
/home/jaylo/opencv/modules/dnn/src/cuda/math.hpp(119): error: no operator "+" matches these operands
operand types are: __half2 + __half2
3 errors detected in the compilation of "/tmp/tmpxft_000048a8_00000000-6_activations.cpp1.ii".
CMake Error at cuda_compile_1_generated_activations.cu.o.DEBUG-D.cmake:281 (message):
Error generating file
/home/jaylo/opencv/build/modules/dnn/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_activations.cu.o
modules/dnn/CMakeFiles/opencv_dnn.dir/build.make:434: recipe for target 'modules/dnn/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_activations.cu.o' failed
make[2]: *** [modules/dnn/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_activations.cu.o] Error 1
CMakeFiles/Makefile2:4972: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/all' failed
make[1]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
What is happening here? It seems that it's a syntax error of the openCV code itself.
CUDA 10.0 added native vector arithmetic operators for the __half2 datatype. The CUDA backend for OpenCV DNN makes use of the aforementioned built-in operators.
You will either have to upgrade to CUDA 10.0 to use the CUDA backend of OpenCV DNN or disable it by unmarking OPENCV_DNN_CUDA in CMake options.
Note: The CUDA backend for OpenCV DNN was merged into master a few weeks ago and is not in any release yet. I suspect you have built the master branch instead of OpenCV 4.1.2.
Turns out that using openCV 4.1.0 solves the problem.

how to Install OpenCv on my home directory in Ubuntu

I am trying to compile and install OpenCV on my home directory (so I can have several versions installed)
I have this option when I am calling cmak:
-D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/mans/local/opencv -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_INF_ENGINE=ON -D ENABLE_CXX11=ON
but when I build the code and try to install it, I am getting this error:
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:41 (file):
file cannot create directory: /usr/local/share/licenses/opencv4. Maybe
need administrative privileges.
Makefile:61: recipe for target 'install' failed
make: *** [install] Error 1
As I want to install on my home directory, I can not use
sudo make install
as it will install openCV on root and I don't want to do this.
Edit
I am using this bash script to build and install OpenCV from git repository.
WITH_INF_ENGINE=true # should be buildwith Intel Inference Engineen
workingDir="$HOME/local"
downloadDir="$workingDir/downloadedFiles"
if [ ! -d "$workingDir" ]; then
mkdir "$workingDir"
fi
cd $workingDir
git clone https://github.com/opencv/opencv $downloadDir/opencv
cd $downloadDir/opencv
mkdir build
cd build
cmakeParameters="-D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=$workingDir/opencv -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON "
if $WITH_INF_ENGINE; then
source /opt/intel/computer_vision_sdk/bin/setupvars.sh
cmakeParameters="$cmakeParameters -D WITH_INF_ENGINE=ON -D ENABLE_CXX11=ON"
fi
echo "$cmakeParameters"
cmake "$cmakeParameters" ..
make -j $(nproc)
make install

Getting CMake Error with Protobuf Library in the configuration of OpenCV in Raspberry Pi

I followed this tutorial to install OpenCV and all the steps worked until I reached the Install part. I did the following:
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \
-D BUILD_EXAMPLES=ON ..
The command performed several tests and showed the General configuration for OpenCV 3.3.0 but at the end I got the following error:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Protobuf_LIBRARY
linked by target "opencv_dnn_modern" in directory /home/pi/opencv_contrib-3.3.0/modules/dnn_modern
-- Configuring incomplete, errors occurred!
See also "/home/pi/opencv-3.3.0/build/CMakeFiles/CMakeOutput.log".
See also "/home/pi/opencv-3.3.0/build/CMakeFiles/CMakeError.log".
I have a opencv_contrib-3.3.0 directory though instead of opencv_contrib that's why I included the -3.3.0 in the make.
I solved the issue through the following steps:
Deleting the build folder in the opencv directory
Recreating the build folder: mkdir build
Moving to that build directory: cd build
Adding the following line in the make: -D BUILD_opencv_dnn_modern=OFF
and running it as follows:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_opencv_dnn_modern=OFF \
-D ENABLE_NEON=ON \
-D ENABLE_VFPV3=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \
-D BUILD_EXAMPLES=ON ..

Can't install cmake on Ubuntu(build error)

I tried to install opencv(3.1.0) on Ubuntu 12.06. What does this error mean? Is observed for OpenCV modules second time? How can I fix it?
Env Var setup
cmake
-D CMAKE_BUILD_TYPE=RELEASE
-D ENABLE_PRECOMPILED_HEADERS=OFF
-D CMAKE_INSTALL_PREFIX=/usr/local
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules
-D BUILD_NEW_PYTHON_SUPPORT=ON
-D WITH_TBB=ON
-D WITH_QT=ON
-D WITH_OPENGL=ON
-D BUILD_TIFF=ON
-D BUILD_SHARED_LIBS=ON
-D BUILD_EXAMPLES=ON
-D BUILD_opencv_ts=ON
CMake Error at cmake/OpenCVModule.cmake:268 (message):
The directory /home/user/bin/opencv/modules is observed for OpenCV
modules second time.
Call Stack (most recent call first):
modules/CMakeLists.txt:7 (ocv_glob_modules)
This issue is already raised on OpenCV GitHub Page :
ts module not installed
Hope that helps.

issues in installing opencv

i wanted to compile the Opencv for the first using the following commands
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.1.0/modules \
-D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python \
-D BUILD_EXAMPLES=ON ..
but i am getting the following error
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:128 (project):
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/home/siddhartha/opencv-3.3.0/build/CMakeFiles/CMakeOutput.log".
See also "/home/siddhartha/opencv-3.3.0/build/CMakeFiles/CMakeError.log".
(cv) siddhartha#wipro:~/opencv-3.3.0/build$
anyone has any idea how to solve this issue .

Resources