[Haskell-cafe] Problems with libgmp on Amazon Linux

Nicu Ionita nicu.ionita at acons.at
Sat Jan 7 01:08:17 CET 2012


I saw [1] there is a lot of activity in the Haskell community regarding 
Amazon Web Services (AWS). As they allow an easy start [2], I decided to 
giv it a try and followed the procedure published by JP Moresmau [3] to 
install the Haskell Plattform on Amazon Linux (a minimal linux 
distribution maintained by Amazon), but with the new Haskell Platform, 
2011.4.0.0 (and ghc 7.0.4).

It seemed to work pretty well, with some problems when configuring HP, 
because although libgmp was already installed, it was not recognized. I 
installed the newer version 5.0.2 (from sources) [4], did some tricks 
(cp /usr/lib/lib/libgmp* /usr/lib), then configure worked and HP was 
built and installed.

But then later I wanted to install the aws package (cabal install aws) 
and then the vector package could not be installed - again because of 
libgmp! Here are the last messages, followed by a ls of /usr/lib, where 
it's clear that the libraries are there:

[ 4 of 30] Compiling Data.Vector.Internal.Check ( 
Data/Vector/Internal/Check.hs, dist/build/Data/Vector/Internal/Check.o )
[ 5 of 30] Compiling Data.Vector.Fusion.Stream.Monadic ( 
dist/build/Data/Vector/Fusion/Stream/Monadic.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... <command line>: can't load .so/.DLL for: 
gmp (libgmp.so: cannot open shared object file: No such file or directory)
cabal: Error: some packages failed to install:
vector-0.9.1 failed during the building phase. The exception was:
ExitFailure 1
[ec2-user at ip-10-234-49-92 ~]$ ls -l /usr/lib/libgmp*
-rw-r--r-- 1 root root 1175336 Jan  4 22:21 /usr/lib/libgmp.a
-rwxr-xr-x 1 root root     915 Jan  4 22:21 /usr/lib/libgmp.la
-rwxr-xr-x 1 root root  484673 Jan  4 22:21 /usr/lib/libgmp.so
-rwxr-xr-x 1 root root  484673 Jan  4 22:21 /usr/lib/libgmp.so.10
-rwxr-xr-x 1 root root  484673 Jan  4 22:21 /usr/lib/libgmp.so.10.0.2
[ec2-user at ip-10-234-49-92 ~]$

I'm just asking here hoping that someone had already solved this 
problem. Or perhaps someone can explain how cabal ensures that a library 
is there. The error message - as it is - is meaningless, as the file 
exists and has read permissions for everybody.

Thank you,

[2] https://aws.amazon.com/free/
[4] ftp://ftp.gnu.org/gnu/gmp/

More information about the Haskell-Cafe mailing list