OpenCL not found under ArchLinux (Bug #3140)
Description
Since v2.4.6 OpenCL isn't found anymore by the DetectOpenCL.cmake module on Arch Linux. Using the default OpenCL packages opencl-headers and libcl, the cl.h is located at /usr/include/CL and the library at /usr/lib/libOpenCL.so.
OCLROOT/AMDAPPSDKROOT/CUDA_PATH/INTELOCLSDKROOT were not defined, however that wasn't necessary before. Even when defining, eg. OCLROOT=/usr/include (so the OPENCL_ROOT_DIR is found) the opencl libraries are not found.
My workaround was removing the "NO_DEFAULT_PATH" argument for the "find_path" calls. Then OpenCL is correctly found.
I hope this gets fixed, as because of this the ocl module is currently missing in the official OpenCV package in Arch Linux.
Associated revisions
bugfix for OpenCL detection with Intel OpenCL SDK 1.2 on linux (Bug #3140)
Merge pull request #3140 from braindevices:master
History
Updated by Andrew Senin over 11 years ago
Hanno, thanks for posting this. We will try to solve it in one of the next releases. Also you are very welcome to provide a fix on your own. You contribution will be much appreciated!
- Assignee set to Roman Donchenko
- Target version set to 2.4.7
- Status changed from New to Open
Updated by Ray Rashif over 11 years ago
Hi guys
Is this really "Arch"-specific? Because 2.4.5 built the module and there has been no change to the library and header packages since then. According to the documentation [1] the module should build as long as the requirements are met and the switch is on.
There were minor changes to the cmake file after 2.4.5 (diff attached). Commit 108bb81 [2] is why the detection fails in 2.4.6, and I'm not sure whether something should be done here. The current workaround, as mentioned, is to revert this change.
It'd be good to know what sort of fix is recommended at the moment, if any. If there really haven't been reports from elsewhere (i.e. other distributions), we'd need to find out what's causing this on Arch Linux. Thanks for looking into this.
[1] https://github.com/Itseez/opencv/blob/master/modules/ocl/doc/introduction.rst
[2] https://github.com/Itseez/opencv/commit/108bb81/OpenCVDetectOpenCL.cmake
- File cldetect.diff added
Updated by Hartmut Seichter over 11 years ago
Ray Rashif wrote:
Hi guys
Is this really "Arch"-specific? Because 2.4.5 built the module and there has been no change to the library and header packages since then. According to the documentation [1] the module should build as long as the requirements are met and the switch is on.
Hi there, I was the one to report on Arch, but I can confirm that the same is true for Mac OS X 10.7+ which also comes with OpenCL headers. However, I haven't tried to recompile with the changes. I think as long as headers and libraries are available the module should be built. It is up to the end-user application to use introspection through ocl::getDevice to check if it is actually usable.
Just my 2ct
Updated by Ray Rashif over 11 years ago
Hartmut Seichter wrote:
Hi there, I was the one to report on Arch, but I can confirm that the same is true for Mac OS X 10.7+ which also comes with OpenCL headers. However, I haven't tried to recompile with the changes. I think as long as headers and libraries are available the module should be built. It is up to the end-user application to use introspection through ocl::getDevice to check if it is actually usable.
Just my 2ct
Yes, so the commit should break opencl support for everyone. Anyway, attached a patch to revert it verbatim, restoring the state of the cmake file for that particular part only. Temporary workaround until a better fix is found (that doesn't compromise the intent of the commit).
- File cldetect.patch added
Updated by Roman Donchenko over 11 years ago
Andrey, you added the NO_DEFAULT_PATH
thing, so you decide if we should remove it again. :-)
I, personally, think that we should, but I'm going to defer to you on this one.
- Assignee changed from Roman Donchenko to Andrey Pavlenko
Updated by Alexander Smorkalov over 11 years ago
@Andrey Pavlenko, any comments from your side?
- Affected version changed from 2.4.6 (latest release) to 2.4.0 - 2.4.6
Updated by Alexander Smorkalov over 11 years ago
- Target version changed from 2.4.7 to 2.4.8
Updated by Alexander Smorkalov about 11 years ago
- Target version changed from 2.4.8 to 2.4.9
Updated by Andrey Pavlenko almost 11 years ago
Since 2.4.7 OpenCV keeps OpenCL headers in the source tree, so there is no need in the OCL SDK on build system.
- Affected version changed from 2.4.0 - 2.4.6 to 2.4.0 - 2.4.7
- Status changed from Open to Done