Results 1 to 3 of 3

Thread: Cannot make OpenCL work with Qt Creator

  1. #1
    Join Date
    Jan 2017
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Cannot make OpenCL work with Qt Creator

    I am trying to run the "Valar" benchmark applications on my system through Qt Creator and am getting errors when I build the code:

    https://github.com/Frinhard/valar-bench

    I typed the command
    Qt Code:
    1. autoreconf -ivf
    To copy to clipboard, switch view to plain text mode 
    and got the following output:

    Qt Code:
    1. autoreconf: Entering directory `.'
    2. autoreconf: configure.ac: not using Gettext
    3. autoreconf: running: aclocal --force -I m4
    4. aclocal: couldn't open directory `m4': No such file or directory
    5. autoreconf: aclocal failed with exit status: 1
    To copy to clipboard, switch view to plain text mode 

    All my errors were connected to the file m4 so I created an empty directory and named it m4. After that I was able to run the command
    Qt Code:
    1. autoreconf --install
    To copy to clipboard, switch view to plain text mode 
    and I no longer kept getting the same error. Moreover, Makefile.in was also generated along with many other files.

    The image shows the state of the directory after I ran
    Qt Code:
    1. autoreconf --install
    To copy to clipboard, switch view to plain text mode 
    :

    myfiles.jpg

    I ran the command
    Qt Code:
    1. qmake --project
    To copy to clipboard, switch view to plain text mode 
    on the command line and the
    Qt Code:
    1. .pro
    To copy to clipboard, switch view to plain text mode 
    file was generated.

    I opened the newly generated .pro file in Qt Creator and linked the OpenCL libraries in addition to the other OpenCL files in the "bin" directory.

    pro4JPG.jpg

    pro.jpg

    This picture indicates the errors I have been getting:

    Errors.jpg

    The following is the information I have regarding the qmake I am using:

    Qt Code:
    1. Qmake version: 1.07a (Qt 3.3.8b)
    2. Qmake is free software from Trolltech ASA.
    To copy to clipboard, switch view to plain text mode 

    Please help me in building and building my OpenCL applications successfully. Please point out to me what exactly I am doing/have done wrong.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,229
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Cannot make OpenCL work with Qt Creator

    Your screenshots are illegible and probably don't show anything useful anyway. If you get error listings, post the listing, not a screenshot of a listing.

    First, update to a current version of Qt. Qt 3.3 is probably 10 years or more old. Also ensure you have up to date compilers that support OpenCL.

    Then, instead of trying to integrate a complex project that requires autoreconf and a dozen other steps, find a simple OpenCL example that uses nothing except a few source code files and the OpenCL framework. Get that working and remember what you did. Then maybe you can integrate a more complex project.

    There are probably a dozen places where something could have gone wrong. Start with a simple example, get it working, and bootstrap your way up.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

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

    abdu_sid (28th January 2017)

  4. #3
    Join Date
    Jan 2017
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Cannot make OpenCL work with Qt Creator

    Thank you d_stranz for your reply.

    I have included the errors I got when I tried to compile the project.

    EDIT:

    I cannot edit my first post so I am including the errors I got here. Since the images I posted weren't readable, I'll post the links to the images here:

    My files after I ran autoreconf:

    https://www.flickr.com/photos/50175764@N06/32410198781/

    The libraries for OpenCL that I included:

    https://www.flickr.com/photos/501757...n/photostream/

    My workspace:

    https://www.flickr.com/photos/50175764@N06/31720559053/

    The errors I got:

    Qt Code:
    1. 17:27:13: Running steps for project valar-bench...
    2. 17:27:13: Configuration unchanged, skipping qmake step.
    3. 17:27:13: Starting: "/usr/bin/make"
    4. Makefile:941: warning: overriding commands for target `eventlist.o'
    5. Makefile:875: warning: ignoring old commands for target `eventlist.o'
    6. Makefile:1014: warning: overriding commands for target `main.o'
    7. Makefile:960: warning: ignoring old commands for target `main.o'
    8. g++ -c -pipe -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../valar-bench -I. -I../valar-bench -I../valar-bench/clhaptic/libmisc -I../valar-bench/fir -I../valar-bench/clhaptic/libanalysis-devices -I../valar-bench/clhaptic/libprofiler -I../valar-bench/clhaptic/libtopology -I../valar-bench/clhaptic/librules -I../valar-bench/clhaptic/libinterceptor -I../valar-bench/clsurf/src -I../valar-bench/particles/Common/Base -I../valar-bench/particles/Common/Math -I../valar-bench/particles/TestBed/Demos -I../valar-bench/particles/Common/Utils -I../valar-bench/particles/TestBed -I../valar-bench/particles/Common/DeviceUtils -I../valar-bench/particles/Common/Geometry -I../valar-bench/particles -I/root/Downloads/valar-bench/valar-bench/../../usr/local/cuda-7.0/lib64 -I/root/Downloads/valar-bench/valar-bench/../../usr/local/cuda-7.0/include -I/opt/QtInstallation/5.6/gcc_64/include -I/opt/QtInstallation/5.6/gcc_64/include/QtGui -I/opt/QtInstallation/5.6/gcc_64/include/QtCore -I. -I/opt/QtInstallation/5.6/gcc_64/mkspecs/linux-g++ -o FIR_tapchange.o ../valar-bench/fir/FIR_tapchange.cpp
    9. ../valar-bench/fir/FIR_tapchange.cpp:16:19: error: CL/cl.h: No such file or directory
    10. In file included from ../valar-bench/fir/FIR_tapchange.cpp:18:
    11. ../valar-bench/clhaptic/libmisc/opencl_utils.h:40: error: 'cl_device_id' was not declared in this scope
    12. ../valar-bench/clhaptic/libmisc/opencl_utils.h:42: error: variable or field 'ad_sync' declared void
    13. ../valar-bench/clhaptic/libmisc/opencl_utils.h:42: error: 'cl_command_queue' was not declared in this scope
    14. .
    15. .
    16. .
    17. .
    18. 17:27:13: The process "/usr/bin/make" exited with code 2.
    19. Error while building/deploying project valar-bench (kit: Desktop Qt 5.6.0 GCC 64bit)
    20. When executing step "Make"
    21. 17:27:13: Elapsed time: 00:00.
    To copy to clipboard, switch view to plain text mode 

    I got many other errors but I have not included them because I will be exceeding the word limit of my message. Qt is essentially not recognizing the OpenCL library.
    Please let me know if my new post provides helpful information about my problem.
    Last edited by abdu_sid; 28th January 2017 at 18:53.

Similar Threads

  1. Problem building OpenCL with Mingw
    By maissiou23 in forum Qt Programming
    Replies: 4
    Last Post: 23rd March 2012, 17:53
  2. Can't make my Qt Creator + qmake work
    By El-Fierro in forum Newbie
    Replies: 0
    Last Post: 3rd March 2012, 17:52
  3. OpenCL performance
    By mhoover in forum General Programming
    Replies: 0
    Last Post: 20th April 2011, 08:44
  4. how to make these contents work??
    By srohit24 in forum Qt Programming
    Replies: 2
    Last Post: 2nd March 2009, 15:02
  5. [Qt4 QHttp] can't make it work
    By rodo in forum Qt Programming
    Replies: 3
    Last Post: 10th April 2007, 18:33

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.