When I'm trying to build any code using OpenCL with:
ghc -lOpenCL --make Test.hs
ghc: /home/tomek/.cabal/lib/OpenCL-220.127.116.11/ghc-7.4.1/HSOpenCL-18.104.22.168.o: unknown symbol `clGetDeviceIDs'
It's the same for cabal-ghci in project using OpenCL, still, it works with runhaskell -lOpenCL Test.hs
it looks like adding "extra-libraries: OpenCL" in Library section of cabal file fixes this issue.
I'm outside until next week, when I'll be able to test it. But, I seems to me that its one of the differences between platforms. What platform are you using? I test it on Linux, and I apply several changes to allow Windows and Macos build, but I don't test it.
I'm using Linux, and can't test on any other platform right now. If on
other platforms there are no problems with building packages depending
on OpenCL, just adding it as a Linux-specific quirk should work.
tel.: +48 502 539 918
Please check out my branch, I have just added patch mgajda/opencl@6843b74 that fixes it.
The symptom is correct linking with ghci -lOpenCL, but unable to compile executable.
@mgajda So it's not just me having this problem :-) I'm using a fix similar to yours.
@zhensydow this looks like a show-stopper on Linux, will you make a minor release to get this fixed on hackage?
@roverorna I like to, but currently I have no computer to test it. As soon as posible I put it in a release.
@mgajda i'll try to get this change in own branch
@zhensydow I tested it works on both Linux and Mac. Now GHCi needs -lOpenCL no more.
@roverorna I just put the changes in hackage 22.214.171.124
@mgajda thanks again