[Haskell-cafe] Compilers

Austin Seipp mad.one at gmail.com
Sat Nov 29 18:17:57 EST 2008


Hi Daniel,

> 1. cabal install lhc
> 20 minutes later I have an lhc executable installed (and the graphviz 
> package), great, can't be any simpler.

Awesome! Glad it worked for you.

A tidbit: unfortunately, due to a mistake in the first upload of lhc,
you will need to provide an exact version if you want the latest and
greatest.

The reason behind this is because when David uploaded lhc initially,
he gave it a version of '20081121'. After a few days of hacking the
source code, I decided to upload a new version - but I changed the
version number to 0.6.20081127 (it is 0.6 because jhc is currently at
0.5, and I see the improvements we made as worthy of a minor version
bump.)

So, as far as cabal is concerned, 20081121 > 0.6.20081127, so it will
by default install the older version.

If you would be so kind as to try the latest lhc instead by running:

$ cabal install lhc-0.6.20081127

And reporting back, I would like to hear the results and if it went
well. :)

> Unfortunately:
> $ lhc -o lhcHeap heapMain
> lhc: user error (LibraryMap: Library base not found!)
> 
> Oops.

There is a reason this is happening, and there isn't an easy way to
get around it right now, it seems.

The problem is that when you just install lhc, it has no libraries. To
install the base library, you are going to need a copy of the lhc
source code - this cannot be automated by hackage.

Why? Because we are afraid that by uploading lhc's version of base -
simply called 'base' - to hackage, will will inadvertantly stop every
continually uploaded package from building, and cabal install could
stop working too. Scary thought, huh? :)

The easiest way to fix this problem is by doing the following:

1. You probably want the darcs version of LHC anyway if you're willing
   to try it. Good improvements are being made pretty much every day.
2. After you get the darcs repository, just go into it and do 'cabal
   install'
3. To install base, you are probably going to want the latest versions
   of both cabal and cabal-install from the darcs repository - they
   include support for LHC already (cabal 1.7.x.)
4. After you've installed lhc and the latest cabal/cabal install, you
   can just do:
   $ cd lhc/lib/base
   $ cabal install --lhc

   And it should Just Work.

All of these instructions can be found here: 

http://lhc.seize.it/#development

Don Stewart just brought up this point in #haskell, so I think I will
modify the wiki page a bit (http://lhc.seize.it) and highlight these
notes and why it's currently like this.

I apologize for it being so cumbersome right now. We're trying to
figure out a good solution.

> Okay, ./configure --help and searching through the configure script (which I 
> completely don't know the syntax of) lead me to try 
> ./configure --prefix=$HOME DRIFTGHC=/home/dafis/.cabal/bin/DrIFT
> which successsfully completes the configure step, but shouldn't configure find 
> executables in the path?

The reason is because the configure.ac script is designed to search
for an executable named 'drift-ghc', not 'DrIFT'. I have no idea why.

> import System (getArgs). Now
> ... myriads of lines of output ...
> jhc: user error (Grin.FromE - Unknown primitive: ("eqRef__",[EVar (6666::ELit 
> (Data.IORef.Ref__ (ELit (Jhc at .Box.*::ESort *))::ESort #)),EVar (6670::ELit 
> (Data.IORef.Ref__ (ELit (Jhc at .Box.*::ESort *))::ESort #))]))
> 
> What? 
> And I get the same error for every nontrivial programme I tried to compile, 
> but not for a couple of trivial programmes.

LHC and JHC are still extremely incomplete. They're nowhere near as
supportive of extensions or libraries as GHC is. Don't count on them
compiling anything non-trivial just yet.

Austin


More information about the Haskell-Cafe mailing list