Building OpenCV 3.4. only Core module without OpenCL [closed]

asked 2018-03-07 12:23:31 -0500


I try to build a minimal OpenCV core library without OpenCL use.

In cvconfig.h the #define HAVE_OPENCL is commented out.

I see e.g. in core/src/matrix_operations.cpp some functions wrapped by #ifdef HAVE_OPENCL, that's ok. But some are not but use OpenCL, e.g.

#include "opencl_kernels_core.hpp" // does not exist, so I commented it out

approx. line 960:

void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype) .... CV_OCL_RUN(_dst.isUMat(), ocl_reduce(_src, _dst, dim, op, op0, stype, dtype))

Result is a compile error ocl_reduce not defined.

What is wrong here? Thanks a lot. which results in compile error

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2018-03-08 14:28:33.131793


"In cvconfig.h the #define HAVE_OPENCL is commented out. " -- that's too late.

you have to use the corresponding cmake options before, -DWITH_OPENCL=OFF , etc.

(also, good luck with that idea. they're an intel shop now, and opencl is their flagship)

berak gravatar imageberak ( 2018-03-07 12:26:01 -0500 )edit

Thanks, this works

karsten gravatar imagekarsten ( 2018-03-08 12:03:46 -0500 )edit