Coder Social home page Coder Social logo

Errors with cl2.hpp about opencl-clhpp HOT 4 CLOSED

khronosgroup avatar khronosgroup commented on July 17, 2024 1
Errors with cl2.hpp

from opencl-clhpp.

Comments (4)

jrprice avatar jrprice commented on July 17, 2024 1

Linker flag order matters with GCC, try putting the -lOpenCL at the end of the command-line:

g++ -std=c++17 dummy.cpp -o dummy -lOpenCL

This resolves the issue for me.

from opencl-clhpp.

sampie avatar sampie commented on July 17, 2024

I also tested with different system having beignet and the result looks the same:

/tmp/ccEVrV8e.o: In function cl::detail::ReferenceHandler<_cl_device_id*>::release(_cl_device_id*)': dummy.cpp:(.text._ZN2cl6detail16ReferenceHandlerIP13_cl_device_idE7releaseES3_[_ZN2cl6detail16ReferenceHandlerIP13_cl_device_idE7releaseES3_]+0x14): undefined reference to clReleaseDevice'
/tmp/ccEVrV8e.o: In function cl::detail::ReferenceHandler<_cl_context*>::release(_cl_context*)': dummy.cpp:(.text._ZN2cl6detail16ReferenceHandlerIP11_cl_contextE7releaseES3_[_ZN2cl6detail16ReferenceHandlerIP11_cl_contextE7releaseES3_]+0x14): undefined reference to clReleaseContext'
/tmp/ccEVrV8e.o: In function cl::detail::ReferenceHandler<_cl_command_queue*>::release(_cl_command_queue*)': dummy.cpp:(.text._ZN2cl6detail16ReferenceHandlerIP17_cl_command_queueE7releaseES3_[_ZN2cl6detail16ReferenceHandlerIP17_cl_command_queueE7releaseES3_]+0x14): undefined reference to clReleaseCommandQueue'
collect2: error: ld returned 1 exit status
Makefile:2: recipe for target 'all' failed

from opencl-clhpp.

sampie avatar sampie commented on July 17, 2024

Hi,

Thank you! This solves the issue!

from opencl-clhpp.

rajhlinux avatar rajhlinux commented on July 17, 2024

Thanks I had the same issue to compile Caffe with viennacl. I had to put the flag "-lOpenCL" to the cmakelist.txt flags.

from opencl-clhpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.