Re: [Haskell-cafe] Haskell (GHC 7) on ARM

Joshua Poehls
Hello Ben,
Hello, Sorry for the latency. I'm currently on vacation in Germany so I haven't had terribly consistent Internet access. I've Cc'd haskell-cafe@ as I've been meaning to document my experiences anyways and your email seems like a good excuse to do this.
I just got a Raspberry Pi and I'm interested in running Haskell on it. So far I'm running Arch Linux ARM and I noticed there is is a GHC package available, but it is version 6.12.3.
Doing research online I saw that you did some work on adding GHCi support for ARM in GHC 7.4. I was wondering if you had anything to share related to running GHC/GHCI 7.4 on ARM, specifically Arch Linux ARM.
Indeed my ARM linker patch was merged into GHC 7.4.2. This means that ARM is now a fully supported target platform for GHC, complete with GHCi support (which is pretty much necessary for many ubuiquitous packages). My ARM development environment consists of a PandaBoard (and before this a BeagleBoard) running Linaro's Ubuntu distribution. For this reason, I'm afraid I won't be of terribly much help in the case of Arch. That being said, GHC has a wonderful build system which has never given me trouble (except in cases of my own stupidity). Just installing the required development packages and following the build instructions on Wiki[1] is generally quite sufficient. I've also have some notes of my own[2] where I've collected my own experiences. As you likely know, GHC doesn't have a native ARM code generator of its own, instead relying on LLVM for low-level code generation. For this reason, you'll first need to have a working LLVM build. I have found that the ARM backend in the 3.0 release is a bit buggy and therefore generally pull directly from git (HEAD on my development box is currently sitting at 7750ff1e3cbb which seems to be stable). That being said, I haven't done much work in this space recently and it's quite likely that the 3.1 release is better in this respect. Compiling LLVM is one case where I have found the limited memory of my BeagleBoard (which is I believe is similar to the Raspberry Pi) to be quite troublesome. There are cases during linking where over a gigabyte of memory is necessary. At this stage the machine can sit for hours thrashing against its poor SD card making little progress. For this reason, I would strongly recommend that you cross-compile LLVM. The process is pretty straightforward and I have collected some notes on the matter[3]. The size of GHC means that in principle one would prefer to cross-compile. Unfortunately, support[4] for this is very new (and perhaps not even working/complete[5]?) so we have to make due with what we have. The build process itself is quite simple. You will want to be very careful to ensure that the ghc/libraries/ trees are sitting on the same branch as your ghc/ tree (with the ghc/sync-all script). Inconsistency here can lead to very ambiguous build failures. Otherwise, the build is nearly foolproof (insofar as this word can describe any build process). The build takes the better part of a day on my dual-core Pandaboard. I can't recall what the maximum memory consumption was but I think it might fit in 512MB. Lastly, if I recall correctly, you will find that you'll need to first build GHC 7.0 bootstrapped from 6.12 before you can build 7.4 (which requires a fairly new stage 0 GHC). Let the list know if you encounter any issues. I'll try to dust off my own development environment once I get back to the states next week to ensure that everything still works. I've been meaning to setup the PandaBoard as a build slave as Karel's has been failing for some time now (perhaps you could look into this, Karel?). Moreover, perhaps I can find a way to produce redistributable binaries to help others get started. Cheers, - Ben [1] http://hackage.haskell.org/trac/ghc/wiki/Building [2] http://bgamari.github.com/posts/ghc-llvm-arm.html [3] http://bgamari.github.com/posts/cross-compiling_llvm.html [4] http://hackage.haskell.org/trac/ghc/wiki/CrossCompilation [5] http://www.haskell.org/pipermail/cvs-ghc/2012-February/070791.html

On 06/10/12 03:06 PM, Ben Gamari wrote:
Let the list know if you encounter any issues. I'll try to dust off my own development environment once I get back to the states next week to ensure that everything still works. I've been meaning to setup the PandaBoard as a build slave as Karel's has been failing for some time now (perhaps you could look into this, Karel?).
Hi Ben, my builder machine is i.MX53 Quick Start Board and it's not failing due to software or hardware issue, but simply GHC HEAD is broken on ARM since February this year. Over the weekend I've tried to git bisect to get the culprit patch, but so far no results. I'll continue or better both ARM machines I do have available here will continue working on this. Cheers, Karel

This is my first time hearing of Arch Linux ARM (http://archlinuxarm.org/) but since it is based on Arch Linux (http://www.archlinux.org/), it seems odd that Arch Linux ARM's ghc is still 6.12.3, when Arch Linux's ghc has been 7.4.1 since March 3 or earlier. As far as I could see, all the other Arch Linux ARM packages are the same versions as those in Arch Linux. Maybe it would be worthwhile to prod the Arch Linux ARM developers? On 2012-Jun-10, Ben Gamari wrote:
Joshua Poehls
writes: Hello Ben,
Hello,
Sorry for the latency. I'm currently on vacation in Germany so I haven't had terribly consistent Internet access.
I've Cc'd haskell-cafe@ as I've been meaning to document my experiences anyways and your email seems like a good excuse to do this.
I just got a Raspberry Pi and I'm interested in running Haskell on it. So far I'm running Arch Linux ARM and I noticed there is is a GHC package available, but it is version 6.12.3.
... ...
-- Gregory D. Weber, Ph. D. : Associate Professor of Informatics / \ Indiana University East 0 : Tel. (765) 973-8420; FAX (765) 973-8550 / \ http://mypage.iu.edu/~gdweber/ 1 []

Where do you even see ghc? I can't see ghc listed anywhere here:
http://archlinuxarm.org/packages
-Rob
On Tue, Jun 12, 2012 at 2:12 AM,
This is my first time hearing of Arch Linux ARM (http://archlinuxarm.org/) but since it is based on Arch Linux (http://www.archlinux.org/), it seems odd that Arch Linux ARM's ghc is still 6.12.3, when Arch Linux's ghc has been 7.4.1 since March 3 or earlier. As far as I could see, all the other Arch Linux ARM packages are the same versions as those in Arch Linux. Maybe it would be worthwhile to prod the Arch Linux ARM developers?
On 2012-Jun-10, Ben Gamari wrote:
Joshua Poehls
writes: Hello Ben,
Hello,
Sorry for the latency. I'm currently on vacation in Germany so I haven't had terribly consistent Internet access.
I've Cc'd haskell-cafe@ as I've been meaning to document my experiences anyways and your email seems like a good excuse to do this.
I just got a Raspberry Pi and I'm interested in running Haskell on it.
So
far I'm running Arch Linux ARM and I noticed there is is a GHC package available, but it is version 6.12.3.
... ...
-- Gregory D. Weber, Ph. D. : Associate Professor of Informatics / \ Indiana University East 0 : Tel. (765) 973-8420; FAX (765) 973-8550 / \ http://mypage.iu.edu/~gdweber/ 1 []
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 2012-Jun-12, Robert Wills wrote:
Where do you even see ghc? I can't see ghc listed anywhere here:
http://archlinuxarm.org/packages
-Rob
On that very page, http://archlinuxarm.org/packages I type "ghc" under Keywords, and it shows this (without going to another URL): Arch Repo Package Version Description armv5 extra ghc 6.12.3-1 The Glasgow Haskell Compiler Greg
On Tue, Jun 12, 2012 at 2:12 AM,
wrote: This is my first time hearing of Arch Linux ARM (http://archlinuxarm.org/) but since it is based on Arch Linux (http://www.archlinux.org/), it seems odd that Arch Linux ARM's ghc is still 6.12.3, when Arch Linux's ghc has been 7.4.1 since March 3 or earlier. As far as I could see, all the other Arch Linux ARM packages are the same versions as those in Arch Linux. Maybe it would be worthwhile to prod the Arch Linux ARM developers?
On 2012-Jun-10, Ben Gamari wrote:
Joshua Poehls
writes: Hello Ben,
Hello,
Sorry for the latency. I'm currently on vacation in Germany so I haven't had terribly consistent Internet access.
I've Cc'd haskell-cafe@ as I've been meaning to document my experiences anyways and your email seems like a good excuse to do this.
I just got a Raspberry Pi and I'm interested in running Haskell on it.
So
far I'm running Arch Linux ARM and I noticed there is is a GHC package available, but it is version 6.12.3.
... ...
-- Gregory D. Weber, Ph. D. : Associate Professor of Informatics / \ Indiana University East 0 : Tel. (765) 973-8420; FAX (765) 973-8550 / \ http://mypage.iu.edu/~gdweber/ 1 []
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Gregory D. Weber, Ph. D. : Associate Professor of Informatics / \ Indiana University East 0 : Tel. (765) 973-8420; FAX (765) 973-8550 / \ http://mypage.iu.edu/~gdweber/ 1 []
participants (4)
-
Ben Gamari
-
gdweber@iue.edu
-
Karel Gardas
-
Robert Wills