This repository has been archived by the owner on Mar 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
faq_502.shtml
125 lines (108 loc) · 4.74 KB
/
faq_502.shtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<html>
<head>
<title>GHC 5.02 Mini-FAQ</title>
</head>
<body bgcolor="white">
<h2>GHC 5.02 Mini-FAQ</h2>
This page lists known problems for the 5.02 release, with workarounds.
<ul>
<li>The interactive system complains about missing symbols like
<tt>CC_LIST</tt> when loading previously compiled .o files.
<p>
This probably means the .o files in question were compiled for
profiling
(with <tt>-prof</tt>). Workaround: recompile them without
profiling. We really ought to detect this situation and give a
proper
error message.
<p>
</li>
<li>Not really a bug, but ... if the interactive system complains
about
missing symbols in a library, and you know those symbols should be
supplied by a shared object (<tt>.so</tt>) file, remember that you
can specify names of <tt>.so</tt>'s on the ghci command line. These
extra libraries are then also searched by the runtime linker.
You can also use the <tt>-L</tt> and <tt>-l</tt> flags on the ghci
command line, and they work in the usual way.
</p>
</li>
<li>Linking a program causes the following error on Linux:
<pre>
/usr/bin/ld: cannot open -lgmp: No such file or directory
</pre>
The problem is that your system doesn't have the GMP library
installed. If this is a RedHat distribution, install the
RedHat-supplied gmp-devel package, and the gmp package if you don't
already have it. There have been reports that installing the RedHat
packages also works for SuSE (SuSE don't supply a shared gmp library).
</p>
</li>
<li>Can't run GHCi on Linux, because it complains about a missing
<tt>libreadline.so.3</tt>.
<p>Newer Linuxes (SuSE 7.1, possibly RH 7.X, possibly Mandrake 8.X)
only come with <tt>libreadline.so.4</tt>. Installing from an
appropriate RPM is a good way to avoid this problem. If you can't
do this (perhaps because we don't have an RPM for your flavour of
Linux), then you might be able to get things working by making a
symbolic link from libreadline.so.4 to libreadline.so.3. We tried
this on a SuSE 7.1 box and it seemed to work. </p></li>
<li>Solaris users may sometimes get link errors due to libraries
needed by GNU Readline. We suggest you try linking in some
combination
of the
<tt>termcap</tt>, <tt>curses</tt> and <tt>ncurses</tt> libraries, by
giving <tt>-ltermcap</tt>, <tt>-lcurses</tt> and <tt>-lncurses</tt>
respectively. If you encounter this problem, we would appreciate
feedback on it, since we don't fully understand what's going on here.
</p>
</li>
<li>When I try to start ghci (probably one I compiled myself) it says
<pre>
ghc-5.02: not built for interactive use
</pre>
To build a working ghci, you need to build GHC 5.02 with itself; the above
message appears if you build it with 4.08.X, for example. It'll
still work fine for batch-mode compilation, though. Note that you
really must build with exactly the same version of the compiler.
Building 5.02 with 5.00.2, for example, may or may not give a
working interactive system; it
probably won't, and certainly isn't supported.
Note also that you can build 5.02 with any older compiler, back to
4.08.1,
if you don't
want a working interactive system; that's OK, and supported.</li>
<p>
<p><li><p>When I use a foreign function that takes or returns a float, it
gives the wrong answer, or crashes.
<p>You should use <a href="docs/5.02/set/sec-foreign.html"><tt>-#include</tt></a>.
</li>
<p><li><p>My program that uses a really large heap crashes on Windows.
<p>For utterly horrible reasons, programs that use more than 128Mb of heap
won't work when compiled dynamically on Windows (they should be fine
statically compiled).
</li>
<p><li><p>GHC doesn't like filenames containing <tt>+</tt>.
<p>Indeed not. You could change <tt>+</tt> to <tt>p</tt> or <tt>plus</tt>.
</li>
<p><li><p>When I open a FIFO (named pipe) and try to read from it, I
get EOF immediately. <p>This is a consequence of the fact that GHC
opens the FIFO in non-blocking mode. The behaviour varies from OS to
OS: on Linux and Solaris you can wait for a writer by doing an explicit
<tt>threadWaitRead</tt> on
the file descriptor (gotten from <tt>Posix.handleToFd</tt>) before
the first read, but
this doesn't work on FreeBSD. A workaround for all systems is to open
the FIFO for writing yourself, before (or at the same time as) opening
it for reading.
</li>
<p><li><p>When I <tt>foreign import</tt> a function that returns
<tt>char</tt> or <tt>short</tt>, I get garbage back.
<p>This is a known bug, GHC currently doesn't mask out the more
significant bits of the result. It doesn't manifest with gcc 2.95,
but apparently shows up with g++ and gcc 3.0. We'll fix it after
the 5.02 release.
</li>
</ul>
</body>
</html>