The code: https://github.com/enjalot/adventures_in_opencl/tree/master/part2/
From the README:
We demonstrate OpenCL and OpenGL context sharing by making a simple particle system.
Build: make a build directory and build the tutorial
mkdir build cd build cmake .. make
execute the example program
./part2.x
On cmake ..
had:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
...
GLEW_INCLUDE_PATH
...
GLEW_LIBRARY
According to ubuntuforum from 2009
changed GLEW_LIBRARY
to GLEW_LIBRARIES
in the CMakeLists.txt
.
The plural ending of the variable was present at all the rest of GET_...
variables in TARGET_LINK_LIBRARIES
.
Similar irregularity was present in GLEW_INCLUDE_PATH
-- the rest of INCLUDE_DIRECTORIES
had ..._DIR
instead of ...PATH
on the end.
Corrected that.
cmake ..
worked fine.
make
reported missing fatal error: GL/glew.h: No such file or directory
.
Found them (apt-file search GL/glew.h
) in libglew-dev
.
Installed it.
Now make
has lots of undefined reference to __glewBindBuffer
and alike.
Looking at title "Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)" of the issue,
and getting that headers were found, but the function definitions were not,
changed GLEW_LIBRARIES
back to GLEW_LIBRARY
in CMakeLists.txt
.
Compiled!
I guess it means the interoperability does not work.
In pyopencl (example from) the common opencl-opengl buffer could not be created.
On neither platform, on CPU and Intel's HD 4000 GPU.
Probably the interoperability does not work on the GPU?
HD 4000 is supported only with
beignet
(version 0.3 on Ubuntu 14.04).And probably the example selects some other platform.
(Currently there are 3: AMD's, Intel's and
beignet
by the name of "Experiment Intel Gen OCL Driver".)More output from setting the correct number (2) in
platforms(2)
call:Found one more hardcoded value for choice of the platform:
platforms[0]
in the code, if somebody is looking.Changed it to
beignet
(2).Output: