GHCi在树莓派2? [英] GHCi on raspberry pi 2?

查看:222
本文介绍了GHCi在树莓派2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一些运行在raspberry pi 2上的haskell项目以及可以使用raspbian(7.4.1)的apt-get安装的ghc版本。它没有GHCi,它可以防止编译一些重要的软件包(如Vector)。我已经看到了一些有关能够将更高版本的ghc(带有ghci)放到pi上的传闻,但最近没有。 haskell wiki上的条目看起来已经过时了几年。有没有人有这样的运气?

解决方案

我有这个运气!


sagemuej @ sagemuej-Aspire-5742G:〜$ ssh pi-loc

Linux raspberrypi 3.12 .28+#709 PREEMPT星期一9月8日15:28:00 BST 2014 armv6l



包含在Debian GNU / Linux系统中的程序是免费软件;

每个程序的确切分配条件在/ usr / share / doc / * / copyright中的

个别文件中有描述。



Debian GNU / Linux附带ABSOLUTELY NO WARRANTY,在适用法律允许的范围内


上次登录:周三4月1日00:24:44从sagemuej-aspire-5742g.localdomain

pi @ raspberrypi:〜$ ghci

GHCi,版本7.8.2:http://www.haskell.org/ghc/ :?帮助

加载包ghc-prim ...链接... done。

加载包integer-gmp ...链接...完成。

正在加载软件包基础...链接...已完成。

Prelude> :m + Data.Vector

Prelude Data.Vector> fromList [1,2,3]

加载package array-0.5.0.0 ...链接... done。

加载package deepseq-1.3 .0.2 ...链接... done。

加载package primitive-0.5.2.1 ...链接... done。

加载package vector-0.10.9.1 ..链接...完成。

fromList [1,2,3]

Ain'它很好吗?

这是一个完整的GHC 7.8。不过,我不得不从源码引导它。如果我正确记得,正常的设置说明工作得很好–尽管花费了很长时间才建立起来(比如,半个星期的时间)。

主要的问题是内存:对于一些较大的模块,编译器需要比π可以提供的更多,即使在没有X的情况下运行。我所做的只是简单地连接了一个USB硬盘驱动器并在其上设置了一个交换分区。当然,交换使一切变得更慢,但最终它会成功。至少对我来说是这样。


I'm working on a few haskell projects that run on a raspberry pi 2 and the version of ghc that you can install with apt-get from raspbian (7.4.1). It has no GHCi though, which prevents some vital packages (like Vector) from compiling. I've seen a few rumors about being able to get later versions of ghc (with ghci) onto the pi, but nothing recent. The entry on the haskell wiki looks a couple years out of date. Has anyone had any luck with this?

解决方案

I have had some luck with this!

sagemuej@sagemuej-Aspire-5742G:~$ ssh pi-loc
Linux raspberrypi 3.12.28+ #709 PREEMPT Mon Sep 8 15:28:00 BST 2014 armv6l

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: Wed Apr  1 00:24:44 2015 from sagemuej-aspire-5742g.localdomain
pi@raspberrypi:~$ ghci
GHCi, version 7.8.2: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :m +Data.Vector
Prelude Data.Vector> fromList [1,2,3]
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package primitive-0.5.2.1 ... linking ... done.
Loading package vector-0.10.9.1 ... linking ... done.
fromList [1,2,3]

Ain't it nice?

It is a full GHC 7.8. I had to bootstrap it from source, though. Worked pretty fine by the normal setup instructions if I recall correctly – though it took ages to build (like, half a week).

The main issue is memory: for some of the larger modules, the compiler needs more than the π can offer even when running without X. What I did was simply, I connected a USB hard drive and set up a swap partition on it. Of course, swapping makes everything even slower, but eventually it'll succeed. Did for me, at least.

这篇关于GHCi在树莓派2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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