ocl module fails to compile on linux (Bug #2283)


Added by Andrey Gursky over 12 years ago. Updated over 12 years ago.


Status:Done Start date:2012-08-20
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:ocl
Target version:2.4.3-rc
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

1. The patch (http://code.opencv.org/projects/opencv/repository/revisions/2e685dcf0a74c185db1d7fdf5b460ecbba86dcc0/diff/modules/ocl/src/initialization.cpp) should be reverted, because the filenames on the git/disk are all lowercase. And they should be also the same lowercase in sources.

2. AutoLock should be made portable (it seems, there is already an implementation in core.hpp).

/home/andrey/Downloads/opencv/opencv/modules/ocl/src/initialization.cpp:778:32: error: no matching function for call to ‘cv::AutoLock::AutoLock(CriticalSection*)’
/home/andrey/Downloads/opencv/opencv/modules/ocl/src/initialization.cpp:778:32: note: candidates are:
In file included from /home/andrey/Downloads/opencv/opencv/modules/ocl/include/opencv2/ocl/ocl.hpp:50:0,
                 from /home/andrey/Downloads/opencv/opencv/modules/ocl/src/precomp.hpp:66,
                 from /home/andrey/Downloads/opencv/opencv/modules/ocl/src/initialization.cpp:46:
/home/andrey/Downloads/opencv/opencv/modules/core/include/opencv2/core/core.hpp:4645:5: note: cv::AutoLock::AutoLock(cv::Mutex&)
/home/andrey/Downloads/opencv/opencv/modules/core/include/opencv2/core/core.hpp:4645:5: note:   no known conversion for argument 1 from ‘CriticalSection*’ to ‘cv::Mutex&’
/home/andrey/Downloads/opencv/opencv/modules/core/include/opencv2/core/core.hpp:4642:18: note: cv::AutoLock::AutoLock(const cv::AutoLock&)
/home/andrey/Downloads/opencv/opencv/modules/core/include/opencv2/core/core.hpp:4642:18: note:   no known conversion for argument 1 from ‘CriticalSection*’ to ‘const cv::AutoLock&’
/home/andrey/Downloads/opencv/opencv/modules/ocl/src/initialization.cpp: In member function ‘cv::ocl::Info& cv::ocl::Info::operator=(const cv::ocl::Info&)’:
/home/andrey/Downloads/opencv/opencv/modules/ocl/src/initialization.cpp:886:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
make[2]: *** [modules/ocl/CMakeFiles/opencv_ocl.dir/src/initialization.cpp.o] Error 1
make[2]: Leaving directory `/home/andrey/Downloads/opencv/build'
make[1]: *** [modules/ocl/CMakeFiles/opencv_ocl.dir/all] Error 2
make[1]: Leaving directory `/home/andrey/Downloads/opencv/build'
make: *** [all] Error 2
andrey@debian:~/Downloads/opencv/build$

Thanks,
Andrey


History

Updated by Andrey Gursky over 12 years ago

Regarding the 2. part. Surrounding the code in threadsafe.cpp and .h with

namespace cv {
  namespace ocl {
    ...
  }
}

resolves the compilation problem.

Nevertheless what about using the existent AutoLock class in opencv?

Updated by Andrey Kamaev over 12 years ago

  • Description changed from 1. The patch (http://code.opencv.org/projects/opencv/repository/revisions/2e6... to 1. The patch (http://code.opencv.org/projects/opencv/repository/revisions/2e6... More

Updated by Vadim Pisarevsky over 12 years ago

  • Target version deleted (3.0)
  • Assignee deleted (yao wang)

Updated by Kirill Kornyakov over 12 years ago

  • Target version set to Next Hackathon

Updated by Vadim Pisarevsky over 12 years ago

ok. In 2.4.3rc OpenCL module builds fine with Intel SDK.

test box:
Ubuntu 12.10
Intel SDK, downloaded from Intel site and manually unpacked to /usr/local.

In CMake GUI, OPENCL_INCLUDE_DIR is automatically set to the correct /usr/local/include, OPENCL_LIBRARY is manually set to /usr/local/lib/OpenCL/vendors/intel/libintelocl.so.
Then it builds fine. If, with another SDK, it does not build, manually set the correct OPENCL_INCLUDE_DIR and OPENCL_LIBRARY.

Unfortunately, ocl module does not support CPUs for now, it's not an easy task to fix that; postponed till OpenCV 2.5

  • Assignee set to Vadim Pisarevsky
  • Status changed from Open to Done
  • Target version changed from Next Hackathon to 2.4.3-rc

Also available in: Atom PDF