为什么我不能在Raspberry Pi上安装GHC 7.8.4的任何软件包? [英] Why can't I install any packages with GHC 7.8.4 on Raspberry Pi?

查看:210
本文介绍了为什么我不能在Raspberry Pi上安装GHC 7.8.4的任何软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据这篇文章,最后有一个GHC版本的debian软件包,支持模板haskell和ghci。



这是真的,我从一个Raspbian的新副本开始,我更改了我的 / etc / apt / sources .list 文件到:

  deb http://http.debian.net/debian sid main contrib非免费
#在下面取消注释行然后'apt-get update'启用'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib非免费的rpi

我做了 sudo apt-get update&& sudo apt-get upgrade ,然后我做了 sudo apt-get install ghc sudo apt-get install cabal-安装



ghc --version 报告7.8.4。 GHCi工作得很好,TH也是如此。



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

  login as:pi 
pi@192.168 .1.5的密码:
Linux raspberrypi 3.18.11-v7 +#781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l

Debian GNU / Linux系统附带的程序是免费软件;
每个程序的确切分配条件在/ usr / share / doc / * / copyright中的
个别文件中描述。

Debian GNU / Linux随附绝对无担保,适用法律允许

上次登录:星期一5月11日17:17:22 2015

$ ghc --version
格拉斯哥Glasgow Haskell编译系统,版本7.8.4
$ mkdir测试
$ cd测试
$ cabal沙箱初始化
编写一个默认包环境文件到
/home/pi/test/cabal.sandbox.config
创建一个新的sandbox at /home/pi/test/.cabal-sandbox
$ cabal install array
解决依赖关系...
注意:安装到位于/ home / pi / test /的沙箱中。 cabal-sandbox
正在下载array-0.5.1.0 ...
配置array-0.5.1.0 ...
未能安装array-0.5.1.0
构建日志(/ home /pi/test/.cabal-sandbox/logs/array-0.5.1.0.log):
cabal:错误:某些软件包未能安装:
array-0.5.1.0在配置步骤中失败。例外情况是:
用户错误('/ usr / bin / ghc'退出并显示错误:
/tmp/ghc2287_0/ghc2287_6.s:汇编程序消息:

/ tmp /ghc2287_0/ghc2287_6.s:76:0:
错误:所选处理器不支持ARM模式`movw
r7,:lower16:stg_bh_upd_frame_info'

/ tmp / ghc2287_0 / ghc2287_6.s:77:0:
错误:所选处理器不支持ARM模式movt
r7,:upper16:stg_bh_upd_frame_info'

/tmp/ghc2287_0/ghc2287_6.s :80:0:
错误:所选处理器不支持ARM模式`movw
r7,:lower16:base_GHCziTopHandler_runMainIO_closure'

/tmp/ghc2287_0/ghc2287_6.s:81: 0:
错误:所选处理器不支持ARM模式`movt
r7,:upper16:base_GHCziTopHandler_runMainIO_closure'

/tmp/ghc2287_0/ghc2287_6.s:82:0:
错误:所选处理器不支持ARM模式`movw
r8,:lower16:Cabalzm1zi22zi1zi1_DistributionziSimple_defaultMain_closure'

/tmp/ghc2287_0/ghc2287_6.s:83:0:
埃罗r:所选处理器不支持ARM模式`movt
r8,:upper16:Cabalzm1zi22zi1zi1_DistributionziSimple_defaultMain_closure'

有人知道我在什么地方脱轨吗?

更新

  $ cabal --version 
cabal-install版本1.22.0.1
使用Cabal库的版本1.22.1.1
- ghc-options = -opta-march = armv7a 作为一个选项,每次你想用GHC或者 cabal install 来创建一些东西。有了它,它就可以工作了!



更新

c $ c> - ghc-options = - opta-mcpu = cortex-a7 -opta-mfpu = neon -opta-mtune = native -opta-mfloat-abi = hard ,浮点数将会我也是通过猜测和检查来阅读旧论坛帖子的,所以它可能也不是最好的设置。



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


According to this post there is finally a debian package for a version of GHC that supports template haskell and ghci.

And this is true, I started from a fresh copy of Raspbian, I changed my /etc/apt/sources.list file to:

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

I did sudo apt-get update && sudo apt-get upgrade, and then I did sudo apt-get install ghc and sudo apt-get install cabal-install.

ghc --version reports 7.8.4. GHCi works just fine, and so does TH.

But for some reason I can't install any packages with cabal. No matter which one I pick, I get some version of this error:

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

Does anyone know where I went off the rails?

Update

$ cabal --version
cabal-install version 1.22.0.1
using version 1.22.1.1 of the Cabal library

解决方案

It needs --ghc-options=-opta-march=armv7a as an option every time you want to build something with GHC or cabal install something. With this, it works!

Update

If instead you do --ghc-options="-opta-mcpu=cortex-a7 -opta-mfpu=neon -opta-mtune=native -opta-mfloat-abi=hard, floating point will work too. I arrived at this by guessing-and-checking and reading old forum posts, so its possible that these too are not the best settings.

Cabal also has a user configuration file where you can store this setting and have it applied whenever GHC is invoked.

这篇关于为什么我不能在Raspberry Pi上安装GHC 7.8.4的任何软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆