How to install Haskell Platform for Ubuntu 13.04? I get the following error when I type sudo apt-get install haskell-platform
:
E: Unable to locate package haskell-platform error
Raring is caught in a valley between having a GHC too new for Haskell Platform 2012.4.0.0 and too old for 2013.2.0.0. This valley can be bridged with some pain and duct tape.
You can install the Haskell Platform 2013.2.0.0 from source if you have GHC already installed. It's a bit of a process, but it does work.
First, install GHC 7.6.2:
sudo apt-get install ghc
Now you need GHC 7.6.3 as it is a pre-req for Haskell Platform 2013.2.0.0.
CAUTION:
You might think installing from the unknown-linux archives of GHC will work. It won't. The GHC in those archives is dynamically linked against /usr/lib/libgmp.so.3 which is unavailable on Raring which has libgmp.so.10. Do NOT be tempted to symlink this library to it's earlier version's name and location to fake out the linker. I went there and it is a path to very confusing failures and is a very bad practice so I mended my ways and built GHC from source.
Next, you need to get and build GHC 7.6.3 from source (GHC is a self-hosted compiler so it needs GHC to build it):
wget http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-src.tar.bz2
tar xjvf ghc-7.6.3-src.tar.bz2
cd ghc-7.6.3
./configure
make
sudo make install
Compiling GHC took quite a while (several hours, > halflife of Cesium isotope Cs-134m) for me so this is likely a very good time for a break or sleep. It goes through three stages (0, 1, and 2) of building the compiler and then building the compiler's next stage with the compiler that was built.
To speed the compile process up, you can use
make -j 8
in the above step to leverage multi-core CPU.
Then, get and build the Haskell Platform from source (I'll use 2013.2.0.0 as an example):
wget http://lambda.haskell.org/platform/download/2013.2.0.0/haskell-platform-2013.2.0.0.tar.gz
tar xzvf haskell-platform-2013.2.0.0.tar.gz
cd haskell-platform-2013.2.0.0
./configure
make
sudo make install
Compiling the Haskell Platform took quite >30 minutes for me so this is another good time for a break.
You should now have a working Haskell Platform 2013.2.0.0 with GHC 7.6.3 correctly linked against libgmp.so.10.
libncurses5-dev
package for the install to work. =)
sudo apt-get install libgl1-mesa-dev libglc-dev freeglut3-dev libedit-dev libglw1-mesa libglw1-mesa-dev
Aug 16, 2013 at 14:12
ghc-7.6.3
on my five-years-old desktop took about 2.5 hours, and on modern i7 desktop — about 20 minutes. Haskell platform is building almost instantaneously. All results are with make -j8
.
Jan 23, 2014 at 6:11
Ubuntu 13.04 repo contains GHC 7.6.2, unfortunately there's no Haskell Platform for GHC 7.6.x yet. So you'd better to build an eariler version of GHC (i.e., 7.4.x) and Haskell Platform from source for now.
See this for more information: https://launchpad.net/ubuntu/raring/i386/haskell-platform
As the excellent answer from Alain O'Dea above details, this problem is not easily fixed, and in the meantime there is no haskell-platform available for Ubuntu 13.04.
You can sort of 'fake' it by installing the packages on this list: http://packages.ubuntu.com/precise/haskell-platform
Here is a command to do this for you:
sudo apt-get install ghc alex cabal-install happy libghc-cgi-dev libghc-fgl-dev libghc-glut-dev libghc-haskell-src-dev libghc-html-dev libghc-http-dev libghc-hunit-dev libghc-mtl-dev libghc-network-dev libghc-opengl-dev libghc-parallel-dev libghc-parsec3-dev libghc-quickcheck2-dev libghc-regex-base-dev libghc-regex-compat-dev libghc-regex-posix-dev libghc-stm-dev libghc-syb-dev libghc-text-dev libghc-transformers-dev libghc-xhtml-dev libghc-zlib-dev
The two items missing from this are the haskell-platform-doc and haskell-platform-prof packages, for obvious reasons.
Hopefully, the Ubuntu devs fix the incompatibility issue soon.
On that note:
In addition: I unfortunately don't have the reputation to leave this as a comment on this StackExchange site, but that is the most appropriate place.
There is a bug on Launchpad for all of this, but it isn't getting much attention. Please visit this and mark it as affecting you if you landed on this page because Ubuntu 13.04's Haskell packages are hosed:
https://bugs.launchpad.net/ubuntu/+source/haskell-platform/+bug/1047678
Hopefully a mod will take this answer and make it into a comment, where it belongs. Sorry - I just don't have the reputation on askubuntu yet!
I've used this script.
#!/bin/bash
# Install needed developer libraries
sudo apt-get install libgmp-dev zlib1g-dev libgl1-mesa-dev libglc-dev freeglut3-dev libedit-dev libglw1-mesa-dev libglw1-mesa
# Remove old tmp folder
sudo rm -r tmp
mkdir tmp
# Create symlink if necessary
libgmp=/usr/lib/libgmp.so.3
if [ ! \( -e "$libgmp" \) ]
then
sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10.0.5 $libgmp
fi
# Download the ghc
output_ghc_archive="tmp/ghc-7.6.3.tar.bz2"
output_ghc="tmp/ghc-7.6.3"
url=http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-linux.tar.bz2
wget $url -O $output_ghc_archive
# Unpack and remove archive
tar -xjvf $output_ghc_archive -C "tmp/"
rm $output_ghc_archive
# Configure and install
cd $output_ghc
./configure
sudo make install
# Remove ghc installation files
cd ../..
sudo rm -r $output_ghc
# Download the haskell platform
output_hp_archive="tmp/haskell-platform-2013.2.0.0.tar.gz"
output_hp="tmp/haskell-platform-2013.2.0.0"
url2=http://lambda.haskell.org/platform/download/2013.2.0.0/haskell-platform-2013.2.0.0.tar.gz
wget $url2 -O $output_hp_archive
# Unpack and remove archive
tar -xzf $output_hp_archive -C "tmp/"
rm $output_hp_archive
# Configure and install
cd $output_hp
./configure
make
sudo make install
# Remove haskell platform installation files
cd ../..
sudo rm -r $output_hp
# Remove this tmp folder
sudo rm -r tmp
Hope it helps.
sudo apt-get install ghc
GHC stands for Glasgow Haskell Compiler
apt-get install ghc
, which depends on GHC 4.8.1, while the one installed and used by lots of Ubuntu libraries is 4.8.2. It's damn perfect time to migrate to NixOS.