我在CentOS 7上完成了Haskell平台的全新安装,如下所示:
[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!
但是我收到以下错误:
[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
我尝试过以下操作,但没效果:
sudo yum reinstall ghc-zlib-devel
sudo yum reinstall zlib-devel
sudo yum reinstall ghc-ghc-devel
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
编辑:如果要相信yum whatprovides libHSzlib*ghc*
,ghc-zlib-devel
会安装libHSzlib-0.5.4.1-ghc7.6.3.so
。但是,唯一的文件find / -name 'libHSzlib*.so' returns is
libHSzlib-0.5.4.1-ghc7.8.3.so`(请注意 8 与 6 )。
答案 0 :(得分:1)
以下是我解决问题的方法:
首先,我手动安装了ghc。
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
注意:即使我安装的版本是在Debian 7“wheezey”系统上制作的,据说只需要libgmp.so.10
,我收到有关libgmp.so.3
的错误消息。我通过以下方式解决了这个问题,我知道这是一个糟糕的事情:
sudo ln -s /usr/lib64/libgmp.so.10 /usr/lib64/libgmp.so.3
接下来,我尝试手动安装Haskell平台,使用以下命令:
./platform.sh /home/amy/ghc-7.8.3-x86_64-unknown-linux-deb7.tar.xz
但我收到了关于libHSzlib-0.5.4.1-ghc7.6.3.so
的现在熟悉的错误消息。
所以我手动安装了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