Changes between Version 1 and Version 2 of Building/KnownProblems

Oct 27, 2006 5:07:05 PM (9 years ago)

First import from xml docs


  • Building/KnownProblems

    v1 v2  
     3= Known pitfalls in building Glasgow Haskell = 
     5WARNINGS about pitfalls and known "problems": 
     7 1. One difficulty that comes up from time to time is running out of space 
     8    in {{{TMPDIR}}}.  (It is impossible for the configuration stuff to 
     9    compensate for the vagaries of different sysadmin approaches to temp 
     10    space.) 
     11    [[br]] 
     12    The quickest way around it is {{{setenv TMPDIR /usr/tmp}}} or 
     13    even {{{setenv TMPDIR .}}} (or the equivalent incantation with your shell 
     14    of choice). 
     15    [[br]] 
     16    The best way around it is to say 
     18export TMPDIR=<dir> 
     20    in your {{{}}} file.  Then GHC and the other 
     21    tools will use the appropriate directory in all cases. 
     22 2. In compiling some support-code bits, e.g., in {{{ghc/rts/gmp}}} and even 
     23    in {{{ghc/lib}}}, you may get a few C-compiler warnings.  We think these 
     24    are OK. 
     25 3.  When compiling via C, you'll sometimes get "warning: assignment from 
     26    incompatible pointer type" out of GCC.  Harmless. 
     27 4. Similarly, {{{ar}}}chiving warning messages like the following are not 
     28    a problem: 
     30ar: filename GlaIOMonad__1_2s.o truncated to GlaIOMonad_ 
     31ar: filename GlaIOMonad__2_2s.o truncated to GlaIOMonad_ 
     34 5. In compiling the compiler proper (in {{{compiler/}}}), you ''may'' 
     35    get an "Out of heap space" error message.  These can vary with the 
     36    vagaries of different systems, it seems.  The solution is simple: 
     37    * If you're compiling with GHC 4.00 or later, then the 
     38      ''maximum'' heap size must have been reached.  This 
     39      is somewhat unlikely, since the maximum is set to 64M by default. 
     40      Anyway, you can raise it with the 
     41      {{{-optCrts-M<size>}}} flag (add this flag to 
     42      {{{<module>_HC_OPTS}}} 
     43      {{{make}}} variable in the appropriate 
     44      {{{Makefile}}}). 
     45    * For GHC > 4.00, add a suitable {{{-H}}} flag to the {{{Makefile}}}, as 
     46      above. 
     47    * and try again: {{{make}}}.  (see <xref linkend="sec-suffix"/> for information about 
     48      {{{<module>_HC_OPTS}}}.) 
     49      [[br]] 
     50      Alternatively, just cut to the chase: 
     52$ cd ghc/compiler 
     53$ make EXTRA_HC_OPTS=-optCrts-M128M 
     55 5. If you try to compile some Haskell, and you get errors from GCC about 
     56    lots of things from {{{/usr/include/math.h}}}, then your GCC was 
     57    mis-installed.  {{{fixincludes}}} wasn't run when it should've been. 
     58    [[br]] 
     59    As {{{fixincludes}}} is now automagically run as part of GCC installation, 
     60    this bug also suggests that you have an old GCC. 
     61 6. You ''may'' need to re-{{{ranlib}}} your libraries (on Sun4s). 
     63$ cd $(libdir)/ghc-x.xx/sparc-sun-sunos4 
     64$ foreach i ( `find . -name '*.a' -print` ) # or other-shell equiv... 
     65?    ranlib $i 
     66?    # or, on some machines: ar s $i 
     67? end 
     69    We'd be interested to know if this is still necessary. 
     70 7. GHC's sources go through {{{cpp}}} before being compiled, and {{{cpp}}} varies 
     71    a bit from one Unix to another.  One particular gotcha is macro calls 
     72    like this: 
     74SLIT("Hello, world") 
     76    Some {{{cpp}}}s treat the comma inside the string as separating two macro 
     77    arguments, so you get 
     79:731: macro `SLIT' used with too many (2) args 
     81    Alas, {{{cpp}}} doesn't tell you the offending file! 
     82    [[br]] 
     83    Workaround: don't put weird things in string args to {{{cpp}}} macros.