haskell - 无法在 CentOS 服务器上安装和使用 Cabal (Haskell) - zlib-0.5.4.1 在构建阶段失败

标签 haskell centos zlib cabal cabal-install

我正在尝试在我的服务器上安装一个在 Cabal 中运行的 Haskell 服务器。当我正常配置服务器来运行它时,我遵循这些我们已经改进的说明 - 它们每次都在空白的机架空间云服务器上 100% 工作。

yum update
yum install git
yum install vim
yum install ghc-zlib-devel.x86_64
wget http://www.haskell.org/ghc/dist/7.8.2/ghc-7.8.2-x86_64-unknown-linux-centos65.tar.xz
wget http://www.haskell.org/cabal/release/cabal-install-1.20.0.1/cabal-x86_64-unknown-linux.tar.gz
tar xvfJ ghc-7.8.2-x86_64-unknown-linux-centos65.tar.xz
tar -zxvf cabal-x86_64-unknown-linux.tar.gz
cd ghc-7.8.2
./configure
yum install gcc
./configure
make install
cd ../
git clone https://github.com/samheather/DSA-WAW.git
cd DSA-WAW/server
cp -r ../../cabal cabal
./cabal update
./cabal install cabal-install
./cabal sandbox init
cabal install

然后我可以简单地导航到输出文件夹并运行服务器。

但是,在我装有 iWeb 的专用服务器上,这不起作用。前大部分步骤都很好,直到到达“./cabal install cabal-install”,它抛出以下错误:

./cabal install cabal-install
Resolving dependencies...
Configuring network-2.5.0.0...
Configuring zlib-0.5.4.1...
Configuring Cabal-1.20.0.1...
Building zlib-0.5.4.1...
Failed to install zlib-0.5.4.1
Last 10 lines of the build log ( /root/.cabal/logs/zlib-0.5.4.1.log ):
Configuring zlib-0.5.4.1...
Building zlib-0.5.4.1...
Preprocessing library zlib-0.5.4.1...
hsc2hs: dist/build/Codec/Compression/Zlib/Stream_hsc_make: runProcess: runInteractiveProcess: exec: permission denied (Permission denied)
Failed to install network-2.5.0.0
Last 10 lines of the build log ( /root/.cabal/logs/network-2.5.0.0.log ):
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/tmp/network-2.5.0.0-4813/network-2.5.0.0':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Failed to install Cabal-1.20.0.1
Last 10 lines of the build log ( /root/.cabal/logs/Cabal-1.20.0.1.log ):
[68 of 76] Compiling Distribution.Simple.Build ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/Build.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/Build.o )
[69 of 76] Compiling Distribution.Simple.Haddock ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/Haddock.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/Haddock.o )
[70 of 76] Compiling Distribution.Simple.SrcDist ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/SrcDist.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/SrcDist.o )
[71 of 76] Compiling Distribution.Simple.UserHooks ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/UserHooks.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/UserHooks.o )
[72 of 76] Compiling Distribution.Simple.Bench ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/Bench.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/Bench.o )
[73 of 76] Compiling Distribution.Simple.Test.ExeV10 ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/Test/ExeV10.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/Test/ExeV10.o )
[74 of 76] Compiling Distribution.Simple.Test ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple/Test.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple/Test.o )
[75 of 76] Compiling Distribution.Simple ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/Distribution/Simple.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Distribution/Simple.o )
[76 of 76] Compiling Main             ( /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/setup.hs, /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/Main.o )
Linking /tmp/Cabal-1.20.0.1-4813/Cabal-1.20.0.1/dist/setup/setup ...
cabal: Error: some packages failed to install:
Cabal-1.20.0.1 failed during the configure step. The exception was:
ExitFailure 127
HTTP-4000.2.17 depends on network-2.5.0.0 which failed to install.
cabal-install-1.20.0.3 depends on Cabal-1.20.0.1 which failed to install.
network-2.5.0.0 failed during the configure step. The exception was:
ExitFailure 1
zlib-0.5.4.1 failed during the building phase. The exception was:
ExitFailure 1

有谁知道这是怎么回事?

谢谢,

山姆

更新:我应该提一下,因为服务器已经有 gcc,我们跳过这两个步骤:“yum install gcc; ./configure”

最佳答案

之前安装zlib1g-dev包。

关于haskell - 无法在 CentOS 服务器上安装和使用 Cabal (Haskell) - zlib-0.5.4.1 在构建阶段失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24461456/

相关文章:

haskell - 如何定义一个参数为 "newtype"的 Haskell 函数?

linux - proftpd sftp CentOS 权限被拒绝

CentOS服务器上的Perl设置优先级函数

C++ 从 std::vector 膨胀 zlib

haskell - 停止/Pickling/Unpickling/恢复计算

haskell - Cabal 配置 - "configure"是什么意思?

ubuntu - 如何为玩具 MPI 集群配置静态 IP?

linux - zLib透明写入模式 "wT"性能下降

string - Nodejs中使用zlib对数据进行压缩和解压

haskell - runST 和函数组合