Building snapshot ghc-5.05.20030123 on macOSX

Seth Kurtzberg
Wed, 12 Feb 2003 12:32:48 -0700

This is usually caused by not separating out the template haskell code from 
the "normal" haskell code.  The compiler needs to see them in separate files.

On Wednesday 12 February 2003 12:06 pm, Arthur Baars wrote:
> I want to play a bit with Template Haskell, so I downloaded a cvs
> snapshot (ghc-5.05.20030123.tar.gz) and tried to compile
> it on my mac (OSX 10.2).  I figured out that I needed a stage2 or
> stage3 compiler to get TH working, so I tried 'make stage3' .
> GHC started to compile itself three times. At lot of hours later it
> finished.
> Unfortunately, when I tried run the thing on a Prinf example, I got the
> following message.
> compiler/stage3-> ./ghc-inplace -c Printf.hs -fglasgow-exts -package
> haskell-src
> Template Haskell  bracket illegal in a stage-1 compiler
>    [| \s -> s |]
> The thing in"compiler/stage3"  was just a stage-1 compiler, so ghc had
> achieved nothing useful after re-compiling three times :-(
> The problem is that GHCi support is not turned on for MacOSX. I guess
> GHCi is used to do compile-time evaluation of code for TH.
> In file "mk/" it says:
> # Include GHCi in the compiler.  Default to NO for the time being.
> ifneq "$(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2
> freebsd netbsd openbsd)" ""
> GhcWithInterpreter=YES
> else
> GhcWithInterpreter=NO
> endif
> In the list of supported systems MacOSX is missing. After adding
> "darwin" to this list, and waiting for hours, I got a working
> TH-compiler.
> Can someone add OSX("darwin") to the "mk/" file? It would
> also be nice to get a warning
> if one tries to compile a stage-(N>1) compiler without GHCi support.
> Cheers,
> Arthur
> _______________________________________________
> Glasgow-haskell-users mailing list

Seth Kurtzberg
M. I. S. Corp.