OpenCL not found under ArchLinux (Bug #3140)


Added by Hanno J. over 11 years ago. Updated almost 11 years ago.


Status:Done Start date:2013-07-08
Priority:Normal Due date:
Assignee:Andrey Pavlenko % Done:

0%

Category:build/install
Target version:2.4.9
Affected version:2.4.0 - 2.4.7 Operating System:Linux
Difficulty:Easy HW Platform:x64
Pull request:

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.


cldetect.diff - Diff between 2.4.5 and 2.4.6 of OpenCVDetectOpenCL.cmake (2 kB) Ray Rashif, 2013-07-09 11:09 pm

cldetect.patch - Patch against 2.6.4 sources (1003 Bytes) Ray Rashif, 2013-07-12 03:56 pm


Associated revisions

Revision 129f315f
Added by Denis Zaryaev over 11 years ago

bugfix for OpenCL detection with Intel OpenCL SDK 1.2 on linux (Bug #3140)

Revision decebeea
Added by Vadim Pisarevsky over 10 years ago

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

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).

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

Also available in: Atom PDF