Disable OpenCL in OpenCV completely

asked 2015-06-11 03:27:29 -0600

(This is a crossposting of http://stackoverflow.com/questions/30..., which did not receive any replies by the time of asking this question)

I want to build a static version of OpenCV (3) with OpenCL disabled. To do so, I am using

cmake -D WITH_OPENCL=OFF -D BUILD_SHARED_LIBS=OFF

when compiling OpenCV, among other parameters (which disable other modules that I don't need). The output of the cmake call includes the following line

-- Use OpenCL: NO

which, if I understand it correctly, means that OpenCL is disabled.

Now, when linking against the compiled version of OpenCV, I get the following message (I redacted the path):

[Redacted]/lib/libopencv_core.a(ocl.cpp.o): In function `initOpenCLAndLoad': ocl.cpp:(.text.initOpenCLAndLoad+0x2b): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

I am aware of what the message means, but I am confused by its source - why is there OpenCL-invoking code in the compiled OpenCV library? Is there any other option that I need to set so that OpenCL is disabled completely?

Thank you and best regards

edit retag flag offensive close merge delete