我正在安装 haskell 代码如下
git clone git://github.com/ghc/ghc.git && cd ghc && ./sync-all get
cd ghc && ./sync-all get cd ghc && ./boot && ./configure && make && make install
当我尝试使用 ./sync-all get 时出现以下错误:
Cloning into 'ghc'...
/bin/sh: 1: ./sync-all: not found
当我尝试在代码中不使用 ./sync-all 时,出现以下错误
It seems you cloned this repository from GitHub. But your git config files
don't contain the url rewrites that are needed to make this work (GitHub
doesn't support '/' in repository names, so we use a different naming scheme
for the submodule repositories there).
Please run the following commands first:
git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/
git config --global url."http://github.com/ghc/packages-".insteadOf http://github.com/ghc/packages/
git config --global url."https://github.com/ghc/packages-".insteadOf https://github.com/ghc/packages/
git config --global url."ssh://[email protected]/ghc/packages-".insteadOf ssh://[email protected]/ghc/packages/
git config --global url."[email protected]:/ghc/packages-".insteadOf [email protected]:/ghc/packages/
And then:
git submodule update --init
./boot
Or start over, and clone the GHC repository from the haskell server:
git clone --recursive git://git.haskell.org/ghc.git
For more information, see:
* https://ghc.haskell.org/trac/ghc/wiki/Newcomers or
* https://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources#CloningfromGitHub
请提供解决方案
答案1
这Haskell 平台可通过 Ubuntu 存储库获取。
Haskell 平台
要通过 repo 安装,请执行以下操作:
sudo apt-get install haskell-platform
通过安装网站:
wget https://haskell.org/platform/download/7.10.2/haskell-platform-7.10.2-a-unknown-linux-deb7.tar.gz
tar xf haskell-platform-7.10.2-a-unknown-linux-deb7.tar.gz
sudo ./install-haskell-platform.sh
Haskell 编译器
要安装 Haskell 编译器,请按照以下步骤逐步进行。
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install -y cabal-install-1.20 ghc-7.8.4
cat >> ~/.bashrc <<EOF export PATH="\$HOME/.cabal/bin:/opt/cabal/1.20/bin:/opt/ghc/7.8.4/bin:\$PATH" EOF export PATH=~/.cabal/bin:/opt/cabal/1.20/bin:/opt/ghc/7.8.4/bin:$PATH
cabal update
cabal install alex happy
答案2
正如所述自述,通过以下方式克隆存储库
git clone --recursive git://git.haskell.org/ghc.git
在那之后
cd ghc
./boot
./configure
make
sudo make install
问题
$./configure 检查 gfind... 没有 检查查找.../usr/bin/find 检查排序.../usr/bin/sort 检查 GHC 版本日期...推断 7.11.20150924 检查 GHC Git 提交 id...推断 1395185f56cda4774d27ae419b10f570276b674d 检查 ghc.../usr/bin/ghc 检查 ghc 版本...7.6.3 配置:错误:编译 GHC 需要 GHC 7.8 或更高版本。
因此对于(amd64
和i386
)
sudo apt-add-repository ppa:hvr/ghc
sudo apt-get update
sudo apt-get install ghc-7.10.3
但是这部分...安装在/opt
因此您必须创建一些符号链接或必须调整一些路径。