Problem Description
During the OpenCV build process using CMake, the script attempts to download the Intel Integrated Performance Primitives (IPP) library file (e.g., ippicv_2019_lnx_intel64_general_20180723.tgz). Network restrictions often cause this download to fail, halting the configuration.
Solution: Manual Download and Local Configuration
The process involves locating the correct file URL from OpenCV's source, downloading it manually, and instructing CMake to use the local file.
Step 1: Locate the Download URL within OpenCV Source
The required information is contained within the ippicv.cmake file, typically found at opencv_source/3rdparty/ippicv/ippicv.cmake.
Open this file and identify the following variables:
# Example variables (actual values depend on your OpenCV version):
set(IPPICV_COMMIT "a62e20676a60ee0ad6581e217fe7e4bada3b95db")
set(OPENCV_IPPICV_URL "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/")
# For a Linux 64-bit system:
set(OPENCV_ICV_NAME "ippicv_2019_lnx_intel64_general_20180723.tgz")
Construct the full download URL by combining these elements:
https://raw.githubusercontent.com/opencv/opencv_3rdparty/[IPPICV_COMMIT]/ippicv/[OPENCV_ICV_NAME]
Alternative, you can browse the OpenCV 3rdparty repository on GitHub (https://github.com/opencv/opencv_3rdparty), navigate to the branch or commit referenced by IPPICV_COMMIT, and find the file in the ippicv/ directory.
Step 2: Download the IPP File
Use the constructed URL or the GitHub interface to download the correct .tgz file to a known location on your local machine (e.g., /home/user/downloads/).
Step 3: Modify the CMake Script
Edit the ippicv.cmake file. Locate the line defining OPENCV_IPPICV_URL (often around line 47). Change it from the GitHub URL to a local file protocol URL pointing to the *directory* containing your downloaded file.
# Original line (example):
set(OPENCV_IPPICV_URL "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/")
# Modified line (use the actual path to your file's parent directory):
set(OPENCV_IPPICV_URL "file:///home/user/downloads/")
Ensure the path uses three forward slashes after file: and ends with a trailing slash.
Step 4: Re-run CMake
Return to you're OpenCV build directory and re-run the CMake configuration command. The script should now read the IPP library from your specified local path instead of attempting to download it.