Skip to content

Instantly share code, notes, and snippets.

@wting wting/haskell.md
Last active Jan 1, 2017

Embed
What would you like to do?
Installing ghc, haskell-platform, cabal-install on Ubuntu 12.04.

Choices

  1. Install ghc 7.6.3 and Haskell Platform
  2. Install ghc 7.8.4 and Cabal

Option GHC 7.6.3 + Haskell Platform

GHC 7.6.3

Install Ubuntu 12.04 depencies:

$ sudo aptitude install -y libgmp3c2

Symlink the library:

$ sudo ln -s /usr/lib/libgmp.so.3 /usr/lib/libgmp

Afterwards, download, configure, and install GHC.

$ wget https://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-linux.tar.bz2
$ tar xvf ghc-7.6.3-x86_64-unknown-linux.tar.bz2
$ cd ghc-7.6.3
$ ./configure --prefix=/opt/ghc
$ make install      # sudo might be necessary

Add /opt/ghc/bin to $PATH.

Haskell Platform 2013.2.0.0

Install Ubuntu 12.04 depencies:

$ sudo aptitude install -y libgmp3-dev libglc-dev freeglut3 freeglut3-dev

Haskell Platform Ubuntu dependencies:

$ wget http://lambda.haskell.org/platform/download/2013.2.0.0/haskell-platform-2013.2.0.0.tar.gz
$ tar xvf haskell-platform-2013.2.0.0.tar.gz
$ cd haskell-platform-2013.2.0.0
$ ./configure --prefix=/opt/haskell-platform --enable-unsupported-ghc-version
$ make -j4
$ make install      # sudo might be necessary

Add /opt/haskell-platform/bin to $PATH.

Cabal

Cabal is included as part of Haskell Platform. Go ahead and update it:

$ cabal update && cabal install cabal-install

Some useful packages:

$ cabal install ghc-mod hoogle hlint pointfree

Option GHC 7.8.4 + Cabal

GHC 7.8.4

You cannot currently build Haskell-Platform with 7.8.4, so ignore these build instructions.

Install Ubuntu 12.04 depencies:

$ sudo aptitude install -y libgmp3-dev

Afterwards, download, configure, and install GHC. This is for the x86_64 version. For the 32 bit version please download the appropriate source from here.

$ wget https://www.haskell.org/ghc/dist/7.8.4/ghc-7.8.4-x86_64-unknown-linux-deb7.tar.xz
$ tar xvf ghc-7.8.4-x86_64-unknown-linux-deb7.tar.xz
$ cd ghc-7.8.4
$ ./configure --prefix=/opt/ghc
$ make install      # sudo might be necessary

Add /opt/ghc/bin to $PATH.

Cabal

If you are running Ubuntu 12.04 AMD64 you can bootstrap cabal from this binary image.

Otherwise build it from source:

$ wget http://www.haskell.org/cabal/release/cabal-1.18.1.3/Cabal-1.18.1.3.tar.gz
$ tar xvf Cabal-1.18.1.3.tar.gz
$ cd cabal-1.18.1.3
$ ./bootstrap.sh --user

Update cabal:

$ cabal update && cabal install cabal-install

Some useful packages:

$ cabal install ghc-mod hoogle hlint pointfree
@LemmingAvalanche

This comment has been minimized.

Copy link

LemmingAvalanche commented Mar 1, 2014

Shouldn't $PATH be set to

/opt/haskell-platform-2013.2.0.0/bin

instead of

/opt/haskell-platform-2013.2.0.0/

@wting

This comment has been minimized.

Copy link
Owner Author

wting commented Apr 12, 2014

Yup, thanks for catching that.

@ThomWright

This comment has been minimized.

Copy link

ThomWright commented Jul 26, 2014

I needed to run $ sudo aptitude install -y libgmp3-dev to ./configure Haskell Platform 2013.2.0.0. Just a quick FYI :)

@wting

This comment has been minimized.

Copy link
Owner Author

wting commented Jan 18, 2015

Sorry for the long response time, updated!

@LemmingAvalanche

This comment has been minimized.

Copy link

LemmingAvalanche commented Mar 15, 2015

./bootstrap.sh --user is wrong in my case; there is no such file in the Cabal-1.18.1.3 directory (or the newer Cabal-1.22.0.0, for that matter). But there is one in directory you get if you download cabal-install-*. Is that the one you mean?

@MLabusquiere

This comment has been minimized.

Copy link

MLabusquiere commented Oct 31, 2015

From the README of downloaded Cabal :

Installing as a user (no root or administrator access)

ghc --make Setup 
./Setup configure --user
./Setup build
./Setup install
@vijeth-aradhya

This comment has been minimized.

Copy link

vijeth-aradhya commented Dec 31, 2016

This is after following GHC 7.8.4 + Cabal setup procedure
For cabal update && cabal install cabal-install, I get this error :/

Configuring cabal-install-1.24.0.2...
Failed to install cabal-install-1.24.0.2
cabal: Error: some packages failed to install:
cabal-install-1.24.0.2 failed during the configure step. The exception was:
ExitFailure 11
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.