C FreeOCL compiling errors

Hi,

Has anyone tried to use freeocl yet? I got errors when compiling its header:
Code:
#include <CL/cl.hpp>
Code:
$ gcc48 cldemo.cpp -lstdc++
/tmp//cctiUYnu.o: In function `cl::detail::ReferenceHandler<_cl_context*>::release(_cl_context*)':
cldemo.cpp: (.text._ZN2cl6detail16ReferenceHandlerIP11_cl_contextE7releaseES3_[_ZN2cl6detail16ReferenceHandlerIP11_cl_contextE7releaseES3_]+0x14): undefined reference to `clReleaseContext'
/tmp//cctiUYnu.o: In function `cl::detail::ReferenceHandler<_cl_command_queue*>::release(_cl_command_queue*)':
cldemo.cpp: (.text._ZN2cl6detail16ReferenceHandlerIP17_cl_command_queueE7releaseES3_[_ZN2cl6detail16ReferenceHandlerIP17_cl_command_queueE7releaseES3_]+0x14): undefined reference to `clReleaseCommandQueue'
collect2: error: ld returned 1 exit status
Please help.
 
It'll probably help if you link your executable to libOpenCL (-lOpenCL). You may need to add -L/usr/local/lib too.
 
Hi SirDice,

I can compile it now, but I got an error when running the output file:
$ gcc48 cldemo.cpp -lstdc++ -lOpenCL -L/usr/local/lib
$ ./a.out
sysctl: unknown oid 'kernel.ostype': No such file or directory
 
That's because the FreeOCL code doesn't understand FreeBSD and assumes you're using Linux. You will need to have this fixed upstream.
 
Contact whoever wrote FreeOCL and get them to properly support FreeBSD in their code.
 
Back
Top