With the correct llvm, ghc 7.10.2 works on the raspberry pi 2

I filed a bug re my problems with running ghc 7.10.2 on the pi2, and we got it solved eventually.  It turns out that debian jessie comes with llvm 3.5-10, but llvm 3.5.2-2 is the version (or one valid version?) that is required.  Now it seems to be working nicely!  There is still a bug in ghci, but you can at least run it without an immediate exception.

I installed ghc using the 7.10.2-2 debian experimental package, currently available here.  Check the bug for notes on installing the correct llvm.  I switched to ‘testing’ and that had the correct libstdc++ among other libs required by llvm 3.5.2-2.

I went ahead and built cabal-install version and then used that to install stack  Those required quite a bit of compile time (10+ hours for stack) so I’m making the binaries available here to save time for someone.

If you decide to build stack yourself, you’ll need more than 1g of memory.  My raspberry pi 2 only has 1g so I used a 500m swap file, which I think was barely enough.  With cabal I was able to build a yesod project without needing to tweak persistent-sqlite as with ghc 7.8.2.  Good stuff!

As for stack, I was able to build my yesod project with it, in 3 runs.  The first compile died when the SD card ran out of space, the second completed but failed the link step (I think) with exit code -9, and then the third was able to link successfully.  Total compile time:

run1: 232m43.771s
run2: 591m46.461s
run3: 6m16.723s

total: 830.75 mins, or 13.8 hours.  epic compile!  I used stack lts-3.5.


One thought on “With the correct llvm, ghc 7.10.2 works on the raspberry pi 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s