Skip to content

Instantly share code, notes, and snippets.

Created February 1, 2017 16:46
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A script to install stack on Raspbian
set +ex
# A script to install stack on Raspbian
# Use stack installer script to install stack
curl -sSL | sh
# Use apt-get to install llvm
sudo apt-get install llvm-3.7
# Write a wrapper for ghc to be called with, parameterizing GHC with ARM settings
cat > ~/.stack/programs/arm-linux/ghc-8.0.1/bin/ <<EOF
ghc-8.0.1 -opta-march=armv7-a $@
# Setup symlinks for stack / ghc
ln -s /usr/bin/opt-3.7 /usr/bin/opt
ln -s /usr/bin/llc-3.7 /usr/bin/llc
rm ~/.stack/programs/arm-linux/ghc-8.0.1/bin/ghc
ln ~/.stack/programs/arm-linux/ghc-8.0.1/bin/ ~/.stack/programs/arm-linux/ghc-8.0.1/bin/ghc
Copy link


Yea, I already tried that, as well as the upgrade. I still need something newer. That's what's giving me fits

Yer not doing anything wrong (I think), we just need a better installer or upgrader. 8.6.5 is the best I can do so far, and I need at least 8.10. It kinda looks like it's possible with that command, but, something is missing. "Bindist OS key has not yet been added for linux armv7"

And google is not being very helpful

I know it's been done, I just can't figure out how

Copy link

This,, worked quick and easy for me on a RPi 4 w 8gb RAM and Raspbian

Copy link

Thanks @analyticd I took a look. That specifically didn't work, but I made some changes that did work.

I'm running 64-bit Debian - arm64. I had to update the download package and install a few additional packages.

sudo apt install llvm-9 libncurses5 libnuma-dev 

tar -xf ghc-8.10.1-aarch64-deb9-linux.tar.gz
cd ghc-8.10.1
sudo make install

libnurcses5 was discovered as a need during the make install command and libnuma-dev when trying to compile the Hello World application.

Now I just have ghc and ghci no cabal or stack by my very limited work in Haskell doesn't really need those. Maybe one day I'll do something complex enough in Haskell to need additional tooling.

Copy link

I emailed the maintainer of GHC's ARM build (and that wiki page above) and he was kind enough to provide an updated URL for a pre-built cabal-install whose URL is referenced from here:

To get the binary:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment