Created
February 1, 2017 16:46
-
-
Save jamesthompson/7730209b2b154bd0a182e6fe945a2838 to your computer and use it in GitHub Desktop.
A script to install stack on Raspbian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set +ex | |
# A script to install stack on Raspbian | |
# Use stack installer script to install stack | |
curl -sSL https://get.haskellstack.org/ | 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/ghc-arm-wrapper.sh <<EOF | |
#!/bin/sh | |
ghc-8.0.1 -opta-march=armv7-a $@ | |
EOF | |
# 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/ghc-arm-wrapper.sh ~/.stack/programs/arm-linux/ghc-8.0.1/bin/ghc |
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:
https://gitlab.haskell.org/ghc/homepage/-/commit/5076cb3b1672a99b07d891649114c434ff070475
To get the binary:
wget https://home.smart-cactus.org/~ben/ghc/cabal-install-3.4.0.0-rc4-armv7l-deb10.tar.xz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 wget http://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-aarch64-deb9-linux.tar.xz tar -xf ghc-8.10.1-aarch64-deb9-linux.tar.gz cd ghc-8.10.1 ./configure sudo make install
libnurcses5
was discovered as a need during themake install
command andlibnuma-dev
when trying to compile the Hello World application.Now I just have
ghc
andghci
nocabal
orstack
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.