Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iori-yja/1578981 to your computer and use it in GitHub Desktop.
Save iori-yja/1578981 to your computer and use it in GitHub Desktop.
Easy install way of ghc7.2 and cabal on linux.

Installing GHC 7.2 on Linux

This is a brief and bare-bones guide to getting GHC 7.2 and the cabal-install tool (the two basic things you'll need to do Haskell development) up and running on a new Linux install.

The instructions given here worked for me, but YMMV. My environment is Debian GNU/Linux, sid(unstable).

Installing GHC

First, download tar-ball of ghc.

 curl -O http://www.haskell.org/ghc/dist/7.2.1/ghc-7.2.1-x86_64-unknown-linux.tar.bz2

If you are using debian sid, you will encounter the error like there is no gmp library, while you have that. Let's work around then.

 sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so /usr/lib/x86_64-linux-gnu/libgmp.so.3
 ./configure
 make intall

If you don't have gcc or so, get build-esseintial.

Installing Cabal

Thanks to mans, we have very useful package on hackage. http://hackage.haskell.org/package/cabal-install-ghc72-0.10.3

So what we must do is simple: Download, unzip, and some work around, done. Some of you want to build anything on build directory.

 cd build

Download the package. If its URI was invalid, use the link on the bottom of the page I showed above.

 curl -O http://hackage.haskell.org/packages/archive/cabal-install-ghc72/0.10.3/cabal-install-ghc72-0.10.3.tar.gz
 tar xf cabal-install-ghc72-0.10.3.tar.gz
 cd cabal-install-ghc72-0.10.3

Choose cabal file you want, and rename the other to different name.

 mv ._cabal-install-ghc72.cabal ._cabal-install-ghc72.caba

Then fire the boot strap. If you want global cabal, edit bootstrap.sh like as below.

 -SCOPE_OF_INSTALLATION="--user"
 +SCOPE_OF_INSTALLATION="--global"

Then boot the bootstrap. If you changed scope as --global, do it with root privilege.

 sh bootstrap.sh

If your linux is installed right now, you may not have something to do that. If your distribution is Debian, Ubuntu, Vine, or something with apt tool, Perhaps apt-get install build-essential is helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment