3

I get this error when I'm trying to install 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
)

I need to install this package because cabal-install depends on it.

What could be the problem? Thanks!

yonutix
  • 1,964
  • 1
  • 22
  • 51
  • Here's a clue: `/usr/bin/ld: cannot find -lgmp` - ghc can't find libgmp. What OS are you using? How did you install ghc? Are you using the Haskell Platform? – ErikR Nov 30 '14 at 17:21
  • I'm using Ubuntu 14.04 fresh installed, Haskell Platform 2014.2.0.0 for Linux, 64bit $ /usr/bin/ld /usr/bin/ld: no input files – yonutix Nov 30 '14 at 17:23
  • 1
    you could try this: `sudo apt-get install libgmp-dev` - I wouldn't be surprised if a vanilla Ubuntu dist doesn't contain libgmp by default. – ErikR Nov 30 '14 at 17:25
  • It worked, thanks, post it as answer, now I'm having a problem during the build step "/usr/bin/ld: cannot find -lz" – yonutix Nov 30 '14 at 17:51
  • I haven't used Ubuntu in a very long time, but if I were to hazard a guess, I think you need to install `zlib1g-dev` (bottom line being you need zlib development libraries). – YellPika Nov 30 '14 at 18:01
  • ...and if that doesn't work see http://stackoverflow.com/q/3373995/349384. – YellPika Nov 30 '14 at 18:03

1 Answers1

8

The problem is indicated by this part of the log file:

/usr/bin/ld: cannot find -lgmp

ghc can't find libgmp. Most likely fix is to install the libgmp-dev package, e.g. under Ubuntu:

sudo apt-get install libgmp-dev
ErikR
  • 51,541
  • 9
  • 73
  • 124