Personal tools

Raspberry Pi

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Links)
(Links: Added link "Steps to get Haskell software running on Raspberry Pi")
 
(11 intermediate revisions by 5 users not shown)
Line 8: Line 8:
  
 
== Links ==  
 
== Links ==  
 +
 +
* [https://github.com/blitzcode/hue-dashboard/blob/master/README.md#raspberry-pi Steps to get Haskell software running on Raspberry Pi]
 +
 +
* [https://github.com/ku-fpg/raspberry-pi/wiki/GHC-Cross-Compiler-for-Raspberry-Pi GHC Cross Compiler for Raspberry Pi]
  
 
* [http://www.reddit.com/r/haskell/comments/u7cwv/some_observationsproblems_of_getting_haskellghc/ Some observations/problems of getting Haskell/GHC running on the Raspberry Pi] (Reddit)
 
* [http://www.reddit.com/r/haskell/comments/u7cwv/some_observationsproblems_of_getting_haskellghc/ Some observations/problems of getting Haskell/GHC running on the Raspberry Pi] (Reddit)
Line 20: Line 24:
  
 
* [http://www.raspberrypi.org/phpBB3/viewtopic.php?f=34&t=6655 Haskell/GHC observations on the official Raspberry Pi forum]
 
* [http://www.raspberrypi.org/phpBB3/viewtopic.php?f=34&t=6655 Haskell/GHC observations on the official Raspberry Pi forum]
 +
 +
* [https://haskellembedded.github.io/posts/2015-12-15-arm.html Guide to Haskell ARM compilers, cross-compilers, and QEMU]
 +
 +
* [https://gist.github.com/jamesthompson/7730209b2b154bd0a182e6fe945a2838 A script to install Stack on Raspbian]
  
 
== GHC Status ==
 
== GHC Status ==
Line 28: Line 36:
 
* Debian Squeeze - [http://packages.debian.org/stable/haskell/ghc6 6.12.1-13]
 
* Debian Squeeze - [http://packages.debian.org/stable/haskell/ghc6 6.12.1-13]
 
* Debian Wheezy - [http://packages.debian.org/wheezy/ghc 7.4.1-3]
 
* Debian Wheezy - [http://packages.debian.org/wheezy/ghc 7.4.1-3]
 +
* Raspbian Jessie - 7.6.3-21+rpi1
  
'''Note:''' GHCi does not currently work on ARM below version 7.4.2. See [http://www.haskell.org/pipermail/haskell-cafe/2012-June/101704.html this post on haskell-cafe for information on this]
+
'''Note:''' GHCi does not work on ARM with older versions, but it has become available in GHC 7.8. See [http://www.haskell.org/pipermail/haskell-cafe/2013-December/111825.html this post on haskell-cafe] for the status as of December 2013. [https://stackoverflow.com/questions/29379706/ghci-on-raspberry-pi-2 Success with 7.8 on a Raspberry Pi 2.]
  
[http://www.raspberrypi.org/phpBB3/viewtopic.php?f=34&t=6655 djhuk has been able to compile] and install GHC-7.4.2 via QEMU to the Raspberry Pi but there still seems to be some work to do.
+
There seemed to be a point where GHCi was [http://www.haskell.org/pipermail/haskell-cafe/2012-June/101704.html merged into version 7.4.2.], and it may still be possible to install it in an experimental manner, but it is not (currently) available in the Debian Raspberry Pi repository. [http://www.raspberrypi.org/phpBB3/viewtopic.php?f=34&t=6655 Here is a discussion thread wherein djhuk describes] compiling and installing GHC-7.4.2 via QEMU to the Raspberry Pi, with incomplete GHCi functionality.
 +
 
 +
To build a cross-compiler from Linux to Raspberry Pi (running Raspbian), see the [https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/RaspberryPi GHC Trac].
 +
 
 +
== Libraries ==
 +
 
 +
* pi-lcd
 +
: This package allows using an Adafruit character LCD and keypad kit on a Raspberry Pi from Haskell.
 +
:: [https://hackage.haskell.org/package/pi-lcd The package on Hackage]
 +
:: [https://github.com/ppelleti/pi-lcd On GitHub]
 +
:: [https://mail.haskell.org/pipermail/haskell-cafe/2017-February/126310.html The announcement]
 +
 
 +
* wiringPi
 +
: A Haskell binding to the wiringPi library, for using GPIO on the Raspberry Pi
 +
:: [https://hackage.haskell.org/package/wiringPi The package on Hackage]
 +
:: [https://github.com/ppelleti/hs-wiringPi On GitHub]
 +
:: [https://mail.haskell.org/pipermail/haskell-cafe/2017-January/125909.html The announcement]
  
 
== Current Issues ==
 
== Current Issues ==
The main issues encountered so far is the memory limitations of the device, at 256 MB [[GHC]] will execute fine, but problems will start to arise when using [[cabal-install]] to install new libraries, especially ones with lots of dependencies. Recent model B boards have 512 MB on board [http://www.raspberrypi.org/archives/2180].
+
 
 +
The main issue encountered so far is the memory limitations of the devices with 256 MB RAM; [[GHC]] will execute fine, but problems will start to arise when using [[cabal-install]] to install new libraries, especially ones with lots of dependencies. (Recent model B boards have 512 MB on board [http://www.raspberrypi.org/archives/2180], Raspberry Pi 2 Model B boards have 1GB on board.)
  
 
Potential solutions to this problem have been suggested, including using [http://wiki.qemu.org/Main_Page QEMU] on a more powerful system and thus compiling your application there and copying the resulting binary across to your Raspberry Pi
 
Potential solutions to this problem have been suggested, including using [http://wiki.qemu.org/Main_Page QEMU] on a more powerful system and thus compiling your application there and copying the resulting binary across to your Raspberry Pi
 +
 +
== Books ==
 +
* Heitz, Ryan [http://www.manning.com/heitz/ Hello Raspberry Pi!]. Manning Publications (2015). p.p. 225. ISBN 9781617292453
  
 
== See also ==
 
== See also ==

Latest revision as of 00:09, 15 June 2017

This article is a stub. You can help by expanding it.

Contents

[edit] 1 Introduction

Raspberry Pi is an ARM based single-board computer, developed for educational purposes, costing USD 25. For more details, see the Wikipedia article about Raspberry Pi, or the FAQ list.

Raspberry Pi Beta Board.jpg

[edit] 2 Links

[edit] 3 GHC Status

Of the "official" images currently available from the Raspberry Pi Downloads page, the following versions of GHC are available

  • Arch Linux - 6.12.3-1
  • Debian Squeeze - 6.12.1-13
  • Debian Wheezy - 7.4.1-3
  • Raspbian Jessie - 7.6.3-21+rpi1

Note: GHCi does not work on ARM with older versions, but it has become available in GHC 7.8. See this post on haskell-cafe for the status as of December 2013. Success with 7.8 on a Raspberry Pi 2.

There seemed to be a point where GHCi was merged into version 7.4.2., and it may still be possible to install it in an experimental manner, but it is not (currently) available in the Debian Raspberry Pi repository. Here is a discussion thread wherein djhuk describes compiling and installing GHC-7.4.2 via QEMU to the Raspberry Pi, with incomplete GHCi functionality.

To build a cross-compiler from Linux to Raspberry Pi (running Raspbian), see the GHC Trac.

[edit] 4 Libraries

  • pi-lcd
This package allows using an Adafruit character LCD and keypad kit on a Raspberry Pi from Haskell.
The package on Hackage
On GitHub
The announcement
  • wiringPi
A Haskell binding to the wiringPi library, for using GPIO on the Raspberry Pi
The package on Hackage
On GitHub
The announcement

[edit] 5 Current Issues

The main issue encountered so far is the memory limitations of the devices with 256 MB RAM; GHC will execute fine, but problems will start to arise when using cabal-install to install new libraries, especially ones with lots of dependencies. (Recent model B boards have 512 MB on board [1], Raspberry Pi 2 Model B boards have 1GB on board.)

Potential solutions to this problem have been suggested, including using QEMU on a more powerful system and thus compiling your application there and copying the resulting binary across to your Raspberry Pi

[edit] 6 Books

[edit] 7 See also