Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable OpenCL in OpenCV completely

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

like image 704
Andreas Unterweger Avatar asked Jun 09 '15 09:06

Andreas Unterweger


1 Answers

OpenCV isn't very good at documenting its build options, but we can see them fairly well from their CMakeLists.txt:

https://github.com/Itseez/opencv/blob/master/CMakeLists.txt#L208

I would suggest turning off WITH_OPENCLAMDFFT, WITH_OPENCLAMDBLAS, and WITH_VA_INTEL as well.

like image 171
Chris Kitching Avatar answered Nov 03 '22 20:11

Chris Kitching