[Haskell-cafe] Can't link OpenCL on Windows

Jason Dagit dagitj at gmail.com
Mon Sep 12 19:29:35 CEST 2011


Hello,

I'm trying to get the OpenCLRaw bindings to a point where I can use
them on windows.  I've forked the the OpenCLRaw repo on github so I
can make modifications as needed.  My branch is here:
https://github.com/dagit/OpenCLRaw

I've been mostly working out of my "FunPtr" branch.

The issue I'm having is this:  I installed AMD's OpenCL SDK, converted
their Visual Studio specific .lib file to a file that gcc can handle
(.a file), but ghc can't seem to link with it.  I get undefined
symbols for everything I use in the OpenCL API.

I was able to build a "trivial" C program and link it using the .a
file that I generated and gcc from mingw (not from the Haskell
install).  I'm using the latest windows release of the Haskell
platform.

These are the steps I used for generating the .a file:
http://forums.amd.com/forum/messageview.cfm?catid=390&threadid=138890

I used the commands in the example script (e.g., gendef and dlltool).
I've tried to use 32bit everything as much as possible, as I know that
GHC will want everything to be 32bit, so I don't think it's a 32bit
vs. 64bit issue.

Does anyone know if there is something different about invoking gcc
under ghc instead of the gcc that I get from mingw?

I've also played with the ghc command line (I used cabal-dev
--verbose=3 to inspect the command line) and I'm still unable to
massage it into a working state.

Any help would be appreciated!

Thanks,
Jason



More information about the Haskell-Cafe mailing list