Building on windows

Simon Peyton-Jones simonpj at
Fri Aug 23 01:21:58 CEST 2013

I've got a new Windows laptop, and have being having a torrid time getting GHC to build on it.

1.      Build falls over with
checking for gcc... c:/code/HEAD/inplace/mingw/bin/gcc.exe
checking whether the C compiler works... no
configure: error: in `/c/code/HEAD':
configure: error: C compiler cannot create executables
Turns out that an earlier error was
configure: Making in-tree mingw tree
tar (child): ../../ghc-tarballs/mingw/binutils*.tar.lzma: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
./configure: line 4050: inplace/mingw/bin/realgcc.exe: No such file or directory
configure: In-tree mingw tree created
configure: Making in-tree perl tree
BUT this error was not fatal, so the build went on (notwithstanding the red message above), leading to a MUCH more obscure error later.

2.      Why wasn't ghc-tarballs there?  Oh, apparently you have to say
sync-all -windows get
That's really hard for a naïve user to work out.  Can't we either always get it, or work out that we are on windows?

3.      I carefully installed mingw/msys as described on
I used mingw-set-inst, which launches a GUI for a package installer.  All seems well.  I update my path.  But then
Can't locate Autom4te/ in @INC (@INC contains: /mingw/share/autoco
nf /usr/lib/perl5/5.8/msys /usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8/msys
/usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_
perl/5.8/msys /usr/lib/perl5/vendor_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) a
t /c/Programme/MinGW/bin/autoreconf-2.68 line 40.
BEGIN failed--compilation aborted at /c/Programme/MinGW/bin/autoreconf-2.68 line

After a long struggle I found that I had missed a crucial thing.  With the new autoconf tools, it's essential that c:/mingw be mounted as /mingw, because /mingw is hard-coded into autoconf perl scripts. does say (deep in the middle) to edit c:/mingw/msys/1.0/etc/fstab with a text editor, but that appeared to have no effect for me.  Saying "mount c:/mingw /mingw" did work.  I have no idea why.

What is horrible is how uninformative the error message is.

I guess we should update the Windows build instructions.

I still don't know if I've bottomed out here because I can't find Happy/Alex in the Haskell platform. Sigh.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list