Not able to build openCV from source

[SOLVED]

Things i did.

  • Followed this guide OpenCV: Install OpenCV-Python in Ubuntu

  • Options i gave in cmake

    • In cmake, i turned off build for opencv_gapi
      (since make command was failing at building opencv_gapi)
    • I wanted to build opencv for python3 , so in cmake command i gave this option (check python3 full path with this command which python3)
    • cmake command

    cmake -DBUILD_opencv_gapi:BOOL=OFF -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 ../

  • Delete opencv clone and download new clone whenever possible(I think this was one of the reason why make command was failing at same percentage, even after giving different options. But I don’t know for sure).

  • Try increasing RAM and disk size

  • Additional information