Changes between Version 10 and Version 11 of ProblemsCompilingGhc


Ignore:
Timestamp:
May 4, 2011 11:06:40 PM (3 years ago)
Author:
dterei
Comment:

Remove as very old and not relevant anymore, now covered by building FAQ.

Legend:

Unmodified
Added
Removed
Modified
  • ProblemsCompilingGhc

    v10 v11  
    1 Back to the GarbageCollectorNotes 
    2  
    3 = Problems Compiling GHC = 
    4  
    5 I think it is useful to have a small section about compiling GHC. I ran into several magic problems getting GHC to build. I don’t fully understand the reasons for some of the fantastic sounding ones, however its worth mentioning them. Some of these are just general discipline guidelines, but are useful to keep in mind. 
    6  
    7 === Problem 1 ===  
    8 Make sure that you do actually have the latest versions of everything involved. These include: 
    9  
    10  * Darcs (a version control system that GHC is shifting towards) 
    11  * GHC source (get it using Darcs) 
    12  * Alex (the Lexer generator) 
    13  * Happy (the Parser generator) 
    14  
    15 Since the compilation of Haskell is very Unix styled, on Windows (I work using a Win XP machine), one needs to add several unix tools to windows. I don’t know why GHC building doesn’t target SFU on windows yet – maybe that’s something that they just haven’t got down to doing yet. Here are the unix-ish components that you need: 
    16  
    17  * MinGW (The compiler set, please get the latest – they have a downloading installer available somewhere, I used that one. I had several magic problems with many packaged binaries that I found on the net). 
    18  * MSYS (These maybe downloaded as binaries from the Msys site). 
    19  * MSYS DTK.  
    20  
    21 The GHC compiler notes explains all of this rather well.  
    22  
    23 === Problem 2 ===  
    24 Make sure your path is right. Make sure you get the right versions of things in your path. As an example, I have SFU binaries in my path before I had the MSYS ones they apparently don’t like each other too much. 
    25  
    26 === Problem 3 === 
    27 Watch out for what files you edit. There are some files in the build process are parsed by a simplistic C preprocessor and will not understand C++ style comments. Here are a list of these files: 
    28  
    29 [get file list] 
    30  
    31 === Problem 4 ===  
    32 This is a classical magic problem. I got GHC to build on my desktop but it would not my laptop. As a matter of fact when I type in “autoreconf” the machine freezes up after about 30 seconds. Very puzzling.  
    33  
    34 This behavior would often end with power cycling the laptop and was rather frustrating for a while. After studying the process with procexp, filemon and some standard monitoring tools it seemed like the “Logitech LVPrcSrv module” related to my Logitech webcam seems to hog the CPU. Since I wasn’t using the webcam, I killed the process and the build went through fine. At this point I can’t guess at what the relationship is or why there should be one.  
    35  
    36  
    37 Roshan James (rpjames [at] cs [dot] indiana [dot] edu) 
    38  
    39 === Problem 5 === 
    40 GHC's configure script seems to be not very happy with path names that contain spaces. (Like every other configure script in the world, probably...)  
    41  
    42 After actually reading the documentation, I realized this only applies when compiling under Cygwin. The building guide says, "Cygwin doesn't deal well with filenames that include spaces", which I disagree with. Scripts should be able to handle such filenames by using the "cygpath" command appropriate. However, I see that Cygwin isn't supported, so probably this isn't very important. 
    43  
    44 === Problem 6 === 
    45 The configure script wants something like: 
    46 --with-gcc=c:/mingw/bin/gcc 
    47 and not: 
    48 --with-gcc=c:\\mingw\\bin\\gcc 
    49 and certainly not: 
    50 --with-gcc=/cygdrive/c/mingw/bin/gcc 
    51  
    52 This should probably be stated more prominently. 
    53  
    54 === Problem 7 === 
    55 ~~I also needed to add: 
    56 --include=c:/cygwin/usr/include 
    57 to the configure options, otherwise I got a bunch of errors involving missing include files when compiling Linker.c.~~ actually, that didn't help. 
    58  
    59 (Maybe problems 5-7 don't matter since I was trying to use cygwin, which I gave up on.) 
    60  
    61 === Problem 8 === 
    62 Doing a make maintainer-clean in ghc doesn't delete configure-generated Makefiles in the rts subdirectory (or possibly just rts/gmp)? I'll investigate further. It also seemed like configure didn't recurse into rts/gmp at all for me. I got this error while running make: 
    63  
    64 {{{ 
    65 == make all - --unix -r; 
    66  in /c/ghc-builds/ghc/rts 
    67 ------------------------------------------------------------------------ 
    68 make -C gmp MAKEFLAGS= 
    69 make  all-recursive 
    70 make[3]: Entering directory `/c/ghc-builds/ghc/rts/gmp' 
    71 Making all in mpn 
    72 make[4]: Entering directory `/c/ghc-builds/ghc/rts/gmp/mpn' 
    73 make[5]: Entering directory `/c/ghc-builds/ghc/rts/gmp/mpn' 
    74 /bin/sh ../libtool --mode=compile /mingw/bin/gcc.exe -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DOPERATION_mp_bases    -g -O2 -c -o mp_bases.lo mp_bases.c 
    75 /mingw/bin/gcc.exe -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DOPERATION_mp_bases -g -O2 -c mp_bases.c -o mp_bases.o 
    76 echo timestamp > mp_bases.lo 
    77 m4 -DPIC -DOPERATION_udiv udiv.asm >tmp-udiv.s 
    78 ../config.m4:24: m4: Cannot open CONFIG_TOP_SRCDIR/mpn/asm-defs.m4: No such file or directory 
    79 NONE:0: m4: ERROR: EOF in argument list 
    80 make[5]: *** [udiv.lo] Error 1 
    81 make[5]: Leaving directory `/c/ghc-builds/ghc/rts/gmp/mpn' 
    82 make[4]: *** [all-recursive] Error 1 
    83 make[4]: Leaving directory `/c/ghc-builds/ghc/rts/gmp/mpn' 
    84 make[3]: *** [all-recursive] Error 1 
    85 make[3]: Leaving directory `/c/ghc-builds/ghc/rts/gmp' 
    86 make[2]: *** [all-recursive-am] Error 2 
    87 make[1]: *** [gmp/libgmp.a] Error 2 
    88 }}} 
    89  
    90 but after going into rts/gmp and running configure by hand, it was fine. 
    91  
    92 --Kirsten Chevalier