Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

How to install latest GHC 7.8.4 + cabal 1.22 on intel edison w/ ubi linux


ubilinux prerequisites

# for untar later
apt-get install bzip2
# probably all needed
apt-get install freeglut3 freeglut3-dev -y

ghc installation

# get distr  
mkdir /home/edison/downloads
cd /home/edison/downloads  
tar xvfj ghc-7.8.4-x86_64-unknown-linux-deb7.tar.bz2    
cd ghc-7.8.4

# install to  
mkdir -p /home/edison/dev/bin/ghc-7.8.4  
# or choose another path

./configure --prefix=/home/edison/dev/bin/ghc-7.8.4

make install

# symbol links  
cd $HOME/Development/bin  
ln -s `pwd`/ghc-7.8.4 ghc

# add $HOME/Development/bin/ghc to $PATH 
# add this line to ~/.profile
export GHC_HOME=$HOME/Development/bin/ghc  
export PATH=$GHC_HOME/bin:${PATH}

# to use updated path without log off
source ~/.profile

# remove temporary files  
cd $HOME/Downloads  
rm -rf ghc-7.8.4*

cabal (package manager for haskell)

# remove old  
rm -rf $HOME/.cabal

cabal library

# clone dist  
cd $HOME/Downloads  
curl -O

# extract   
tar xzvf Cabal-  
cd Cabal-  

# build
ghc --make Setup.hs
./Setup configure --user
./Setup build
./Setup install

# Remove temporary files
cd $HOME/Downloads
rm -rf Cabal-*


# remove ghc cache (in case of reinstall)  
if [ -d "$HOME/.ghc/" ]; then  
  ghc-pkg --user recache  

# get distributive  
cd $HOME/Downloads  
curl -O

# extract archive  
tar xzvf cabal-install-  
cd cabal-install-  

# install  

# remove temporary files  
cd $HOME/Downloads  
rm -rf cabal-install-*  

# add path to cabal to PATH environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.