Wednesday, March 30, 2016

Standing up Haskell (GHC) on an AWS EC-2

Steps for standing up dev tools, and Haskell, on AWS EC-2

So, you’ve configured your EC-2 with the standard AWS-Linux image, and now you want to compile your sources and have running executables to demo, including in not only Java and Perl but possibly C, C++ and, for my prototypes and graph-systems, Haskell. How to do this?

Unfortunately, the AMI for Haskell is rather unforthcoming, as it seems to compile the GHC from sources, an endeavor that takes hours of AWS-time. Unnecessary. So, I’ve cut out those middle steps and have a Haskell-image on my S3 that can be downloaded and used once the dev-tools are in place.

Let’s do this.

1. Get the ghc image from my public-S3-bucket:
$ wget

2. install the dev-tools from Amazon (this takes a bit)

$ sudo yum groupinstall “Development Tools”

3. Now you need to provide a soft link to

$ cd /usr/lib64
$ sudo ln -s
$ sudo ln -s
$ cd

Yes, you need both of those soft links.

4. Once you have all that done, unzip ghc:

$ sudo tar xzf haskell-platform-7.10.2-a-unknown-linux-deb7.tar.gz

5. And now ghci will work for you:

$ ghci
Prelude> 3 + 4
~> 7

YAY! Do a happy dance!

No comments:

Post a Comment