PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Building opencv is failing with a make error

Sat Sep 28, 2013 8:20 am

Hi all,

I am trying to build opencv on the raspberry pi B running raspbian (Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux). I am following the instructions at
http://ariandy1.wordpress.com/2013/02/1 ... an-opencv/
The build process stops at about 60%. The log of the make process is below. How do I compile opencv on the raspberry pi?

[ 59%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_objdetect.
cpp.o
[ 60%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_matop.cpp.
o
[ 60%] Building CXX object modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_imgproc.cp
p.o
Linking CXX executable ../../bin/opencv_perf_gpu
[ 60%] Built target opencv_perf_gpu
Scanning dependencies of target opencv_test_gpu
[ 60%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/main.cpp.o
[ 60%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_nvidia.cpp
.o
[ 60%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_resize.cpp
.o
[ 60%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_imgproc.cp
p.o
[email protected]:/usr/src/OpenCV-2.4.2/build#


Pranav

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: Building opencv is failing with a make error

Mon Sep 30, 2013 5:26 pm

Have a look at this post....
http://www.raspberrypi.org/phpBB3/viewt ... cv#p402953
...took a while but installed okay.

Dave.
Apple say... Monkey do !!

PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Re: Building opencv is failing with a make error

Mon Sep 30, 2013 11:35 pm

Hi Dave,
Many thanks for the link. It explains how to install opencv on Ubuntu. I have opencv working on Ubuntu but not on Raspbian.

Pranav

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: Building opencv is failing with a make error

Wed Oct 02, 2013 6:28 pm

Sorry, wrong link, try this...
http://mitchtech.net/raspberry-pi-opencv/

That's what I used to install on wheezy.
Dave.
Apple say... Monkey do !!

PranavLal
Posts: 124
Joined: Fri Jun 28, 2013 4:49 pm

Re: Building opencv is failing with a make error

Thu Oct 03, 2013 12:22 am

Hi David,
Thanks for this link. I had already consulted it and keep running into the make errors. As far as I can tell, all dependencies are installed.

I have however installed opencv on arch Linux which is meeting my needs though I am more comfortable using raspbian and would prefer to resolve this.

Pranav

warrens
Posts: 5
Joined: Tue Dec 03, 2013 9:19 pm

Re: Building opencv is failing with a make error

Tue Dec 03, 2013 9:26 pm

I was having trouble making OpenCV on the Pi, with an internal compiler error about 60% thru the build, but I upgraded gcc to version 4.7 (from 4.6) and the build then succeeded.

Also, I am using a 16GB card, rather than the 4GB card that came with the kit, because otherwise it would run out of space.

warrens
Posts: 5
Joined: Tue Dec 03, 2013 9:19 pm

Re: Building opencv is failing with a make error

Wed Dec 04, 2013 10:52 am

The problem now is that none of the examples seem to run.

Here is an error example:

./cpp-example-drawing
This program demonstrates OpenCV drawing and text output functions.
Usage:
./drawing
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /home/pi/opencv-2.4.7/modules/highgui/src/window.cpp, line 501
terminate called after throwing an instance of 'cv::Exception'
what(): /home/pi/opencv-2.4.7/modules/highgui/src/window.cpp:501: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage

Aborted

User avatar
DougieLawson
Posts: 35163
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Building opencv is failing with a make error

Wed Dec 04, 2013 12:09 pm

Raspbian is a flavour of Debian so you can follow the instructions.
(The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script)
apt-get install libgtk2.0-dev pkg-config
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

warrens
Posts: 5
Joined: Tue Dec 03, 2013 9:19 pm

Re: Building opencv is failing with a make error

Thu Dec 05, 2013 8:34 am

Thanks a bunch for that. The high school robotics team is waiting to get started on getting some vision based targeting for their new bot.

The command seemed to mostly succeed. There was one failure.
Failed to fetch http://mirrordirector.raspbian.org/rasp ... _armhf.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
So now run make again (actually "make -B"), or do I need to go back and re-build the make files again using cmake?

warrens
Posts: 5
Joined: Tue Dec 03, 2013 9:19 pm

Re: Building opencv is failing with a make error

Thu Dec 05, 2013 8:34 pm

I rebuilt, but get the same error.

warrens
Posts: 5
Joined: Tue Dec 03, 2013 9:19 pm

Re: Building opencv is failing with a make error

Fri Dec 06, 2013 7:43 pm

"sudo" in front of that command made a BIG difference.

The make took over 11 hours, rather than the previous 6 hours, and the OpenCV examples now work!

The key (I think) is making sure that the GUI support says "YES" before the make -- specifically the GTK support.

mattvenn
Posts: 24
Joined: Wed Jul 25, 2012 9:59 am

Re: Building opencv is failing with a make error

Tue Mar 18, 2014 10:40 am

It was failing for me with an internal compiler error. It was because memory had run out. I switched to a 512MB pi and changed the gpu mem share and that fixed it.
Matt

Return to “C/C++”