Next Previous Contents

9. Known pitfalls in building Glasgow Haskell

WARNINGS about pitfalls and known ``problems'':

  1. One difficulty that comes up from time to time is running out of space in /tmp. (It is impossible for the configuration stuff to compensate for the vagaries of different sysadmin approaches re temp space.) The quickest way around it is setenv TMPDIR /usr/tmp or even setenv TMPDIR . (or the equivalent incantation with the shell of your choice). The best way around it is to say
    export TMPDIR=<dir>
    
    in your build.mk file. Then GHC and the other fptools programs will use the appropriate directory in all cases.
  2. In compiling some support-code bits, e.g., in ghc/runtime/gmp and even in ghc/lib, you may get a few C-compiler warnings. We think these are OK.
  3. When compiling via C, you'll sometimes get ``warning: assignment from incompatible pointer type'' out of GCC. Harmless.
  4. Similarly, archiving warning messages like the following are not a problem:
    ar: filename GlaIOMonad__1_2s.o truncated to GlaIOMonad_
    ar: filename GlaIOMonad__2_2s.o truncated to GlaIOMonad_
    ...
    
  5. Also harmless are some specialisation messages that you may see when compiling GHC; e.g.:
    SPECIALISATION MESSAGES (Desirable):
    *** INSTANCES
    {-# SPECIALIZE instance Eq [Class] #-}
    {-# SPECIALIZE instance Eq (Class, [Class]) #-}
    {-# SPECIALIZE instance Outputable [ClassOp] #-}
    {-# SPECIALIZE instance Outputable [Id] #-}
    
  6. In compiling the compiler proper (in compiler/), you may get an ``Out of heap space'' error message. These can vary with the vagaries of different systems, it seems. The solution is simple: (1) add a suitable -H flag to the <module>_HC_OPTS make variable in the appropriate Makefile; (2) try again: gmake. (Section  Pattern Rules and Options.) Alternatively, just cut to the chase scene:
    % cd ghc/compiler
    % make EXTRA_HC_OPTS=-H32m  # or some nice big number
    
  7. Not too long into the build process, you may get a huge complaint of the form:
    Giant error 'do'ing getopts.pl:  at ./lit2pgm.BOOT line 27.
    
    This indicates that your perl was mis-installed; the binary is unable to find the files for its ``built-in'' library. Speak to your perl installer, then re-try.
  8. If you try to compile some Haskell, and you get errors from GCC about lots of things from /usr/include/math.h, then your GCC was mis-installed. fixincludes wasn't run when it should've been. As fixincludes is now automagically run as part of GCC installation, this bug also suggests that you have an old GCC.
  9. You may need to re-ranlib your libraries (on Sun4s).
    % cd $(libdir)/ghc-x.xx/sparc-sun-sunos4
    % foreach i ( `find . -name '*.a' -print` ) # or other-shell equiv...
    ?    ranlib $i
    ?    # or, on some machines: ar s $i
    ? end
    
    We'd be interested to know if this is still necessary.
  10. If you end up making documents that involve (La)TeX and/or tib (Simon's favourite), the odds are that something about your/our setup will reach out and bite you. Yes, please complain; meanwhile, you can do make -n whatever.dvi to see the intended commands, then try to muddle through, doing them by hand.
  11. GHC's sources go through cpp before being compiled, and cpp varies a bit from one Unix to another. One particular gotcha is macro calls like this:
      SLIT("Hello, world")
    
    Some cpps treat the comma inside the string as separating two macro arguments, so you get
      :731: macro `SLIT' used with too many (2) args
    
    Alas, cpp doesn't tell you the offending file! Workaround: don't put wierd things in string args to cpp macros.


Next Previous Contents