Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to build OpenCV on Ubuntu

📅 2013-Jul-17 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ build, opencv, ubuntu ⬩ 📚 Archive

$ mkdir build
$ cd build
$ cmake-gui ..
$ make

The build can take a long time, so you might want to run parallel builds:

$ make -j

Ensure there is nothing displayed in red color. If there is, note down the header file or library that is required and install those packages. Also ensure that all the options you chose have been chosen for build. Some of the features are inter-dependent and may not be built if their dependencies are not chosen.

Another technique is to go to the subdirectory containing the feature and look at the CMakeLists.txt file there. Look for the text REQUIRED_DEPS that shows what other OpenCV features need to be present for this feature to be built. Ensure those features are also chosen.

$ sudo make install

Tried with: OpenCV 2.4.9 and Ubuntu 14.04

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧