2

I would like to install the latest release of the Haskell platform on Debian wheezy. By executing

 sudo apt-get install haskell-platform

I get ghc version 7.4.1 (released in 2012) whereas the current version is 7.8.3.

So I have downloaded the current ghc version source and built it: everything went fine and I can now execute ghc. I then downloaded the source distribution of the Haskell platform from here and in the README file I find the instructions

REQUIREMENTS FOR BUILDING

You need the platform build files, either from the source repo or the source tarball. Build instructions are the same for either.

You need a GHC bindist that matches the OS you are compiling on. It must also match the GHC version used by the platform, currently 7.8.3. You can get this from: http://www.haskell.org/ghc/download_ghc_7_8_3

I actually do not want to use this, I would like to use the ghc I have just built because, in the ghc documentation I read:

NOTE: If you have too old a version of libc, then you will get an error like "floating point exception" from the binaries in these bindists. You will need to either upgrade your libc (we're not sure what the minimum version required is), or use a binary package built for your distribution instead.

So, in order to be sure, I would prefer to use my build. But, the README that comes with haskell-platform-2014.2.0.0 does not say anything about such an option. The only option that it offers is to run:

./platform.sh $PATH_TO_GHC_BINDIST_TARBALL

So: is there a way to build the Haskell platform using a ghc binary that I have built locally?

Giorgio
  • 5,023
  • 6
  • 41
  • 71

1 Answers1

1

Check this Building and installing a system package

If you don't have a cabal binary (which cabal) you can build it from the platform packages.

  • option 1: get it from your distribution apt-get install cabal-install

  • option 2: build it from the platform packages, but you will need to build/install also the missing package dependencies, that must be present in the platform

cd to the platform base folder

cd packages/cabal-install-*

# compile Setup to run faster
ghc Setup.hs

./Setup configure --ghc
./Setup build
./Setup install

Then to install the rest

cd to the platform base folder

cabal configure --ghc 
cabal install

You may have to add sudo to install lines, depending on where you installed ghc

Gabriel Riba
  • 6,698
  • 2
  • 17
  • 19
  • So the key is to use `--ghc` to check if there is an installed `ghc` in the path. However, `./Setup configure --ghc` says some dependences are not fulfilled: `HTTP >=4000.0.8 && <4001`, `mtl >=2.0 && <3`, `network >=1 && <3`, `random >=1 && <1.1`, `stm >=2.0 && <3`, `zlib >=0.5.3 && <0.6`. – Giorgio Aug 23 '14 at 20:12
  • BTW, I have managed to build platform `2013.2.0.0` (this version still contains a `configure` script which seems to work OK). Can I use this build to boot `2014.2.0.0` or will packages from both releases get mixed up? – Giorgio Aug 23 '14 at 20:16
  • Packages compiled with different ghc releases never mix. If you have installed an earlier platform you must have a cabal instance. You can go ahead without the --ghc flag anyway. – Gabriel Riba Aug 23 '14 at 20:27
  • So I switch to the folder in which I have unpacked the 2014 release and do `cabal configure`, `cabal install` from there? – Giorgio Aug 23 '14 at 20:30
  • just `cabal install` suffices to do a user installation. Maybe you would better erase the user .ghc folder to make a clean one – Gabriel Riba Aug 23 '14 at 20:34
  • It has worked but it is still not clear to me how this whole process works, and why the `configure` script that was available until release 2013 has been removed. In any case, thanks a lot for the directions! – Giorgio Aug 23 '14 at 21:09
  • I also long the configure version. I think that the easiest way to go with platform-2014-.. is to get a cabal executable binary from your linux distribution `apt-get install cabal-install` and `cabal install` the platform. – Gabriel Riba Aug 24 '14 at 11:10
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/59878/discussion-between-giorgio-and-gabriel-riba). – Giorgio Aug 24 '14 at 11:20