Problems building Hat on Mac OS X

Hi! I'm trying to build hat on Mac OS X 10.1, and the compile bombs with the following error: ghc -package-name hat -package lang -fglasgow-exts -fno-warn-overlapping-patterns -fno-warn-missing-methods -cpp -c -o /usr/local/src/hat-2.00/targets/powerpc- Darwin-5.5/obj/hatlib/ghc/TPreludeBuiltinTypes.o TPreludeBuiltinTypes.hs TPreludeBuiltinTypes.hs:12: failed to load interface for `Hat': Could not find interface file for `Hat' make[1]: *** [/usr/local/src/hat-2.00/targets/powerpc- Darwin-5.5/obj/hatlib/ghc/TPreludeBuiltinTypes.o] Error 1 make: *** [targets/powerpc-Darwin-5.5/hat-lib-ghc] Error 2 I'm using ghc 5.04 and hmake 3.05, and I'd appreciate any assistance. Thanks! -- Stephen Pitts smpitts@midsouth.rr.com

Stephen Pitts
Hi! I'm trying to build hat on Mac OS X 10.1, and the compile bombs with the following error:
ghc -package-name hat -package lang -fglasgow-exts -fno-warn-overlapping-patterns -fno-warn-missing-methods -cpp -c -o /usr/local/src/hat-2.00/targets/powerpc- Darwin-5.5/obj/hatlib/ghc/TPreludeBuiltinTypes.o TPreludeBuiltinTypes.hs
TPreludeBuiltinTypes.hs:12: failed to load interface for `Hat': Could not find interface file for `Hat'
Has the file Hat.hs (in directory src/hat/lib) already been compiled? Did the compilation leave a Hat.hi file in the same directory? I'm not aware of any significant differences between ghc on different platforms, but it could be a difference in `make' behaviour, perhaps. [ By the way, ghc-5.04 has a bug (in 'show'ing named fields) which will prevent you from getting much further with building Hat in any case. You either need to wait for 5.04.1 to be released, or revert to 5.02.x for the moment. ] Regards, Malcolm

On Wednesday, August 14, 2002, at 04:49 AM, Malcolm Wallace wrote:
Stephen Pitts
writes: Has the file Hat.hs (in directory src/hat/lib) already been compiled? No; for some reason, after "make clean; make" the compile goes straight for hat.c and then for the above Haskell file. Rerunning "./configure" after deleting the targets directory fixed the maze of Makefiles, and ghc is building the Haskell source right now.
I think I understand what caused my problem. On Mac OS X, there is no /usr/bin/gcc; even though Apple's cc is gcc, it's called /usr/bin/cc. "CC=gcc" is hardcoded into targets/<target>/config.cache, but "configure" never checks for gcc; I guess that it assumes that if there's a working ghc there's a working gcc. Anyway, the first time I tried to build, the Haskell sources built fine but the build failed on "hat.c" because hmake couldn't find gcc. I edited config.cache by hand, ran "make clean", and restarted the build, but "make clean" didn't clean enough. Perhaps the "make clean" target should delete the targets directory?
[ By the way, ghc-5.04 has a bug (in 'show'ing named fields) which will prevent you from getting much further with building Hat in any case. You either need to wait for 5.04.1 to be released, or revert to 5.02.x for the moment. ] Thanks for the info; do you have an ETA on ghc-5.04.1? I'm unfamiliar with the ghc build process, but I understand that it involves some sort of bootstrapping like the build process of gcc. Will I be able to use my ghc 5.04 to build a new ghc 5.04.1 when it is released? Will it be compatible with gcc 3.1?
-- Stephen Pitts smpitts@midsouth.rr.com

Stephen Pitts
I think I understand what caused my problem. On Mac OS X, there is no /usr/bin/gcc; even though Apple's cc is gcc, it's called /usr/bin/cc. "CC=gcc" is hardcoded into targets/<target>/config.cache, but "configure" never checks for gcc; I guess that it assumes that if there's a working ghc there's a working gcc.
You can change the name of the C compiler at configure time using the environment variable CC, for instance: CC=cc ./configure --buildwith=ghc I apologise that this is no longer documented - it was certainly once part of the docs for nhc98, but it seems that when Hat was made into a separate entity it was not carried over. I'll update the docs now.
I edited config.cache by hand, ran "make clean", and restarted the build, but "make clean" didn't clean enough. Perhaps the "make clean" target should delete the targets directory?
"make realclean" deletes the targets directory, which forces you to re-run ./configure.
Thanks for the info; do you have an ETA on ghc-5.04.1?
No, sorry. You could ask on the glasgow-haskell-users list.
I'm unfamiliar with the ghc build process, but I understand that it involves some sort of bootstrapping like the build process of gcc. Will I be able to use my ghc 5.04 to build a new ghc 5.04.1 when it is released? Will it be compatible with gcc 3.1?
You can certainly use ghc 5.04 to bootstrap the next release from sources if you wish, but I'm sure it would be much easier just to download a binary package and install it. :-) I think ghc is reasonably compatible with gcc-3.1. Regards, Malcolm
participants (2)
-
Malcolm Wallace
-
Stephen Pitts