accelerate
accelerate copied to clipboard
Object file loading on Windows
The CPU backend is currently broken on windows because it lacks an object file loader (here).
This is the same as what GHCi does, but a bit simpler because we only need to handle the most basic types of relocations etc. Unfortunately we can't use that one due to GHC#13624 (unless that does not affect windows, but I doubt it)
Any windows hackers interested in writing one? @RyanGlScott
@tmcdonell btw, I'm adding alignment support to Windows in https://phabricator.haskell.org/D3915 (along with memory protection), but I'm afraid I'll miss the 8.4 deadline for adding it, so it'll be only 8.6.
Awesome! :+1:
Looks like llvm-hs
is adding bindings to load external object files (https://github.com/llvm-hs/llvm-hs/issues/189). Once that is in we can (hopefully) switch to that instead and drop our custom object file loaders.
While working on another feature I've reimplemented accelerate-llvm's current dynamic linker using the operating system's own linker and dlopen()
: https://github.com/robbert-vdh/accelerate-llvm/commit/272297ccdd8afa097a84904dc1e83914c44c7356
This still does not support Windows, but if this gets merged then it should be fairly trivial to provide another implementation of the Data.Array.Accelerate.LLVM.Native.Link.Posix
module for Windows that uses mingw-w64's ld
binary that ships with GHC, LoadLIbrary()
, and GetProcAddress()
. I thought it might be worth mentioning here in case anyone wants to pick this up.
We've switched from using our own object file loader to using the system linker, so just need to update the code to use LoadLibrary
and GetProcAddress
on windows.