为什么我不能在Raspberry Pi上安装GHC 7.8.4的任何软件包?

时间:2015-05-12 21:12:09

标签: linux haskell raspberry-pi

根据this post,最终有一个支持模板haskell和ghci的GHC版本的debian包。

这是真的,我从Raspbian的新副本开始,我将 #movie-player { padding: 0.7em; margin: 0 auto; width: -webkit-calc((100% - 3em) / 1); width: calc((100% - 3em) / 1); max-width: 600px; border: 1px solid #e7e7e7; } <figure> <video class="fadescript" id="movie-player" width="640" height="360" preload controls> <source src="video/explainervideo.mp4" /> <source src="video/explainervideo.ogv" /> <source src="video/explainervideo.webm" /> </video> </figure> 文件更改为:

/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 upgradesudo apt-get install ghc

sudo apt-get install cabal-install报告7.8.4。 GHCi工作正常,TH也是如此。

但出于某种原因,我无法安装任何带有cabal的软件包。无论我选择哪一个,我都会得到一些错误版本:

ghc --version

有谁知道我离开了哪里?

更新

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'
)

1 个答案:

答案 0 :(得分:6)

每次你想用GHC或--ghc-options=-opta-march=armv7a构建东西时,它都需要cabal install。有了这个,它就有用了!

<强>更新

如果你执行--ghc-options="-opta-mcpu=cortex-a7 -opta-mfpu=neon -opta-mtune=native -opta-mfloat-abi=hard,浮点也会起作用。我通过猜测和检查以及阅读旧的论坛帖子来达到这个目的,所以这些也可能不是最好的设置。

Cabal还有一个用户配置文件,您可以在其中存储此设置,并在调用GHC时应用它。