Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install cabal-install

I've just installed Mint 17 on my laptop and followed this with haskell platform generic. (I chose generic instead of using apt-get because it was the only way I could get ghc 7.10) When I try:

cabal install cabal-install

I get this error:

Resolving dependencies...
Configuring cabal-install-1.22.6.0...
Failed to install cabal-install-1.22.6.0
Build log ( /home/william/.cabal/logs/cabal-install-1.22.6.0.log ):
cabal: Error: some packages failed to install:
cabal-install-1.22.6.0 failed during the configure step. The exception was:
user error ('/usr/local/bin/ghc' exited with an error:
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
)

Does anyone know how to fix this ?

update:

Fixed by installing libgmp-dev

like image 664
BillyBadBoy Avatar asked Feb 18 '26 20:02

BillyBadBoy


1 Answers

[edit] You already found that

sudo apt-get install libgmp-dev

should solve your problem (for Mint - for systems without apt-get you would need to use the resident package manager, and in other apt-get based system there could be variation in package names).

If you run into similar errors in the future, here is the reasoning with which to solve the problem: ld is a linker, essentially linking libraries into a program which is being compiled. -lgmp is the argument supplied to ld, telling it to link in the library gmp. It cannot find this library, so either you need to:

(a) tell it about its location in case you know you have the library (the cabal argument --extra-lib-dirs= is useful in this case), or

(b) install the library (google the library name and your system).

GMP is the GNU MP Bignum library which plays a role in providing the Integer and Fractional types.

like image 161
Sam van Herwaarden Avatar answered Feb 20 '26 19:02

Sam van Herwaarden



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!