Closed underdoeg closed 7 years ago
Hey @underdoeg, I'm finally getting round to trying this on linux :)
I've installed CUDA and opencl-headers, and clinfo is returning OK CL info, but I'm getting link errors in QT Creator (can't find any clXXX functions). How do you configure QTCreator to find libOpenCL? I've tried adding '-lOpenCL' 'lOpenCL' 'OpenCL' (and all lowercase) to of.linkerflags in the qbs and I always get 'cannot find' or 'file not found'. Likewise when i add opencl or OpenCL to the addon_config.mk.
sudo find / -iname "libopencl*"
returns
find: ‘/run/user/1000/gvfs’: Permission denied
/usr/local/cuda-8.0/targets/x86_64-linux/lib/libOpenCL.so.1.0
/usr/local/cuda-8.0/targets/x86_64-linux/lib/libOpenCL.so
/usr/local/cuda-8.0/targets/x86_64-linux/lib/libOpenCL.so.1.0.0
/usr/local/cuda-8.0/targets/x86_64-linux/lib/libOpenCL.so.1
/usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0
/usr/lib/x86_64-linux-gnu/libOpenCL.so.1
/usr/share/man/man7/libOpenCL.so.7.gz
/usr/share/man/man7/libOpenCL.7.gz
/usr/share/doc/ocl-icd-libopencl1/html/libOpenCL.html
and ldconfig -p | grep libOpenCL
returns
libOpenCL.so.1 (libc6,x86-64) => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libOpenCL.so.1
libOpenCL.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libOpenCL.so.1
libOpenCL.so (libc6,x86-64) => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libOpenCL.so
/usr/local/cuda-8.0 is symlinked to /usr/local/cuda, but other than that, do I manually need to symlink /usr/local/cuda-8.0/targets/x86_64-linux/lib/libOpenCL.so to another location?
actually I'll post on the forum as it'll probably be more useful to others. https://forum.openframeworks.cc/t/linux-ubuntu-opencl-qtcreator-missing-lib/28180
haha better late than never ;)
I also added some runtime throw exceptions instead of the asserts (because that way we get nicer error messages). If you don't want these, I can create a new PR with just the linux changes.