无法安装Cabal-1.20.0.2

时间:2014-11-30 17:10:35

标签: haskell cabal ghci

当我尝试安装Cabal-1.20.0.2时出现此错误:

$ cabal install Cabal-1.20.0.2.tar.gz 
Resolving dependencies...
Configuring Cabal-1.20.0.2...
Failed to install Cabal-1.20.0.2
Last 10 lines of the build log ( /home/yonutix/.cabal/logs/Cabal-1.20.0.2.log ):
cabal: Error: some packages failed to install:
Cabal-1.20.0.2 failed during the configure step. The exception was:
user error (
/tmp/Cabal-1.20.0.2-11804/Cabal-1.20.0.2/Distribution/Simple/Utils.hs:386:31:
Warning:
In the use of ‘runGenProcess_’
(imported from System.Process.Internals):
Deprecated: "Please do not use this anymore, use the ordinary
'System.Process.createProcess'. If you need the SIGINT handling, use
delegate_ctlc = True (runGenProcess_ is now just an imperfectly emulated stub
that probably duplicates or overrides your own signal handling)."
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
)

我需要安装此软件包,因为cabal-install依赖于它。

可能是什么问题? 谢谢!

1 个答案:

答案 0 :(得分:8)

日志文件的这一部分指出了问题:

/usr/bin/ld: cannot find -lgmp

ghc找不到libgmp。最有可能修复的是安装libgmp-dev包,例如在Ubuntu下:

sudo apt-get install libgmp-dev