Problems with libgmp on Amazon Linux

Hello, 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 ( Data/Vector/Fusion/Stream/Monadic.hs, 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@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@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, Nicu [1] http://www.reddit.com/r/haskell/comments/o1u2g/deploying_a_haskell_app_to_am... [2] https://aws.amazon.com/free/ [3] http://jpmoresmau.blogspot.com/2011/04/install-ghc7-and-yesod-on-amazon-linu... [4] ftp://ftp.gnu.org/gnu/gmp/

On Sat, Jan 7, 2012 at 8:08 AM, Nicu Ionita
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.
I think you should get the installed libgmp recognized, but not doing tricks like this. It is no problem as a temporary solution, but you should always try to make use of a package manager.
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)
I have no experience with AWS, but it seems that you need to run a ldconfig to rebuild the cache, since you installed libgmp just by copying into /usr/lib. ldconfig -n /usr/bin

Am 07.01.2012 06:04, schrieb Yucheng Zhang:
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. I think you should get the installed libgmp recognized, but not doing tricks
On Sat, Jan 7, 2012 at 8:08 AM, Nicu Ionita
wrote: like this. It is no problem as a temporary solution, but you should always try to make use of a package manager. 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) I have no experience with AWS, but it seems that you need to run a ldconfig to rebuild the cache, since you installed libgmp just by copying into /usr/lib.
ldconfig -n /usr/bin
Thank you, a good point. Just to let a trace for the posterity, here is what I did: I now deleted libgmp* from /usr/lib (which I copied from /usr/lib/lib, where gmp did intstall, although I configured it with --prefix=/usr/lib), then ran: sudo ldconfig /usr/lib/lib which updated also the ld cache, and then I defined (in .bash_profile) LD_LIBRARY_PATH=/usr/lib/lib After a new login everything could be installed (I installed aws and criterion, after which half of Hackage was on my machine ;-) This installation point of gmp is a bit odd, but I don't want now to find out why the gmp intallation procedure doesn't honor --prefix. After this I made an AMI (image) of it, which could be used as a start point for further installations. I did not test the installation extesively yet, but by so many succefully installed packages, I'm confident that everything is ok. Next days I'll play with it. By the way, I let gmp 5.0.2 there, it looks that HP 2011.04 likes it. Nicu
participants (2)
-
Nicu Ionita
-
Yucheng Zhang