tags:

views:

177

answers:

1

So I downloaded the ATI Stream SDK. I don't have a gpu now so I use the '-device cpu' and got the programs/examples in the OpenCl directory working by adding the directory to LD_LIBRARY_PATH etc.

Now the problem is when installing QtOpenCl.

configure script gives me:

skkard@skkard-desktop:~/Applications/qt-labs-opencl$ ./configure

This is the QtOpenCL configuration utility.

Qt version ............. 4.6.2
qmake .................. /usr/bin/qmake
OpenCL ................. yes
OpenCL/OpenGL interop .. yes
Extra QMAKE_CXXFLAGS ...
Extra INCLUDEPATH ......
Extra LIBS ............. -lOpenCL

QtOpenCL has been configured.  Run '/usr/bin/make' to build.

Make gives me:

skkard@skkard-desktop:~/Applications/qt-labs-opencl$ make
cd src/ && make -f Makefile 
make[1]: Entering directory `/home/skkard/Applications/qt-labs-opencl/src'
cd opencl/ && make -f Makefile 
make[2]: Entering directory `/home/skkard/Applications/qt-labs-opencl/src/opencl'
make[2]: Nothing to be done for `first'.
make[2]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/src/opencl'
cd openclgl/ && make -f Makefile 
make[2]: Entering directory `/home/skkard/Applications/qt-labs-opencl/src/openclgl'
make[2]: Nothing to be done for `first'.
make[2]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/src/openclgl'
make[1]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/src'
cd examples/ && make -f Makefile 
make[1]: Entering directory `/home/skkard/Applications/qt-labs-opencl/examples'
cd opencl/ && make -f Makefile 
make[2]: Entering directory `/home/skkard/Applications/qt-labs-opencl/examples/opencl'
cd vectoradd/ && make -f Makefile 
make[3]: Entering directory `/home/skkard/Applications/qt-labs-opencl/examples/opencl/vectoradd'
g++  -o vectoradd vectoradd.o qrc_vectoradd.o    -L/usr/lib -L../../../lib -L../../../bin -lQtOpenCL -lQtGui -lQtCore -lpthread 
../../../lib/libQtOpenCL.so: undefined reference to `clBuildProgram'
../../../lib/libQtOpenCL.so: undefined reference to `clSetCommandQueueProperty'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueNDRangeKernel'
../../../lib/libQtOpenCL.so: undefined reference to `clSetKernelArg'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueCopyBufferToImage'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseMemObject'
../../../lib/libQtOpenCL.so: undefined reference to `clFinish'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueUnmapMemObject'
../../../lib/libQtOpenCL.so: undefined reference to `clGetMemObjectInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueReadImage'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueMarker'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainCommandQueue'
../../../lib/libQtOpenCL.so: undefined reference to `clGetCommandQueueInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueCopyImage'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseContext'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainMemObject'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseEvent'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueWriteBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueCopyBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueMapImage'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueReadBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clUnloadCompiler'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueBarrier'
../../../lib/libQtOpenCL.so: undefined reference to `clGetProgramBuildInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueWaitForEvents'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainProgram'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateContext'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateImage3D'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueMapBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clGetDeviceIDs'
../../../lib/libQtOpenCL.so: undefined reference to `clGetContextInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clGetDeviceInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseCommandQueue'
../../../lib/libQtOpenCL.so: undefined reference to `clGetSamplerInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clGetPlatformIDs'
../../../lib/libQtOpenCL.so: undefined reference to `clGetSupportedImageFormats'
../../../lib/libQtOpenCL.so: undefined reference to `clGetPlatformInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clWaitForEvents'
../../../lib/libQtOpenCL.so: undefined reference to `clGetEventInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clGetEventProfilingInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clGetImageInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateProgramWithBinary'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseSampler'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateCommandQueue'
../../../lib/libQtOpenCL.so: undefined reference to `clGetKernelWorkGroupInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainEvent'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainContext'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateSampler'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseProgram'
../../../lib/libQtOpenCL.so: undefined reference to `clFlush'
../../../lib/libQtOpenCL.so: undefined reference to `clGetProgramInfo'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateKernel'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainKernel'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueWriteImage'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateKernelsInProgram'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateProgramWithSource'
../../../lib/libQtOpenCL.so: undefined reference to `clReleaseKernel'
../../../lib/libQtOpenCL.so: undefined reference to `clRetainSampler'
../../../lib/libQtOpenCL.so: undefined reference to `clCreateImage2D'
../../../lib/libQtOpenCL.so: undefined reference to `clEnqueueCopyImageToBuffer'
../../../lib/libQtOpenCL.so: undefined reference to `clGetKernelInfo'
collect2: ld returned 1 exit status
make[3]: *** [vectoradd] Error 1
make[3]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/examples/opencl/vectoradd'
make[2]: *** [sub-vectoradd-make_default] Error 2
make[2]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/examples/opencl'
make[1]: *** [sub-opencl-make_default] Error 2
make[1]: Leaving directory `/home/skkard/Applications/qt-labs-opencl/examples'
make: *** [sub-examples-make_default-ordered] Error 2

Tried it using the '-no-openclgl', but none of the examples etc are compiled.

I'm using ubuntu 10.04 using the Qt which is installed from synaptic.

+2  A: 

I'd guess you aren't linking the OpenCL runtime. The QT library is making calls to those functions but they are not, then, defined in another file. You must link in "that" file to solve your problems.

Goz
You mean create a syslink? How and where?
Skkard
Do I have to link the OpenCL headers? They are linked I think..
Skkard
No you have to link the OpenCL library (ie .so file)!
Goz
How? :(. Not getting what you are talking about. Can you tell me in a little more detail? Thanks.
Skkard
I tried compiling the same thing that the make is doing with a '-lOpenCL' parameter and it successfully compiles. Butthough the vectoradd example works, some others do not.
Skkard
Gives a segfault.
Skkard
Well then there is a problem with the library you are linking against OR you are linking against the wrong library. I'm not sure what else I can suggest but I WOULD suggest that if you can't link an app together then perhaps you should start with something less complicated than OpenCL.
Goz
It worked. It seems before installing OpenCL I had run the configure script once. Getting a fresh copy of the files worked. Thank goz!
Skkard