Building GHC / Happy
Mike Hogsett
hogsett@csl.sri.com
Tue, 25 Jun 2002 15:44:45 -0700
It appears that building GHC requires Happy. It appears that building Happy
requires GHC. How does one bootstrap this thing ?
Versions :
ghc-5.02.3
happy-1.13
[hogsett@linuxfs1 ghc-5.02.3]$ ./configure --prefix=/csl
creating cache ./config.cache
...
...
...
checking for happy... no
checking for version of happy... grep: ./happy/mk/version.mk: No such file or directory
configure: error: Happy version 1.9 or later is required to compile GHC.
hmm... Ok.
[hogsett@linuxfs1 ghc-5.02.3]$ ln -s ../happy-1.13 happy
[hogsett@linuxfs1 ghc-5.02.3]$ rm config.cache
[hogsett@linuxfs1 ghc-5.02.3]$ ./configure --prefix=/csl
creating cache ./config.cache
...
...
...
checking for happy... /home/hogsett/ghc/ghc-5.02.3/happy/src/happy-inplace
checking for version of happy... grep: ./happy/mk/version.mk: No such file or directory
configure: error: Happy version 1.9 or later is required to compile GHC.
hmm... Ok.
[hogsett@linuxfs1 ghc-5.02.3]$ cd ../happy-1.13/
[hogsett@linuxfs1 happy-1.13]$ ./configure --prefix=/csl
creating cache ./config.cache
...
...
...
checking for __gmpz_fdiv_qr in -lgmp3... no
hmm... that finished... let's try to build this beast
[hogsett@linuxfs1 happy-1.13]$ make
make -C glafp-utils -r
...
...
...
...
------------------------------------------------------------------------
==fptools== 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
M -optdep-f -optdep.depend -osuf o -ldl -cpp -fglasgow-exts -package lang -O -O AbsSyn.lhs First.lhs GenUtils.lhs GetOpt.lhs Grammar.lhs Info.lhs LALR.lhs Lexer.lhs Main.lhs ParseMonad.lhs Parser.hs ProduceCode.lhs Set.lhs Target.lhs Version.hs
make[2]: M: Command not found
make[2]: [depend] Error 127 (ignored)
------------------------------------------------------------------------
==fptools== 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=0 BIN_DIST=0 --no-print-directory -r all
ldl -cpp -fglasgow-exts -package lang -O -O -c AbsSyn.lhs -o AbsSyn.o
make[3]: ldl: Command not found
make[3]: [AbsSyn.o] Error 127 (ignored)
( followed by lots of make[3]: ldl: Command not found )
but it seems to have finished
Back to ghc
[hogsett@linuxfs1 ghc-5.02.3]$ ./configure
loading cache ./config.cache
checking for happy... /home/hogsett/ghc/ghc-5.02.3/happy/src/happy-inplace
checking for version of happy... grep: ./happy/mk/version.mk: No such file or directory
configure: error: Happy version 1.9 or later is required to compile GHC.
Hmm...
[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]$
hmm...
[hogsett@linuxfs1 mk]$ echo "ProjectVersion=1.13" > version.mk
[hogsett@linuxfs1 mk]$ cd ../../
[hogsett@linuxfs1 ghc-5.02.3]$ !./configure
ok that finished
[hogsett@linuxfs1 ghc-5.02.3]$ make
...
...
...
------------------------------------------------------------------------
==fptools== 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 prelude/primops.txt.pp | /bin/sed -e '/^#/d' > prelude/primops.txt
../utils/genprimopcode/genprimopcode --data-decl < prelude/primops.txt > primop-data-decl.hs-incl
/bin/sh: ../utils/genprimopcode/genprimopcode: No such file 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
Darn! How do I build this !
- Mike Hogsett