mhwombat
mhwombat

Reputation: 8136

cabal: error while loading shared libraries: libHSzlib-0.5.4.1-ghc7.6.3.so

I've done a fresh install of the Haskell platform on CentOS 7, like so:

[amy@wombat115 ~]$ sudo yum install haskell-platform
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered with Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
 * base: ftp.sunet.se
 * epel: ftp.lysator.liu.se
 * extras: ftp.sunet.se
 * updates: ftp.sunet.se
Resolving Dependencies
--> Running transaction check
---> Package haskell-platform.x86_64 0:2013.2.0.0-36.el7 will be installed
--> Processing Dependency: ghc-haskell-platform-devel = 2013.2.0.0-36.el7 for package: haskell-platform-2013.2.0.0-36.el7.x86_64
--> Processing Dependency: cabal-install = 1.16.0.2 for package: haskell-platform-2013.2.0.0-36.el7.x86_64
--> Running transaction check
---> Package cabal-install.x86_64 0:1.16.0.2-32.el7 will be installed
---> Package ghc-haskell-platform-devel.x86_64 0:2013.2.0.0-36.el7 will be installed
--> Processing Dependency: ghc = 7.6.3 for package: ghc-haskell-platform-devel-2013.2.0.0-36.el7.x86_64
--> Running transaction check
---> Package ghc.x86_64 0:7.6.3-18.3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================
 Package                                     Arch                    Version                             Repository             Size
=====================================================================================================================================
Installing:
 haskell-platform                            x86_64                  2013.2.0.0-36.el7                   epel                   12 k
Installing for dependencies:
 cabal-install                               x86_64                  1.16.0.2-32.el7                     epel                  452 k
 ghc                                         x86_64                  7.6.3-18.3.el7                      epel                   35 k
 ghc-haskell-platform-devel                  x86_64                  2013.2.0.0-36.el7                   epel                   15 k

Transaction Summary
=====================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 514 k
Installed size: 2.9 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): haskell-platform-2013.2.0.0-36.el7.x86_64.rpm                                                          |  12 kB  00:00:00     
(2/4): ghc-haskell-platform-devel-2013.2.0.0-36.el7.x86_64.rpm                                                |  15 kB  00:00:00     
(3/4): ghc-7.6.3-18.3.el7.x86_64.rpm                                                                          |  35 kB  00:00:00     
(4/4): cabal-install-1.16.0.2-32.el7.x86_64.rpm                                                               | 452 kB  00:00:01     
-------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                461 kB/s | 514 kB  00:00:01     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : ghc-7.6.3-18.3.el7.x86_64                                                                                         1/4 
  Installing : ghc-haskell-platform-devel-2013.2.0.0-36.el7.x86_64                                                               2/4 
/var/tmp/rpm-tmp.5ERaqJ: line 1: /usr/bin/ghc-pkg: No such file or directory
  Installing : cabal-install-1.16.0.2-32.el7.x86_64                                                                              3/4 
  Installing : haskell-platform-2013.2.0.0-36.el7.x86_64                                                                         4/4 
  Verifying  : cabal-install-1.16.0.2-32.el7.x86_64                                                                              1/4 
  Verifying  : ghc-haskell-platform-devel-2013.2.0.0-36.el7.x86_64                                                               2/4 
  Verifying  : ghc-7.6.3-18.3.el7.x86_64                                                                                         3/4 
  Verifying  : haskell-platform-2013.2.0.0-36.el7.x86_64                                                                         4/4 

Installed:
  haskell-platform.x86_64 0:2013.2.0.0-36.el7                                                                                        

Dependency Installed:
  cabal-install.x86_64 0:1.16.0.2-32.el7    ghc.x86_64 0:7.6.3-18.3.el7    ghc-haskell-platform-devel.x86_64 0:2013.2.0.0-36.el7   

Complete!

But I get the following error:

[amy@wombat115 ~]$ cabal update
cabal: error while loading shared libraries: libHSzlib-0.5.4.1-ghc7.6.3.so: cannot open shared object file: No such file or directory

I have tried the following, to no effect:

sudo yum reinstall ghc-zlib-devel
sudo yum reinstall zlib-devel
sudo yum reinstall ghc-ghc-devel

EDIT: I have also tried the following:

sudo yum reinstall ghc-zlib-devel-0.5.4.1
sudo yum reinstall ghc-zlib-devel-0.5.4.1-26.el7
sudo yum reinstall cabal-install
sudo yum reinstall ghc-Cabal

EDIT: If yum whatprovides libHSzlib*ghc* is to be believed, ghc-zlib-devel installs libHSzlib-0.5.4.1-ghc7.6.3.so. However, the only file find / -name 'libHSzlib*.so' returns islibHSzlib-0.5.4.1-ghc7.8.3.so` (note the 8 vs. 6).

Upvotes: 4

Views: 1233

Answers (1)

mhwombat
mhwombat

Reputation: 8136

Here's how I solved the problem:

First, I installed ghc manually.

wget https://www.haskell.org/ghc/dist/7.8.4/ghc-7.8.4-i386-unknown-linux-deb7.tar.xz
tar xvf ghc-7.8.4-i386-unknown-linux-deb7.tar.xz 
cd ghc-7.8.4
sudo mkdir /usr/local/ghc-7.8.4
./configure --prefix=/usr/local/ghc-7.8.4

NOTE: Even though the version I installed was made on a Debian 7 "wheezey" system and supposedly only requires libgmp.so.10, I got error messages about libgmp.so.3. I worked around that by doing the following, which I know is a bad thing to do:

sudo ln -s /usr/lib64/libgmp.so.10 /usr/lib64/libgmp.so.3

Next, I tried installing the Haskell Platform manually, using the command:

./platform.sh /home/amy/ghc-7.8.3-x86_64-unknown-linux-deb7.tar.xz

but I got the now familiar error messages about libHSzlib-0.5.4.1-ghc7.6.3.so.

So I manually installed cabal.

git clone https://github.com/haskell/cabal.git
cd cabal/Cabal
ghc -threaded --make Setup
./Setup configure
./Setup build
sudo ./Setup install
cd ../cabal-install
./bootstrap.sh

Upvotes: 1

Related Questions