PDA

View Full Version : Problem building OpenCL with Mingw



maissiou23
22nd March 2012, 06:55
Hi,

I am trying to build QtOpenCL from git using Qt Creator 2.4.1 using:



cd C:\OpenCL
qmake opencl.pro
mingw32-make



Unfortunately, I am getting the error you can see here:



qclkernel.h:368: error: 'm_kernelId' was not declared in this scope
qclkernel.h:368: error: 'clSetKernelArg' was not declared in this scope
qclkernel.h: In member function 'void QCLKernel::setArg(int, const QVector4D&)':

qclkernel.h:374: error: 'm_kernelId' was not declared in this scope
qclkernel.h:374: error: 'clSetKernelArg' was not declared in this scope
qclkernel.h:377: error: 'm_kernelId' was not declared in this scope
qclkernel.h:377: error: 'clSetKernelArg' was not declared in this scope
qclkernel.h: In member function 'void QCLKernel::setArg(int, const QPoint&)':
qclkernel.h:383: error: 'cl_int' was not declared in this scope
qclkernel.h:383: error: expected ';' before 'values'
qclkernel.h:384: error: 'm_kernelId' was not declared in this scope
qclkernel.h:384: error: 'values' was not declared in this scope
qclkernel.h:384: error: 'clSetKernelArg' was not declared in this scope
qclkernel.h: In member function 'void QCLKernel::setArg(int, const QPointF&)':
qclkernel.h:390: error: 'm_kernelId' was not declared in this scope
qclkernel.h:390: error: 'clSetKernelArg' was not declared in this scope
qclkernel.h:393: error: 'm_kernelId' was not declared in this scope
qclkernel.h:393: error: 'clSetKernelArg' was not declared in this scope
qclkernel.h: In member function 'void QCLKernel::setArg(int, const QCLMemoryObje
ct&)':
qclkernel.h:399: error: 'cl_mem' was not declared in this scope
qclkernel.h:399: error: expected ';' before 'id'
qclkernel.h:400: error: 'm_kernelId' was not declared in this scope
qclkernel.h:400: error: 'id' was not declared in this scope
qclkernel.h:400: error: 'clSetKernelArg' was not declared in this scope
qclkernel.h: In member function 'void QCLKernel::setArg(int, const QCLVectorBase
&)':
qclkernel.h:405: error: 'cl_mem' was not declared in this scope
qclkernel.h:405: error: expected ';' before 'id'
qclkernel.h:406: error: 'm_kernelId' was not declared in this scope
qclkernel.h:406: error: 'id' was not declared in this scope
qclkernel.h:406: error: 'clSetKernelArg' was not declared in this scope
qclkernel.h: In member function 'void QCLKernel::setArg(int, const QCLSampler&)'
:
qclkernel.h:411: error: 'cl_sampler' was not declared in this scope
qclkernel.h:411: error: expected ';' before 'id'
qclkernel.h:412: error: 'm_kernelId' was not declared in this scope
qclkernel.h:412: error: 'id' was not declared in this scope
qclkernel.h:412: error: 'clSetKernelArg' was not declared in this scope
qclkernel.h: In member function 'void QCLKernel::setArg(int, const void*, size_t
)':
qclkernel.h:417: error: 'm_kernelId' was not declared in this scope
qclkernel.h:417: error: 'clSetKernelArg' was not declared in this scope
In file included from qclcontext.h:51,
from qclbuffer.cpp:44:
...

qclbuffer.cpp:1004: error: 'event' was not declared in this scope
qclbuffer.cpp:1004: error: 'error' was not declared in this scope
qclbuffer.cpp:1004: error: 'clEnqueueMapBuffer' was not declared in this scope
qclbuffer.cpp:1006: error: 'CL_SUCCESS' was not declared in this scope
qclbuffer.cpp: In member function 'QCLBuffer QCLBuffer::parentBuffer() const':
qclbuffer.cpp:1051: error: 'cl_mem' was not declared in this scope
qclbuffer.cpp:1051: error: expected ';' before 'parent'
qclbuffer.cpp:1052: error: 'memoryId' was not declared in this scope
qclbuffer.cpp:1053: error: 'parent' was not declared in this scope
qclbuffer.cpp:1053: error: 'clGetMemObjectInfo' was not declared in this scope
qclbuffer.cpp:1053: error: 'CL_SUCCESS' was not declared in this scope
qclbuffer.cpp:1055: error: 'parent' was not declared in this scope
qclbuffer.cpp:1056: error: 'clRetainMemObject' was not declared in this scope
qclbuffer.cpp:1057: error: 'parent' was not declared in this scope
qclbuffer.cpp: In member function 'size_t QCLBuffer::offset() const':
qclbuffer.cpp:1069: error: 'memoryId' was not declared in this scope
qclbuffer.cpp:1070: error: 'clGetMemObjectInfo' was not declared in this scope
qclbuffer.cpp:1070: error: 'CL_SUCCESS' was not declared in this scope
mingw32-make[3]: *** [debug/qclbuffer.o] Error 1
mingw32-make[3]: Leaving directory `C:/OpenCL/src/opencl'
mingw32-make[2]: *** [debug] Error 2
mingw32-make[2]: Leaving directory `C:/OpenCL/src/opencl'
mingw32-make[1]: *** [sub-opencl-make_default-ordered] Error 2
mingw32-make[1]: Leaving directory `C:/OpenCL/src'
mingw32-make: *** [sub-src-make_default-ordered] Error 2

C:\OpenCL>



Could someone help please?

ChrisW67
22nd March 2012, 22:30
You do have OpenCL (http://www.khronos.org/opencl/) built, installed and somewhere that it can be found, don't you? Since you are building on Windows you may have to adjust the PRO file so it can find the OpenCL includes (what's missing here I guess) and libraries (the next thing that will break).

maissiou23
23rd March 2012, 04:45
Thanks Chris for the help I appreciate it,

I was able to add the include, but then I am getting another errors related to cl.h and cl_platform.h


C:\OpenCL\examples\opencl\colorize\..\..\..\src\op encl\qclglobal.h:88: error: CL/cl_platform.h: No such file or directory

C:\OpenCL\examples\opencl\colorize\..\..\..\src\op encl\qclglobal.h:89: error: CL/cl.h: No such file or directory

Is it the same problem related to libraries you were talking about? Could you tell which library is missing please?

ChrisW67
23rd March 2012, 06:01
Yes. QtOpenCL is built on top of OpenCL, and these errors look like you do not have OpenCL installed.

If OpenCL is built and installed then you may need to adjust the INCLUDEPATH entry in the QtOpenCL pro file in order that things like these includes are found. You would also need to adjust the LIBS variable so that link libraires can be found.

maissiou23
23rd March 2012, 16:53
Thanks you made my day :)