Skip to content

Instantly share code, notes, and snippets.

@ExternalReality
Last active August 29, 2015 14:27
Show Gist options
  • Save ExternalReality/b34184e5b3b67833460a to your computer and use it in GitHub Desktop.
Save ExternalReality/b34184e5b3b67833460a to your computer and use it in GitHub Desktop.
Using Multiple Versions of GHC

GHC Version Management using GNU Stow

Stack is great tool for managing versions of GHC. Although many of Plowtech's packages work with Stackage contraints, there are still some that don't and there are some yet that build with Stackage but have difficulties with the Stack tool.

Stow is a good tool that allows manual control over managing versions of GHC. GNU Stow is available from both Mac Ports and many popular Linux distrubitions package management repositories.

Lets install two versions of GHC 7.8.4 and 7.10.2

  1. Install Stow.
  2. Make the directory /usr/local/stow/
  3. Make the directories /usr/local/stow/ghc-7.8.4 and /usr/local/stow/ghc-7.10.2
  4. Download the GHC version 7.8.4 and 7.10.2 for your distribution.
  5. Unpack GHC 7.84 and cd into its directory
  6. ./configure --prefix=/usr/local/stow/ghc-7.8.4
  7. sudo make install clean
  8. Do the same for ghc-7.10.2
  9. Remove any existing versions of GHC you have installed

To use GHC 7.8.4 do the following:

cd /usr/local/stow sudo Stow -D ghc-<version-you-are-using-right-now> sudo Stow ghc-7.8.4

Do the same for any version you wish to use. Write a script to manage this. I Will post the script I use soon.

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