Compile OpenCV4

twitter logo github logo ・1 min read

Since OpenCV4 does not generata .pc file by default, we need to compile it from source and turn ont the OPENCV_GENERATE_PKGCONFIG option if other programs need the pkg-config file.

Another problem I encountered is a number of errors similar to undefined reference to TIFFReadRGBAStrip@LIBTIFF_4.0. To solve that, the BUILD_TIFF option needs to be turned on.

And following is the script for compilation and installation.

wget https://github.com/opencv/opencv/archive/4.1.0.zip
unzip opencv-4.1.0.zip
cd opencv-4.1.0
mkdir build && cd build
cmake -D CMAKE_BUILD_TYPE=Release -D OPENCV_GENERATE_PKGCONFIG=YES -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_TIFF=ON
sudo make -j`nproc`
sudo make install
twitter logo DISCUSS
Classic DEV Post from Aug 6 '18

Why Tech Projects Fail: Management, Planning, Process

Without good management, planning and process it is simply not possible to write good code and produce great products which is what all developers want to do.

Gabriel Wu profile image
A writer. Writing academic papers, blogs, codes, documents, essays, novels, poems, and translations.
  1. Follow languages 🤓
  2. Follow great devs 👋
  3. Stay in the loop
  4. Join Now