Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This Library isn't Compatible with Windows #70

Open
MilesLitteral opened this issue Jul 15, 2022 · 4 comments
Open

This Library isn't Compatible with Windows #70

MilesLitteral opened this issue Jul 15, 2022 · 4 comments

Comments

@MilesLitteral
Copy link

MilesLitteral commented Jul 15, 2022

I don't know how else to put it but this library isn't Windows 10 compatible, there should be a note in the readme about this but using nm and ld on Windows is just going to give you nightmares like it's given me and even with hardcoding you can't build this library, please put a warning as to the fact this library is built in a Linux Environment, for Linux, and tested in Linux where, therefore, using it on Windows it's an uphill battle, No comment on Mac compatibility.

@MilesLitteral MilesLitteral changed the title This Library isn This Library isn't Compatible with Windows Jul 15, 2022
@tmcdonell
Copy link
Owner

ld and nm it should find from your mingw install (which ghc is using). Do the notes in the windows read me help at all, or are they just completely outdated now?

You are right, I don’t regularly test on windows, so I rely on people sending feedback/patches when things break.

@MilesLitteral
Copy link
Author

MilesLitteral commented Jul 16, 2022

Yes, I believe the instructions are currently outdated, I've made hotfixes which make the library build on Windows, I can open a pull request if you'd like to maybe address the issue fully?

Oh Mingw, hmmm my Haskell build on Win64 is using Msys but I doubt thats the full issue??? All in all it will take some ground work which I don't mind helping out with at all

The issue seems to be that CUDA is difficult to link with the MinGW environment unless one builds the CUDA libraries with MinGW's GCC (or conversely MSYS's gcc) and manually installs them; yet this is equally difficult based on my research

https://forums.developer.nvidia.com/t/cuda-with-mingw-how-to-get-cuda-running-under-mingw/415/7

@tmcdonell
Copy link
Owner

If you do get it working yes please open a PR, that would be fantastic!

Windows support was added a long time ago via a contributor, but I believe they no longer need it thus it hasn't been kept up to date ):

@MilesLitteral
Copy link
Author

MilesLitteral commented Oct 5, 2022

Hey @tmcdonell I have made progress with the Library and can report the following:

The issue seems two fold:
First, the function defaultCUDAInstallPath (in Setup.exe) was acting wonky, in my branch I extrapolated the function to have platform specific behavior (it works very well)

NOTE: even though the Setup.hs finds the CUDA_PATH it seems to default to this function no matter what

Second the generated cuda-0.11.0.0-inplace.conf gives the wrong path for the dlls:

library-dirs:
    ...\cuda-master\dist-newstyle\build\x86_64-windows\ghc-8.10.7\cuda-0.11.0.0\build
    C:\NVIDIA\Toolkit\CUDA\v9.0\lib\x64 C:\ghcup\msys64\mingw64\lib

dynamic-library-dirs:
    ...\cuda-master\dist-newstyle\build\x86_64-windows\ghc-8.10.7\cuda-0.11.0.0\build
    C:\NVIDIA\Toolkit\CUDA\v9.0\lib\x64 C:\ghcup\msys64\mingw64\lib

it seems to think the .lib and .dll files are in the same place based on the inplace, when you put the .dll it's looking for in the same place as the lib path and update the defautCUDAInstallPath function this library builds again on Windows no problem

I will open a pull request soon, if you know what function is setting dynamic-library-dirs I'd appreciate the pointer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants