Skip to content

Instantly share code, notes, and snippets.

@mkoerner
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkoerner/189d446554a89196216a to your computer and use it in GitHub Desktop.
Save mkoerner/189d446554a89196216a to your computer and use it in GitHub Desktop.
Installation of Haskell + Repa + Accelerate on AWS g2.2xlarge instance
###
#
# Installation of Haskell + Repa + Accelerate-CUDA on AWS g2.2xlarge instance.
#
# Template was https://gist.github.com/stephenjbarr/9237286
#
# All commands entered in command shell after starting the image
# (e.g. amzn-ami-gpu-hvm-2014.03.2.x86_64-ebs) and logging into the machine
# with ssh -i private-key.pem ec2-user@ec2-nn-nn-nn-nn.compute-n.amazonaws.com
#
# Install required packages
sudo yum update -y
sudo yum install -y gmp-devel
sudo yum install -y gmp-static
sudo yum install -y zlib
sudo yum install -y zlib-devel
sudo yum install -y opengl-devel
sudo yum install -y freeglut-devel
sudo yum install -y git
sudo yum install -y gcc-c++
sudo yum install -y gcc46
sudo yum install -y gcc46-c++
# Install ghc-7.6.3 from binary distribution
wget http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-linux.tar.bz2
tar jxf ghc-7.6.3-x86_64-unknown-linux.tar.bz2
cd ghc-7.6.3
./configure
sudo make install
cd ~
rm -rf ghc-7.6.3-x86_64-unknown-linux.tar.bz2 ghc-7.6.3
# Install Haskell platform from source distribution
wget http://www.haskell.org/platform/download/2013.2.0.0/haskell-platform-2013.2.0.0.tar.gz
tar zxf haskell-platform-2013.2.0.0.tar.gz
cd haskell-platform-2013.2.0.0
./configure
make -j 8
sudo make install
cd ~
rm -rf haskell-platform-2013.2.0.0.tar.gz haskell-platform-2013.2.0.0
# Update packages and then cabal-install
cabal update
# Edit config for global installs
cp .cabal/config .cabal/config.bak
sed 's/^-- root-cmd:.*$/root-cmd: sudo/g' .cabal/config.bak > .cabal/config.tmp
sed 's/^-- documentation:.*$/documentation: True/g' .cabal/config.tmp > .cabal/config
rm -f .cabal/config.tmp
# Update and install
cabal install --global cabal-install
# Install LLVM
git clone http://llvm.org/git/llvm.git
cd llvm/
./configure --enable-optimized
gmake -j 8
sudo gmake install
cd ~
rm -rf llvm/
# Install c2hs, criterion, repa, and accelerate
cabal install --global c2hs
cabal install --global repa
cabal install --global repa-io
cabal install --global repa-algorithms
cabal install --global repa-examples
cabal install --global accelerate
cabal install --global accelerate-cuda
cabal install --global criterion
# Choose gcc-4.6
sudo update-alternatives --config gcc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment