|
CONVERSION ERROR
|
|
# Known pitfalls in building Glasgow Haskell
|
|
|
|
|
|
Error: HttpError (HttpExceptionRequest Request {
|
|
|
|
host = "ghc.haskell.org"
|
|
|
|
port = 443
|
|
|
|
secure = True
|
|
|
|
requestHeaders = []
|
|
|
|
path = "/trac/ghc/wiki/Building/KnownProblems"
|
|
|
|
queryString = "?version=3"
|
|
|
|
method = "GET"
|
|
|
|
proxy = Nothing
|
|
|
|
rawBody = False
|
|
|
|
redirectCount = 10
|
|
|
|
responseTimeout = ResponseTimeoutDefault
|
|
|
|
requestVersion = HTTP/1.1
|
|
|
|
}
|
|
|
|
(StatusCodeException (Response {responseStatus = Status {statusCode = 403, statusMessage = "Forbidden"}, responseVersion = HTTP/1.1, responseHeaders = [("Date","Sun, 10 Mar 2019 06:58:26 GMT"),("Server","Apache/2.2.22 (Debian)"),("Strict-Transport-Security","max-age=63072000; includeSubDomains"),("Vary","Accept-Encoding"),("Content-Encoding","gzip"),("Content-Length","260"),("Content-Type","text/html; charset=iso-8859-1")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}) "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /trac/ghc/wiki/Building/KnownProblems\non this server.</p>\n<hr>\n<address>Apache/2.2.22 (Debian) Server at ghc.haskell.org Port 443</address>\n</body></html>\n"))
|
|
|
|
|
|
|
|
Original source:
|
|
|
|
|
|
|
|
```trac
|
|
|
|
[[PageOutline]]
|
|
|
|
|
|
|
|
= Known pitfalls in building Glasgow Haskell =
|
|
|
|
|
|
|
|
WARNINGS about pitfalls and known "problems":
|
|
WARNINGS about pitfalls and known "problems":
|
|
|
|
|
|
1. One difficulty that comes up from time to time is running out of space
|
|
1. One difficulty that comes up from time to time is running out of space
|
|
in {{{TMPDIR}}}. (It is impossible for the configuration stuff to
|
|
in `TMPDIR`. (It is impossible for the configuration stuff to
|
|
compensate for the vagaries of different sysadmin approaches to temp
|
|
compensate for the vagaries of different sysadmin approaches to temp
|
|
space.)
|
|
space.)
|
|
[[br]]
|
|
|
|
The quickest way around it is {{{setenv TMPDIR /usr/tmp}}} or
|
|
The quickest way around it is `setenv TMPDIR /usr/tmp` or
|
|
even {{{setenv TMPDIR .}}} (or the equivalent incantation with your shell
|
|
even `setenv TMPDIR .` (or the equivalent incantation with your shell
|
|
of choice).
|
|
of choice).
|
|
[[br]]
|
|
|
|
The best way around it is to say
|
|
The best way around it is to say
|
|
{{{
|
|
|
|
|
|
```wiki
|
|
export TMPDIR=<dir>
|
|
export TMPDIR=<dir>
|
|
}}}
|
|
```
|
|
in your {{{build.mk}}} file. Then GHC and the other
|
|
|
|
|
|
in your `build.mk` file. Then GHC and the other
|
|
tools will use the appropriate directory in all cases.
|
|
tools will use the appropriate directory in all cases.
|
|
2. In compiling some support-code bits, e.g., in {{{ghc/rts/gmp}}} and even
|
|
1. You may occasionally see a warning from the C compiler when compiling some
|
|
in {{{ghc/lib}}}, you may get a few C-compiler warnings. We think these
|
|
Haskell code, eg. "warning: assignment from
|
|
are OK.
|
|
incompatible pointer type". These are usually harmless, but it's a good idea to
|
|
3. When compiling via C, you'll sometimes get "warning: assignment from
|
|
report it on the mailing list so that we can fix it.
|
|
incompatible pointer type" out of GCC. Harmless.
|
|
1. Similarly, `ar`chiving warning messages like the following are not
|
|
4. Similarly, {{{ar}}}chiving warning messages like the following are not
|
|
|
|
a problem:
|
|
a problem:
|
|
{{{
|
|
|
|
|
|
```wiki
|
|
ar: filename GlaIOMonad__1_2s.o truncated to GlaIOMonad_
|
|
ar: filename GlaIOMonad__1_2s.o truncated to GlaIOMonad_
|
|
ar: filename GlaIOMonad__2_2s.o truncated to GlaIOMonad_
|
|
ar: filename GlaIOMonad__2_2s.o truncated to GlaIOMonad_
|
|
...
|
|
...
|
|
}}}
|
|
```
|
|
5. In compiling the compiler proper (in {{{compiler/}}}), you ''may''
|
|
1. GHC's sources go through `cpp` before being compiled, and `cpp` varies
|
|
get an "Out of heap space" error message. These can vary with the
|
|
|
|
vagaries of different systems, it seems. The solution is simple:
|
|
|
|
* If you're compiling with GHC 4.00 or later, then the
|
|
|
|
''maximum'' heap size must have been reached. This
|
|
|
|
is somewhat unlikely, since the maximum is set to 64M by default.
|
|
|
|
Anyway, you can raise it with the
|
|
|
|
{{{-optCrts-M<size>}}} flag (add this flag to
|
|
|
|
{{{<module>_HC_OPTS}}}
|
|
|
|
{{{make}}} variable in the appropriate
|
|
|
|
{{{Makefile}}}).
|
|
|
|
* For GHC > 4.00, add a suitable {{{-H}}} flag to the {{{Makefile}}}, as
|
|
|
|
above.
|
|
|
|
* and try again: {{{make}}}. (see <xref linkend="sec-suffix"/> for information about
|
|
|
|
{{{<module>_HC_OPTS}}}.)
|
|
|
|
[[br]]
|
|
|
|
Alternatively, just cut to the chase:
|
|
|
|
{{{
|
|
|
|
$ cd ghc/compiler
|
|
|
|
$ make EXTRA_HC_OPTS=-optCrts-M128M
|
|
|
|
}}}
|
|
|
|
5. 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.
|
|
|
|
[[br]]
|
|
|
|
As {{{fixincludes}}} is now automagically run as part of GCC installation,
|
|
|
|
this bug also suggests that you have an old GCC.
|
|
|
|
6. 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.
|
|
|
|
7. 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
|
|
a bit from one Unix to another. One particular gotcha is macro calls
|
|
like this:
|
|
like this:
|
|
{{{
|
|
|
|
|
|
```wiki
|
|
SLIT("Hello, world")
|
|
SLIT("Hello, world")
|
|
}}}
|
|
```
|
|
Some {{{cpp}}}s 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 weird things in string args to {{{cpp}}} macros.
|
|
|
|
|
|
|
|
|
|
Some `cpp`s treat the comma inside the string as separating two macro
|
|
|
|
arguments, so you get
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
:731: macro `SLIT' used with too many (2) args
|
|
```
|
|
```
|
|
|
|
|
|
|
|
Alas, `cpp` doesn't tell you the offending file!
|
|
|
|
Workaround: don't put weird things in string args to `cpp` macros. |