无法安装Cabal-1.20.0.2

yon*_*tix 3 haskell ghci cabal

当我尝试安装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
)
Run Code Online (Sandbox Code Playgroud)

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

可能是什么问题呢?谢谢!

Eri*_*ikR 8

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

/usr/bin/ld: cannot find -lgmp
Run Code Online (Sandbox Code Playgroud)

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

sudo apt-get install libgmp-dev
Run Code Online (Sandbox Code Playgroud)