根据这篇文章,终于有一个支持模板哈斯克尔和ghci的GHC版本的debian软件包可用了。事实如此,我从全新的Raspbian开始,修改了
我执行了
但是由于某些原因,我无法使用cabal安装任何软件包。无论我选择哪个软件包,都会出现以下错误的某个版本:
/etc/apt/sources.list
文件为:deb http://http.debian.net/debian sid main contrib non-free
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi
我执行了
sudo apt-get update && sudo apt-get upgrade
,然后我执行了sudo apt-get install ghc
和sudo apt-get install cabal-install
。
ghc --version
显示版本为7.8.4。GHCi可以正常工作,TH也可以。但是由于某些原因,我无法使用cabal安装任何软件包。无论我选择哪个软件包,都会出现以下错误的某个版本:
login as: pi
pi@192.168.1.5's password:
Linux raspberrypi 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon May 11 17:17:22 2015
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4
$ mkdir test
$ cd test
$ cabal sandbox init
Writing a default package environment file to
/home/pi/test/cabal.sandbox.config
Creating a new sandbox at /home/pi/test/.cabal-sandbox
$ cabal install array
Resolving dependencies...
Notice: installing into a sandbox located at /home/pi/test/.cabal-sandbox
Downloading array-0.5.1.0...
Configuring array-0.5.1.0...
Failed to install array-0.5.1.0
Build log ( /home/pi/test/.cabal-sandbox/logs/array-0.5.1.0.log ):
cabal: Error: some packages failed to install:
array-0.5.1.0 failed during the configure step. The exception was:
user error ('/usr/bin/ghc' exited with an error:
/tmp/ghc2287_0/ghc2287_6.s: Assembler messages:
/tmp/ghc2287_0/ghc2287_6.s:76:0:
Error: selected processor does not support ARM mode `movw
r7,:lower16:stg_bh_upd_frame_info'
/tmp/ghc2287_0/ghc2287_6.s:77:0:
Error: selected processor does not support ARM mode `movt
r7,:upper16:stg_bh_upd_frame_info'
/tmp/ghc2287_0/ghc2287_6.s:80:0:
Error: selected processor does not support ARM mode `movw
r7,:lower16:base_GHCziTopHandler_runMainIO_closure'
/tmp/ghc2287_0/ghc2287_6.s:81:0:
Error: selected processor does not support ARM mode `movt
r7,:upper16:base_GHCziTopHandler_runMainIO_closure'
/tmp/ghc2287_0/ghc2287_6.s:82:0:
Error: selected processor does not support ARM mode `movw
r8,:lower16:Cabalzm1zi22zi1zi1_DistributionziSimple_defaultMain_closure'
/tmp/ghc2287_0/ghc2287_6.s:83:0:
Error: selected processor does not support ARM mode `movt
r8,:upper16:Cabalzm1zi22zi1zi1_DistributionziSimple_defaultMain_closure'
)
请问有人知道我哪里偏离了轨道吗?
更新
$ cabal --version
cabal-install version 1.22.0.1
using version 1.22.1.1 of the Cabal library
cabal install base-io-access
,看看是否有效。我负责那个(微小的、未完成的,请勿在实际代码中使用)包,但它只依赖于base
,不涉及任何 FFI 或类似的内容。这是你可以要求的最简单的包。如果它无法编译,则会告诉你出了什么大问题;如果它能够编译,则取决于包的依赖关系。 - bheklilrexact-pi
运行的测试,它只依赖于基础库。我刚试了一下你的代码,得到了相同的结果。(基本上,只是临时文件名不同,但是行号和字符位置都相同。) - Doug McClean