我正在尝试使用最近发布的armv7的ghc二进制文件来启动和运行raspberry pi 2,可在此处获取:
https://www.haskell.org/ghc/download_ghc_7_10_2#linux_armv7
这说它是用debian jesse构建的,所以我在我的pi2上安装了debian jesse。我成功安装了ghc - 至少ghci工作。但是没有阴谋,显然ghc 7.10.2要求阴谋1.22+。 debian版本的cabal类似于1.16(并且还将安装ghc 7.6.x)。所以我正在尝试使用bootstrap.sh脚本从源代码安装cabal-install。下载mtl包并构建一个'Setup'可执行文件,然后尝试执行它。但安装程序exe失败了“非法指令”。
根据下载页面,需要'gold'链接器。我通过做
添加了ln -s
which gold
〜/ bin / ld
并设置我的路径包含〜/ bin。遗憾的是,结果相同。
接下来,我尝试用黄金重新安装ghc二进制文件(我认为)。以root身份:
> ln -s `which gold` /usr/local/bin/ld
> cd ghc-7.10.2
> make install
ghc再次成功安装,但建立cabal-install的结果是相同的:
bburdette@jessie-rpi:~/code/cabal/cabal-install$ ./bootstrap.sh
Using gcc for C compiler. If this is not what you want, set CC.
Using /usr/lib/gcc/arm-linux-gnueabihf/4.9/collect2 instead.
Checking installed packages for ghc-7.10.2...
deepseq is already installed and the version is ok.
binary is already installed and the version is ok.
time is already installed and the version is ok.
Cabal is already installed and the version is ok.
transformers is already installed and the version is ok.
mtl-2.2.1 will be installed from local tarball.
text-1.2.0.3 will be downloaded and installed.
parsec-3.1.7 will be downloaded and installed.
network-2.6.0.2 will be downloaded and installed.
old-locale-1.0.0.7 will be downloaded and installed.
old-time-1.1.0.3 will be downloaded and installed.
HTTP-4000.2.19 will be downloaded and installed.
zlib-0.5.4.2 will be downloaded and installed.
random-1.1 will be downloaded and installed.
stm-2.4.4 will be downloaded and installed.
Using local tarball for mtl-2.2.1.
[1 of 1] Compiling Main ( Setup.hs, Setup.o )
Linking Setup ...
Illegal instruction
Error during cabal-install bootstrap:
Configuring the mtl package failed.
有什么想法吗?
我想知道符号链接是否是为此启用黄金的正确方法?也许我需要在每个cabal项目中添加它作为ghc选项,还是有其他方法可以使用黄金?或许这根本不是问题?
答案 0 :(得分:3)
好的,终于把它理顺了。根据ghc下载页面,您应该使用debian jessie附带的llvm 3.5。但是默认的llvm版本是3.5-10并且不起作用。所需要的是3.5.2-2。
我下载了3.5.2-2的deb并安装但它变成了依赖地狱很快,需要安装llvm 3.5.2-2所需的5-6个库。我切换到debian测试,安装llvm更容易。如果您正在进行debian实验,可能会更容易。
我使用的ghc 7.10.2包: https://packages.debian.org/experimental/armhf/ghc/download
我在debian jessie上使用默认llvm 3.5的错误: https://ghc.haskell.org/trac/ghc/ticket/10863