Can't link OpenCL on Windows

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

Mystery solved.
The OpenCLRaw bindings were set to use ccall but OpenCL uses stdcall.
I've updated my branch of the bindings. Details on stackoverflow:
http://stackoverflow.com/questions/7391634/cant-link-opencl-on-windows-with-...
Jason
On Mon, Sep 12, 2011 at 10:29 AM, Jason Dagit
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
participants (1)
-
Jason Dagit