Building GHC / Happy

Simon Peyton-Jones simonpj@microsoft.com
Wed, 26 Jun 2002 10:15:52 +0100


Building GHC requires GHC too, not just Happy.
The best thing to do is usually to download and install
both GHC and Happpy, which is what the building guide
recommends
http://haskell.cs.yale.edu/ghc/docs/latest/building/sec-pre-supposed.htm
l

You can get away with downloading just GHC, building
Happy, and then building GHC.

Simon

| -----Original Message-----
| From: Mike Hogsett [mailto:hogsett@csl.sri.com]=20
| Sent: 25 June 2002 23:45
| To: glasgow-haskell-users@haskell.org
| Subject: Building GHC / Happy
|=20
|=20
|=20
| It appears that building GHC requires Happy.  It appears that=20
| building Happy requires GHC.  How does one bootstrap this thing ?
|=20
|=20
| Versions :
|=20
| ghc-5.02.3
|=20
| happy-1.13
|=20
| [hogsett@linuxfs1 ghc-5.02.3]$ ./configure --prefix=3D/csl=20
| creating cache ./config.cache ... ... ... checking for=20
| happy... no checking for version of happy... grep:=20
| ./happy/mk/version.mk: No such file or directory
|=20
| configure: error: Happy version 1.9 or later is required to=20
| compile GHC.
|=20
| hmm... Ok.
|=20
| [hogsett@linuxfs1 ghc-5.02.3]$ ln -s ../happy-1.13 happy=20
| [hogsett@linuxfs1 ghc-5.02.3]$ rm config.cache=20
| [hogsett@linuxfs1 ghc-5.02.3]$ ./configure --prefix=3D/csl=20
| creating cache ./config.cache ... ... ... checking for=20
| happy... /home/hogsett/ghc/ghc-5.02.3/happy/src/happy-inplace
| checking for version of happy... grep: ./happy/mk/version.mk:=20
| No such file or directory
|=20
| configure: error: Happy version 1.9 or later is required to=20
| compile GHC.
|=20
| hmm... Ok.
|=20
| [hogsett@linuxfs1 ghc-5.02.3]$ cd ../happy-1.13/=20
| [hogsett@linuxfs1 happy-1.13]$ ./configure --prefix=3D/csl=20
| creating cache ./config.cache ... ... ... checking for=20
| __gmpz_fdiv_qr in -lgmp3... no
|=20
| hmm... that finished... let's try to build this beast=20
| [hogsett@linuxfs1 happy-1.13]$ make make -C glafp-utils -r=20
| ... ... ... ...
| --------------------------------------------------------------
| ----------
| =3D=3Dfptools=3D=3D make boot -wr;
|  in /home/hogsett/ghc/happy-1.13/happy/src
| --------------------------------------------------------------
| ----------
| if [ -d ../../ghc ]; then \
|         (cd ../../ghc/utils/unlit && make boot); \
|         (cd ../../ghc/includes && make boot); \
|         (cd ../../ghc/driver && make boot); \
| fi=20
| M -optdep-f -optdep.depend  -osuf o    -ldl -cpp=20
| -fglasgow-exts -package lang -O -O AbsSyn.lhs First.lhs=20
| GenUtils.lhs GetOpt.lhs Grammar.lhs Info.lhs LALR.lhs=20
| Lexer.lhs Main.lhs ParseMonad.lhs Parser.hs ProduceCode.lhs=20
| Set.lhs Target.lhs Version.hs
| make[2]: M: Command not found
| make[2]: [depend] Error 127 (ignored)
| --------------------------------------------------------------
| ----------
| =3D=3Dfptools=3D=3D make boot -wr;
|  in /home/hogsett/ghc/happy-1.13/happy/templates
| --------------------------------------------------------------
| ----------
| M -optdep-f -optdep.depend  -osuf o    -ldl GenericTemplate.hs
| make[2]: M: Command not found
| make[2]: [depend] Error 127 (ignored)
| --------------------------------------------------------------
| ----------
| make INSTALLING=3D0 BIN_DIST=3D0 --no-print-directory -r all
| ldl -cpp -fglasgow-exts -package lang -O -O    -c AbsSyn.lhs=20
| -o AbsSyn.o
| make[3]: ldl: Command not found
| make[3]: [AbsSyn.o] Error 127 (ignored)
|=20
|=20
| ( followed by lots of make[3]: ldl: Command not found )
|=20
| but it seems to have finished
|=20
| Back to ghc
|=20
| [hogsett@linuxfs1 ghc-5.02.3]$ ./configure=20
| loading cache ./config.cache
| checking for happy...=20
| /home/hogsett/ghc/ghc-5.02.3/happy/src/happy-inplace
| checking for version of happy... grep: ./happy/mk/version.mk:=20
| No such file or directory
|=20
| configure: error: Happy version 1.9 or later is required to=20
| compile GHC.
|=20
| Hmm...
|=20
| [hogsett@linuxfs1 ghc-5.02.3]$ cd ./happy/mk/
| [hogsett@linuxfs1 mk]$ ls -l version.mk
| ls: version.mk: No such file or directory
| [hogsett@linuxfs1 mk]$
|=20
| hmm...
|=20
| [hogsett@linuxfs1 mk]$ echo "ProjectVersion=3D1.13" >=20
| version.mk [hogsett@linuxfs1 mk]$ cd ../../ [hogsett@linuxfs1=20
| ghc-5.02.3]$ !./configure
|=20
| ok that finished
|=20
|=20
| [hogsett@linuxfs1 ghc-5.02.3]$ make
| ...
| ...
| ...
| --------------------------------------------------------------
| ----------
| =3D=3Dfptools=3D=3D make boot -wr;
|  in /home/hogsett/ghc/ghc-5.02.3/ghc/compiler
| --------------------------------------------------------------
| ----------
| /bin/sh: test: -ge: unary operator expected
| /bin/sh: test: -lt: unary operator expected
| Creating main/Config.hs ... done.
| rm -f prelude/primops.txt
| gcc -E -I../includes -traditional    -x c=20
| prelude/primops.txt.pp | /bin/sed -e '/^#/d' > prelude/primops.txt
| ../utils/genprimopcode/genprimopcode --data-decl          <=20
| prelude/primops.txt > primop-data-decl.hs-incl
| /bin/sh: ../utils/genprimopcode/genprimopcode: No such file=20
| or directory
| make[2]: *** [primop-data-decl.hs-incl] Error 126
| make[1]: *** [boot] Error 1
| make[1]: Leaving directory `/home/hogsett/ghc/ghc-5.02.3/ghc'
| make: *** [all] Error 1
|=20
|=20
| Darn!  How do I build this !
|=20
|  - Mike Hogsett
| _______________________________________________
| Glasgow-haskell-users mailing list=20
| Glasgow-haskell-users@haskell.org=20
| http://www.haskell.org/mailman/listinfo/glasgow-| haskell-users
|=20