Ask Your Question
1

Make failed on Linux Mint 15: filtering.cpp reference opencl_kernels.hpp

asked 2013-12-04 09:26:32 -0600

latki8 gravatar image

I followed the procedure to install OpenCV laid out in link text

I pre-installed only those items shown as required and downloaded the stable version of OpenCV using the link on the page.

When I issued the 'make' command, the final part of the output was:

Linking CXX static library ../../lib/libopencv_ocl_pch_dephelp.a
[ 74%] Built target opencv_ocl_pch_dephelp
Scanning dependencies of target pch_Generate_opencv_ocl
[ 74%] Generating precomp.hpp
[ 74%] Generating precomp.hpp.gch/opencv_ocl_RELEASE.gch
[ 74%] Built target pch_Generate_opencv_ocl
[ 74%] Generating opencl_kernels.cpp, opencl_kernels.hpp
Scanning dependencies of target opencv_ocl
[ 74%] Building CXX object modules/ocl/CMakeFiles/opencv_ocl.dir/src/filtering.cpp.o
/home/spearmint/Software/OpenCV Software/opencv-2.4.7/modules/ocl/src/filtering.cpp:52:30: fatal error: opencl_kernels.hpp: No such file or directory
compilation terminated.
make[2]: *** [modules/ocl/CMakeFiles/opencv_ocl.dir/src/filtering.cpp.o] Error 1
make[1]: *** [modules/ocl/CMakeFiles/opencv_ocl.dir/all] Error 2
make: *** [all] Error 2

The module filtering.cpp contains:

#include "precomp.hpp"
#include "opencl_kernels.hpp"

Can anyone tell me what I need to do to resolve this problem?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2013-12-14 21:17:56 -0600

lvjing gravatar image

updated 2013-12-14 21:30:10 -0600

this is a very interesting problem, I met this totally same with your. but after my checking

the directory tree of opencv_dir I found the key of it.

Originally I wanted to install my opencv in directory "Program files", but it came with the

bove problem same with your. So i go and check my directory tree occasionally and find a strange directory named "Program\ files" created when making opencv, so i click in, and i find the missing files "opencl_kernels.hpp" and anothor file also, so I move them to .../opencv- 2.4.7/modules/ocl/src/ , and then make again ,finally the error gone.

So I am sure the problem of you is something with your directory path, and I see your path have

a directory named "OpenCV Software", this is the problem. So please make sure the path to opencv installed do not contain any blank char, you can change "OpenCV Software" to "OpenCV_Software" and so on.

Another way to slove tht problem is just like the way I deal with my problem, find the files

and move them to the required path, but this is not recommended, because when make again it will still turn out several time for opencv make other modules..

edit flag offensive delete link more

Comments

Thank you for this. I did notice an Opencv\ directory at the same level as Opencv but didn't realise the significance. I've marked this as the correct answer but I haven't tested it because I just gave up and decided to use PyGame instead for now. I might give it another go when I've got time.

latki8 gravatar imagelatki8 ( 2014-01-12 11:39:30 -0600 )edit
0

answered 2014-01-02 14:54:06 -0600

Hello,

I have a similar problem: I am running the Make command in a Ubuntu 12.04 LTS virtual machine, and I followed all the installation instructions in the link mentioned above. The terminal response is as follows:

[ 62%] Built target opencv_ocl_pch_dephelp
Scanning dependencies of target pch_Generate_opencv_ocl
[ 62%] Generating precomp.hpp
[ 62%] Generating precomp.hpp.gch/opencv_ocl_RELEASE.gch
[ 62%] Built target pch_Generate_opencv_ocl
[ 62%] Generating opencl_kernels.cpp, opencl_kernels.hpp
Scanning dependencies of target opencv_ocl
[ 62%] Building CXX object modules/ocl/CMakeFiles/opencv_ocl.dir/src/mcwutil.cpp.o
[ 62%] Building CXX object modules/ocl/CMakeFiles/opencv_ocl.dir/src/blend.cpp.o
/home/nicoara/Desktop/face detection/opencv-2.4.8/modules/ocl/src/blend.cpp:47:30: fatal error: opencl_kernels.hpp: No such file or directory
compilation terminated.
make[2]: *** [modules/ocl/CMakeFiles/opencv_ocl.dir/src/blend.cpp.o] Error 1
make[1]: *** [modules/ocl/CMakeFiles/opencv_ocl.dir/all] Error 2
make: *** [all] Error 2

I tried finding a solution online but no luck. Searching for the file opencl_kernels.hpp returns no results. Do you have any suggestions?

Thanks,

Nicoara

edit flag offensive delete link more

Comments

Hello Nicoara,

As lvjing said. Check your directories. I see you have a directory named "face detection". Change it to "face_detection" or something with no spaces and try again.

I was having this same error today and lvjing's answer helped me.

Jolish gravatar imageJolish ( 2014-02-11 19:01:14 -0600 )edit

Question Tools

Stats

Asked: 2013-12-04 09:26:32 -0600

Seen: 3,346 times

Last updated: Feb 11 '14