Results 1 to 5 of 5

Thread: Problem building OpenCL with Mingw

  1. #1
    Join Date
    Dec 2011
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem building OpenCL with Mingw

    Hi,

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

    Qt Code:
    1. cd C:\OpenCL
    2. qmake opencl.pro
    3. mingw32-make
    To copy to clipboard, switch view to plain text mode 


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

    Qt Code:
    1. qclkernel.h:368: error: 'm_kernelId' was not declared in this scope
    2. qclkernel.h:368: error: 'clSetKernelArg' was not declared in this scope
    3. qclkernel.h: In member function 'void QCLKernel::setArg(int, const QVector4D&)':
    4.  
    5. qclkernel.h:374: error: 'm_kernelId' was not declared in this scope
    6. qclkernel.h:374: error: 'clSetKernelArg' was not declared in this scope
    7. qclkernel.h:377: error: 'm_kernelId' was not declared in this scope
    8. qclkernel.h:377: error: 'clSetKernelArg' was not declared in this scope
    9. qclkernel.h: In member function 'void QCLKernel::setArg(int, const QPoint&)':
    10. qclkernel.h:383: error: 'cl_int' was not declared in this scope
    11. qclkernel.h:383: error: expected ';' before 'values'
    12. qclkernel.h:384: error: 'm_kernelId' was not declared in this scope
    13. qclkernel.h:384: error: 'values' was not declared in this scope
    14. qclkernel.h:384: error: 'clSetKernelArg' was not declared in this scope
    15. qclkernel.h: In member function 'void QCLKernel::setArg(int, const QPointF&)':
    16. qclkernel.h:390: error: 'm_kernelId' was not declared in this scope
    17. qclkernel.h:390: error: 'clSetKernelArg' was not declared in this scope
    18. qclkernel.h:393: error: 'm_kernelId' was not declared in this scope
    19. qclkernel.h:393: error: 'clSetKernelArg' was not declared in this scope
    20. qclkernel.h: In member function 'void QCLKernel::setArg(int, const QCLMemoryObje
    21. ct&)':
    22. qclkernel.h:399: error: 'cl_mem' was not declared in this scope
    23. qclkernel.h:399: error: expected ';' before 'id'
    24. qclkernel.h:400: error: 'm_kernelId' was not declared in this scope
    25. qclkernel.h:400: error: 'id' was not declared in this scope
    26. qclkernel.h:400: error: 'clSetKernelArg' was not declared in this scope
    27. qclkernel.h: In member function 'void QCLKernel::setArg(int, const QCLVectorBase
    28. &)':
    29. qclkernel.h:405: error: 'cl_mem' was not declared in this scope
    30. qclkernel.h:405: error: expected ';' before 'id'
    31. qclkernel.h:406: error: 'm_kernelId' was not declared in this scope
    32. qclkernel.h:406: error: 'id' was not declared in this scope
    33. qclkernel.h:406: error: 'clSetKernelArg' was not declared in this scope
    34. qclkernel.h: In member function 'void QCLKernel::setArg(int, const QCLSampler&)'
    35. :
    36. qclkernel.h:411: error: 'cl_sampler' was not declared in this scope
    37. qclkernel.h:411: error: expected ';' before 'id'
    38. qclkernel.h:412: error: 'm_kernelId' was not declared in this scope
    39. qclkernel.h:412: error: 'id' was not declared in this scope
    40. qclkernel.h:412: error: 'clSetKernelArg' was not declared in this scope
    41. qclkernel.h: In member function 'void QCLKernel::setArg(int, const void*, size_t
    42. )':
    43. qclkernel.h:417: error: 'm_kernelId' was not declared in this scope
    44. qclkernel.h:417: error: 'clSetKernelArg' was not declared in this scope
    45. In file included from qclcontext.h:51,
    46. from qclbuffer.cpp:44:
    47. ...
    48.  
    49. qclbuffer.cpp:1004: error: 'event' was not declared in this scope
    50. qclbuffer.cpp:1004: error: 'error' was not declared in this scope
    51. qclbuffer.cpp:1004: error: 'clEnqueueMapBuffer' was not declared in this scope
    52. qclbuffer.cpp:1006: error: 'CL_SUCCESS' was not declared in this scope
    53. qclbuffer.cpp: In member function 'QCLBuffer QCLBuffer::parentBuffer() const':
    54. qclbuffer.cpp:1051: error: 'cl_mem' was not declared in this scope
    55. qclbuffer.cpp:1051: error: expected ';' before 'parent'
    56. qclbuffer.cpp:1052: error: 'memoryId' was not declared in this scope
    57. qclbuffer.cpp:1053: error: 'parent' was not declared in this scope
    58. qclbuffer.cpp:1053: error: 'clGetMemObjectInfo' was not declared in this scope
    59. qclbuffer.cpp:1053: error: 'CL_SUCCESS' was not declared in this scope
    60. qclbuffer.cpp:1055: error: 'parent' was not declared in this scope
    61. qclbuffer.cpp:1056: error: 'clRetainMemObject' was not declared in this scope
    62. qclbuffer.cpp:1057: error: 'parent' was not declared in this scope
    63. qclbuffer.cpp: In member function 'size_t QCLBuffer::offset() const':
    64. qclbuffer.cpp:1069: error: 'memoryId' was not declared in this scope
    65. qclbuffer.cpp:1070: error: 'clGetMemObjectInfo' was not declared in this scope
    66. qclbuffer.cpp:1070: error: 'CL_SUCCESS' was not declared in this scope
    67. mingw32-make[3]: *** [debug/qclbuffer.o] Error 1
    68. mingw32-make[3]: Leaving directory `C:/OpenCL/src/opencl'
    69. mingw32-make[2]: *** [debug] Error 2
    70. mingw32-make[2]: Leaving directory `C:/OpenCL/src/opencl'
    71. mingw32-make[1]: *** [sub-opencl-make_default-ordered] Error 2
    72. mingw32-make[1]: Leaving directory `C:/OpenCL/src'
    73. mingw32-make: *** [sub-src-make_default-ordered] Error 2
    74.  
    75. C:\OpenCL>
    To copy to clipboard, switch view to plain text mode 

    Could someone help please?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem building OpenCL with Mingw

    You do have 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).

  3. The following user says thank you to ChrisW67 for this useful post:

    maissiou23 (23rd March 2012)

  4. #3
    Join Date
    Dec 2011
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem building OpenCL with Mingw

    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
    Qt Code:
    1. C:\OpenCL\examples\opencl\colorize\..\..\..\src\opencl\qclglobal.h:88: error: CL/cl_platform.h: No such file or directory
    2.  
    3. C:\OpenCL\examples\opencl\colorize\..\..\..\src\opencl\qclglobal.h:89: error: CL/cl.h: No such file or directory
    To copy to clipboard, switch view to plain text mode 

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

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem building OpenCL with Mingw

    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.

  6. The following user says thank you to ChrisW67 for this useful post:

    maissiou23 (23rd March 2012)

  7. #5
    Join Date
    Dec 2011
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem building OpenCL with Mingw

    Thanks you made my day

Similar Threads

  1. [SOLVED]building Qt using GCC 4.5.2 Mingw
    By simpler_efil in forum Newbie
    Replies: 0
    Last Post: 2nd May 2011, 13:59
  2. OpenCL performance
    By mhoover in forum General Programming
    Replies: 0
    Last Post: 20th April 2011, 07:44
  3. Problem building Qwt 5.2.0 with MinGW
    By spatten in forum Qwt
    Replies: 6
    Last Post: 19th March 2010, 11:09
  4. Building PythonQt with MinGW
    By givemeaname in forum Qt Programming
    Replies: 6
    Last Post: 9th March 2010, 08:20
  5. Building Qt 4.3.4 on Win Vista & MinGW
    By Sirow in forum Installation and Deployment
    Replies: 2
    Last Post: 28th April 2008, 18:27

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.