tmcdonell / cuda

Haskell FFI bindings to CUDA
Other
76 stars 36 forks source link

On Windows, the Cabal installer is looking in the wrong place. #45

Closed mrakgr closed 7 years ago

mrakgr commented 7 years ago
C:\Users\Marko\Documents\Visual Studio 2015\Projects\Multi-armed Bandit Experiments\Spiral Haskell>cabal install cuda
Warning: The package list for 'hackage.haskell.org' is 40.4 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Configuring cuda-0.7.5.1...
Failed to install cuda-0.7.5.1
Build log ( C:\Users\Marko\AppData\Roaming\cabal\logs\cuda-0.7.5.1.log ):
[1 of 1] Compiling Main             ( C:\Users\Marko\AppData\Local\Temp\cabal-tmp-5100\cuda-0.7.5.1\dist\setup\setup.hs, C:\Users\Marko\AppData\Local\Temp\cabal-tmp-5100\cuda-0.7.5.1\dist\setup\Main.o )
Linking C:\Users\Marko\AppData\Local\Temp\cabal-tmp-5100\cuda-0.7.5.1\dist\setup\setup.exe ...
Warning: cuda.cabal: Ignoring unknown section type: custom-setup
Configuring cuda-0.7.5.1...
Found CUDA toolkit at: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5
setup.exe: 'nm' exited with an error:
nm: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\x64\cudart.lib':
No such file
cabal: Error: some packages failed to install:
cuda-0.7.5.1 failed during the configure step. The exception was:
ExitFailure 1

In fact the aforementioned directory C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\x64\ does not exist, instead the file is in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\lib\x64.

There is also one other bug, as I have multiple versions of Cuda SDK installed, at first it tried using the Cuda 8.0 which was in CUDA_PATH. I had to change it to 7.5 manually. Since the package is not using the most up to date version at the moment, I would suggest using the CUDA_PATH_V7_5 variable to look for the default directory.

tmcdonell commented 7 years ago

So the default library location was changed between the 7.5 and 8.0 releases? Or was it between 7.0 and 7.5?

Also, did you try compiling against 8.0? I tested with 8.0 on my Mac and it seems to build, but I haven't added any of the new features yet so it's not supported per-se. It would be good to know if it builds on Windows as well, or what is required to do so.

tmcdonell commented 7 years ago

I should also mention I don't have a windows machine to test this with. Does the install location depend the version of windows as well? If you could me help sort this out or submit a PR that would be awesome.

mrakgr commented 7 years ago

I'll try building it using stack right now. I have all the Cuda SDKs between 6.5-8.0 and looking at the directory structure, I see that all of them have it uniform. I am not sure how the build ever succeeded on Windows. But it would not be hard to change the setup.hs to look at the correct locations.

mrakgr commented 7 years ago

Oh, since you asked whether the install location depends on the version of Windows, I'll say that I would be very much surprised that this was the case. It would affect the default drive location of the Program Files directory where Cuda SDK are installed, but that is about it.

tmcdonell commented 7 years ago

https://hackage.haskell.org/package/cuda-0.7.5.2