无法在64位Linux上安装Haskell CUDA

时间:2014-03-19 18:49:16

标签: linux haskell cuda cabal

我在64位Arch Linux上使用cabal安装/构建haskell-cuda时遇到了问题。据我所知,我有所有先决条件(即cuda运行时库,nvcc编译器等)。

我得到的错误如下:

cabal install cuda
[all tests pass]
Building cuda-0.5.1.1...
Preprocessing library cuda-0.5.1.1...
[ 1 of 27] Compiling Foreign.CUDA.Driver.Error ( dist/build/Foreign/CUDA/Driver/Error.hs, dist/build/Foreign/CUDA/Driver/Error.o )
[ 2 of 27] Compiling Foreign.CUDA.Internal.Offsets ( dist/build/Foreign/CUDA/Internal/Offsets.hs, dist/build/Foreign/CUDA/Internal/Offsets.o )
[ 3 of 27] Compiling Foreign.CUDA.Internal.C2HS ( Foreign/CUDA/Internal/C2HS.hs, dist/build/Foreign/CUDA/Internal/C2HS.o )
[ 4 of 27] Compiling Foreign.CUDA.Driver.Utils ( dist/build/Foreign/CUDA/Driver/Utils.hs, dist/build/Foreign/CUDA/Driver/Utils.o )

Foreign/CUDA/Driver/Utils.chs:35:23:
    Illegal type signature: `IO (Status, Int) cuDriverGetVersion'
      Perhaps you intended to use -XScopedTypeVariables
    In a pattern type-signature
Failed to install cuda-0.5.1.1
cabal: Error: some packages failed to install:
cuda-0.5.1.1 failed during the building phase. The exception was:
ExitFailure 1

根据我的理解,这是Hackage上的源代码的错误,但是我可能会误解,而且我的机器出错了。无论哪种方式,我该如何解决它?

1 个答案:

答案 0 :(得分:2)

好的,似乎(基于this)问题实际上是c2hs程序的错误,版本为0.16.6

解决方案是降级到版本0.16.5,然后再次尝试安装CUDA。

cabal install c2hs-0.16.5
cabal install cuda

降级后,安装完美无缺!