1 <Chapter id="sec-installing-bin-distrib">
2 <Title>Installing from binary distributions</Title>
3 <IndexTerm><Primary>binary installations</Primary></IndexTerm>
4 <IndexTerm><Primary>installation, of binaries</Primary></IndexTerm>
7 Installing from binary distributions is easiest, and recommended!
8 (Why binaries? Because GHC is a Haskell compiler written in Haskell,
9 so you've got to “bootstrap” it, somehow. We provide
10 machine-generated C-files-from-Haskell for this purpose, but it's
11 really quite a pain to use them. If you must build GHC from its
12 sources, using a binary-distributed GHC to do so is a sensible way to
13 proceed. For the other <Literal>fptools</Literal> programs, many are written in Haskell,
14 so binary distributions allow you to install them without having a Haskell compiler.)
17 <Para>This guide is in two parts: installing on Unix-a-likes, and installing on Windows.</Para>
20 <Sect1><Title>Installing on Unix-a-likes</Title>
23 <Title>Bundle structure</Title>
26 <IndexTerm><Primary>bundles of binary stuff</Primary></IndexTerm>
30 Binary distributions come in “bundles,” one bundle per file called
31 <Literal><bundle>-<platform>.tar.gz</Literal>. (See the building guide for the definition of a platform.) Suppose that you untar a binary-distribution bundle, thus:
37 % cd /your/scratch/space
38 % gunzip < ghc-x.xx-sun-sparc-solaris2.tar.gz | tar xvf -</Screen>
43 Then you should find a single directory, <Literal>fptools</Literal>, with the following
48 <IndexTerm><Primary>binary distribution, layout</Primary></IndexTerm>
49 <IndexTerm><Primary>directory layout (binary distributions)</Primary></IndexTerm>
53 <Term><Literal>Makefile.in</Literal></Term>
56 the raw material from which the <Literal>Makefile</Literal>
57 will be made (<Xref LinkEnd="sec-install">).
59 </ListItem></VarListEntry>
61 <Term><Literal>configure</Literal></Term>
64 the configuration script (<Xref LinkEnd="sec-install">).
66 </ListItem></VarListEntry>
68 <Term><Literal>README</Literal></Term>
71 Contains this file summary.
73 </ListItem></VarListEntry>
75 <Term><Literal>INSTALL</Literal></Term>
78 Contains this description of how to install
81 </ListItem></VarListEntry>
83 <Term><Literal>ANNOUNCE</Literal></Term>
86 The announcement message for the bundle.
88 </ListItem></VarListEntry>
90 <Term><Literal>NEWS</Literal></Term>
93 release notes for the bundle—a longer version
94 of <Literal>ANNOUNCE</Literal>. For GHC, the release notes are contained in the User
95 Guide and this file isn't present.
97 </ListItem></VarListEntry>
99 <Term><Literal>bin/<platform></Literal></Term>
102 contains platform-specific executable
103 files to be invoked directly by the user. These are the files that
104 must end up in your path.
106 </ListItem></VarListEntry>
108 <Term><Literal>lib/<platform>/</Literal></Term>
111 contains platform-specific support
112 files for the installation. Typically there is a subdirectory for
113 each <Literal>fptools</Literal> project, whose name is the name of the project with its
114 version number. For example, for GHC there would be a sub-directory
115 <Literal>ghc-x.xx</Literal>/ where <Literal>x.xx</Literal> is the version number of GHC in the bundle.
119 These sub-directories have the following general structure:
126 <Term><Literal>libHSstd.a</Literal> etc:</Term>
129 supporting library archives.
131 </ListItem></VarListEntry>
133 <Term><Literal>ghc-iface.prl</Literal> etc:</Term>
138 </ListItem></VarListEntry>
140 <Term><Literal>import/</Literal></Term>
143 <IndexTerm><Primary>Interface files</Primary></IndexTerm> (<Literal>.hi</Literal>) for the prelude.
145 </ListItem></VarListEntry>
147 <Term><Literal>include/</Literal></Term>
150 A few C <Literal>#include</Literal> files.
152 </ListItem></VarListEntry>
155 </ListItem></VarListEntry>
157 <Term><Literal>share/</Literal></Term>
160 contains platform-independent support files
161 for the installation. Again, there is a sub-directory for each
162 <Literal>fptools</Literal> project.
164 </ListItem></VarListEntry>
166 <Term><Literal>html/</Literal></Term>
169 contains HTML documentation files (one
170 sub-directory per project).
172 </ListItem></VarListEntry>
174 <Term><Literal>man/</Literal></Term>
177 contains Unix manual pages.
179 </ListItem></VarListEntry>
184 This structure is designed so that you can unpack multiple bundles
185 (including ones from different releases or platforms) into a single
186 <Literal>fptools</Literal> directory
190 this doesn't work at the
201 % cd /your/scratch/space
202 % gunzip < ghc-x.xx-sun-sparc-solaris2.tar.gz | tar xvf -
203 % gunzip < happy-x.xx-sun-sparc-sunos4.tar.gz | tar xvf -</Screen>
208 When you do multiple unpacks like this, the top level <Literal>Makefile</Literal>,
209 <Literal>README</Literal>, and <Literal>INSTALL</Literal> get overwritten each time.
210 That's fine—they should be the same. Likewise, the
211 <Literal>ANNOUNCE-<bundle></Literal> and <Literal>NEWS-<bundle></Literal>
212 files will be duplicated across multiple platforms, so they will be
213 harmlessly overwritten when you do multiple unpacks. Finally, the
214 <Literal>share/</Literal> stuff will get harmlessly overwritten when you do
215 multiple unpacks for one bundle on different platforms.
218 <Sect3 id="sec-install">
219 <Title>Installing</Title>
222 OK, so let's assume that you have unpacked your chosen bundles into a
223 scratch directory <Literal>fptools</Literal>. What next? Well, you will at least need
224 to run the <Literal>configure</Literal><IndexTerm><Primary>configure</Primary></IndexTerm> script by changing your
225 directory to <Literal>fptools</Literal> and typing <Literal>./configure</Literal>. That should convert
226 <Literal>Makefile.in</Literal> to <Literal>Makefile</Literal>.
230 <IndexTerm><Primary>installing in-place</Primary></IndexTerm>
231 <IndexTerm><Primary>in-place installation</Primary></IndexTerm>
232 You can now either start using the tools <Emphasis>in-situ</Emphasis> without going
233 through any installation process, just type <Literal>make in-place</Literal> to set the
234 tools up for this. You'll also want to add the path which <Literal>make</Literal> will
235 now echo to your <Literal>PATH</Literal> environment variable. This option is useful if
236 you simply want to try out the package and/or you don't have the
237 necessary privileges (or inclination) to properly install the tools
238 locally. Note that if you do decide to install the package `properly'
239 at a later date, you have to go through the installation steps that
244 To install an <Literal>fptools</Literal> package, you'll have to do the following:
253 Edit the <Literal>Makefile</Literal> and check the settings of the following variables:
255 <IndexTerm><Primary>directories, installation</Primary></IndexTerm>
256 <IndexTerm><Primary>installation directories</Primary></IndexTerm>
261 <Term><Literal>platform</Literal></Term>
264 the platform you are going to install for.
266 </ListItem></VarListEntry>
268 <Term><Literal>bindir</Literal></Term>
271 the directory in which to install user-invokable
274 </ListItem></VarListEntry>
276 <Term><Literal>libdir</Literal></Term>
279 the directory in which to install
280 platform-dependent support files.
282 </ListItem></VarListEntry>
284 <Term><Literal>datadir</Literal></Term>
287 the directory in which to install
288 platform-independent support files.
290 </ListItem></VarListEntry>
292 <Term><Literal>infodir</Literal></Term>
295 the directory in which to install Emacs info
298 </ListItem></VarListEntry>
300 <Term><Literal>htmldir</Literal></Term>
303 the directory in which to install HTML
306 </ListItem></VarListEntry>
308 <Term><Literal>dvidir</Literal></Term>
311 the directory in which to install DVI
314 </ListItem></VarListEntry>
317 The values for these variables can be set through invocation of the
318 <Command>configure</Command><IndexTerm><Primary>configure</Primary></IndexTerm>
319 script that comes with the distribution, but doing an optical diff to
320 see if the values match your expectations is always a Good Idea.
324 <Emphasis>Instead of running <Command>configure</Command>, it is
325 perfectly OK to copy <Filename>Makefile.in</Filename> to
326 <Filename>Makefile</Filename> and set all these variables directly
327 yourself. But do it right!</Emphasis>
334 Run <Literal>make install</Literal>. This <Emphasis>
335 should</Emphasis> work with ordinary Unix
336 <Literal>make</Literal>—no need for fancy stuff like GNU
337 <Literal>make</Literal>.
344 <Literal>rehash</Literal> (t?csh or zsh users), so your shell will see the new
345 stuff in your bin directory.
352 Once done, test your “installation” as suggested in
353 <XRef LinkEnd="sec-GHC-test">. Be sure to use a <Literal>-v</Literal>
354 option, so you can see exactly what pathnames it's using.
356 If things don't work as expected, check the list of known pitfalls in
366 <IndexTerm><Primary>link, installed as ghc</Primary></IndexTerm>
367 When installing the user-invokable binaries, this installation
368 procedure will install GHC as <Literal>ghc-x.xx</Literal> where <Literal>x.xx</Literal> is the version
369 number of GHC. It will also make a link (in the binary installation
370 directory) from <Literal>ghc</Literal> to <Literal>ghc-x.xx</Literal>. If you install multiple versions
371 of GHC then the last one “wins”, and “<Literal>ghc</Literal>” will invoke the last
372 one installed. You can change this manually if you want. But
373 regardless, <Literal>ghc-x.xx</Literal> should always invoke GHC version <Literal>x.xx</Literal>.
380 <Title>What bundles there are</Title>
383 <IndexTerm><Primary>bundles, binary</Primary></IndexTerm>
384 There are plenty of “non-basic” GHC bundles. The files for them are
385 called <Literal>ghc-x.xx-<bundle>-<platform>.tar.gz</Literal>, where
386 the <Literal><platform></Literal> is as above, and <Literal><bundle></Literal> is one
394 <Term><Literal>prof</Literal>:</Term>
397 Profiling with cost-centres. You probably want this.
398 <IndexTerm><Primary>profiling bundles</Primary></IndexTerm>
399 <IndexTerm><Primary>bundles, profiling</Primary></IndexTerm>
401 </ListItem></VarListEntry>
403 <Term><Literal>par</Literal>:</Term>
406 Parallel Haskell features (sits on top of PVM).
407 You'll want this if you're into that kind of thing.
408 <IndexTerm><Primary>parallel bundles</Primary></IndexTerm>
409 <IndexTerm><Primary>bundles, parallel</Primary></IndexTerm>
411 </ListItem></VarListEntry>
413 <Term><Literal>gran</Literal>:</Term>
416 The “GranSim” parallel-Haskell simulator
417 (hmm… mainly for implementors).
418 <IndexTerm><Primary>bundles, gransim</Primary></IndexTerm>
419 <IndexTerm><Primary>gransim bundles</Primary></IndexTerm>
421 </ListItem></VarListEntry>
423 <Term><Literal>ticky</Literal>:</Term>
426 “Ticky-ticky” profiling; very detailed
427 information about “what happened when I ran this program”—really
429 <IndexTerm><Primary>bundles, ticky-ticky</Primary></IndexTerm>
430 <IndexTerm><Primary>ticky-ticky bundles</Primary></IndexTerm>
432 </ListItem></VarListEntry>
437 One likely scenario is that you will grab <Emphasis>two</Emphasis>
438 binary bundles—basic, and profiling. We don't usually make the
439 rest, although you can build them yourself from a source distribution.
444 <Sect3 id="sec-GHC-test">
445 <Title>Testing that GHC seems to be working
449 <IndexTerm><Primary>testing a new GHC</Primary></IndexTerm>
453 The way to do this is, of course, to compile and run <Emphasis>this</Emphasis> program
454 (in a file <Literal>Main.hs</Literal>):
460 main = putStr "Hello, world!\n"
466 Compile the program, using the <Literal>-v</Literal> (verbose) flag to verify that
467 libraries, etc., are being found properly:
470 % ghc -v -o hello Main.hs</Screen>
479 Hello, world!</Screen>
484 Some simple-but-profitable tests are to compile and run the notorious
485 <Literal>nfib</Literal><IndexTerm><Primary>nfib</Primary></IndexTerm> program, using different numeric types. Start with
486 <Literal>nfib :: Int -> Int</Literal>, and then try <Literal>Integer</Literal>, <Literal>Float</Literal>, <Literal>Double</Literal>,
487 <Literal>Rational</Literal> and perhaps the overloaded version. Code for this is
488 distributed in <Literal>ghc/misc/examples/nfib/</Literal> in a source distribution.
492 For more information on how to “drive” GHC, either do <Literal>ghc -help</Literal> or
493 consult the User's Guide (distributed in several pre-compiled formats
494 with a binary distribution, or in source form in
495 <Literal>ghc/docs/users_guide</Literal> in a source distribution).
505 <Sect1 id="sec-install-windows"><Title>Installing on Windows</Title>
508 Getting the Glasgow Haskell Compiler (GHC) to run on Windows platforms can
509 be a bit of a trying experience. This document tries to simplify the task by
510 enumerating the steps you need to follow in order to set up and configure
511 your machine to run GHC (at least that's the intention ;-)
514 <Sect2><Title>System requirements</Title>
517 An installation of GHC requires ca. 200M of disk space, which is split
518 roughly 50-50 between GHC and the supporting software. To run GHC
519 comfortably, your machine should have at least 64M of memory.
525 <Sect2 id="sec-required"><Title>Software required</Title>
528 You need two chunks of software other than GHC itself: the Cygwin toolchain, and Perl. Here's how to get and install them.
531 <Sect3><Title>The cygwin toolchain (1.1)</Title>
534 GHC depends at the moment on the cygwin tools to operate, which
535 dresses up the Win32 environment into something more UNIX-like.
536 (notably, it provides <Command>gcc</Command>, <Command>as</Command> and <Command>ld</Command>),
537 so you'll need to install these tools first. You also need
538 Cygwin to use CVS. (We don't yet support later versions of Cygwin.)
542 Important grungy information about Cygwin:
549 Cygwin doesn't deal well with filenames that include
550 spaces. "<Filename>Program Files</Filename>" and "<Filename>Local files</Filename>" are
557 Cygwin implements a symbolic link as a text file with some
558 magical text in it. So programs that don't use Cygwin's
559 I/O libraries won't recognise such files as symlinks.
560 In particular, programs compiled by GHC are meant to be runnable
561 without having Cygwin, so they don't use the Cygwin library, so
562 they don't recognise symlinks.
569 Here's how to install Cygwin.
576 Install Cygwin 1.1 from
577 <ULink URL="http://sources.redhat.com/cygwin/">sources.redhat.com</ULink>
578 Install this somewhere locally. Despite the warnings, things seem to work better if you install Cygwin into the root directory rather than <Filename>cygwin</Filename>, which is the default. If you're upgrading from Cygwin B20.1, running <Command>mount --import-old-mounts</Command> immediately after installation may help. Either way, you want to end up with your main drive mounted in <Emphasis><Constant>textmode</Constant></Emphasis>, and only the <Filename>bin</Filename> directories mounted in <Constant>binmode</Constant>.
584 Create the following directories (if they aren't already there; substitute the drive you installed Cygwin on for <Filename>c:</Filename>):
588 <ListItem><Para><Filename>c:/etc</Filename></Para></ListItem>
589 <ListItem><Para><Filename>c:/bin</Filename></Para></ListItem>
590 <ListItem><Para><Filename>c:/usr/local/bin</Filename></Para></ListItem>
594 (using <Command>mkdir -p /bin</Command>, etc.)
600 Copy <Filename>bash.exe</Filename> from the <Filename>bin</Filename>
601 directory of the cygwin tree
602 (<Filename>cygwin/bin/bash.exe</Filename>) to
603 <Filename>/bin</Filename> as <Filename>sh.exe</Filename>. You might
604 think that it was easier to use bash directly from it original Cygwin
605 directory, but (a) some UNIX utils have got
606 <Filename>/bin/sh</Filename> hardwired in, and (b) the path following
607 <Literal>#!</Literal> is limited to 32 characters.
613 If you're an Emacs user and want to be able to run <Command>bash</Command>
614 from within a shell buffer, see the <ULink URL="http://www.cs.washington.edu/homes/voelker/ntemacs.html">NT Emacs home page</ULink> for
615 instructions on how to set this up.
624 <Sect3><Title>Environment variables</Title>
627 In case you don't already know how to set environment variables on a Windows
628 machine, here's how. On WinNT/Win2k, to edit your <Constant>PATH</Constant>
629 variable (for example), do the following:
633 <ListItem><Para>Press Start/Settings/Control Panels</Para></ListItem>
634 <ListItem><Para>Double-click System</Para></ListItem>
635 <ListItem><Para>Press Advanced</Para></ListItem>
636 <ListItem><Para>Press Environment Variables</Para></ListItem>
637 <ListItem><Para>Under System Variables, select <Constant>PATH</Constant></Para></ListItem>
638 <ListItem><Para>Press Edit</Para></ListItem>
639 <ListItem><Para>Add "<Filename>;C:/whatever/</Filename>" to the end of the string (for example)</Para></ListItem>
640 <ListItem><Para>Press OK</Para></ListItem>
644 Some environment variables are “user variables” and
645 some are “system variables”. I'm not sure of the difference
646 but both are changed though the same dialogue.
650 In addition, when running <Command>bash</Command>
651 you can set environment variables in your <Filename>.bashrc</Filename> file.
652 But it is better to set your environment variables from the
653 control panel (they get inherited by bash) because then they are visible
654 to applications that aren't started by bash. For example,
655 when you're invoking CVS (and ssh) via Emacs keybindings;
656 it invokes <Filename>cvs.exe</Filename> without going via bash.
660 On a Win9x machine you need to edit <Filename>autoexec.bat</Filename> using
661 <Filename>Windows/system/Sysedit</Filename>. You must reboot to make
662 the new settings take effect.
666 The following environment variables must be set:
672 <ColSpec Align="Left" Colsep="0">
673 <ColSpec Align="Left" Colsep="0">
677 <Entry><Constant>PATH</Constant></Entry>
678 <Entry>System</Entry>
680 Add <Filename>C:/cygnus/cygwin-b20/H-i586-cygwin32/bin</Filename>.
681 <Command>bash</Command> needs this, and when it is invoked from
682 <Filename>/bin</Filename> it can't find it. <Filename>c:/bin</Filename> and
683 <Filename>c:/usr/local/bin</Filename> should also be added. These should all
684 come <Emphasis>before</Emphasis> the Windows system directories (e.g.
685 <Filename>WINNT\system32</Filename>). You might want to set them in your
686 <Filename>.bashrc</Filename> rather than in the system-wide
687 <Constant>PATH</Constant>.
692 <Entry><Constant>SHELL</Constant></Entry>
695 <Filename>c:/bin/sh</Filename>.
700 <Entry><Constant>HOME</Constant></Entry>
703 Set to point to your home directory. This is where, for example,
704 <Command>bash</Command> will look for your <Filename>.bashrc</Filename>
710 <Entry><Constant>MAKE_MODE</Constant></Entry>
713 Set to <Literal>UNIX</Literal>. If you don't do
714 this you get very weird messages when you type `<Command>make</Command>', such as:
716 /c: /c: No such file or directory</Screen></Entry>
720 <Entry><Constant>TMPDIR</Constant></Entry>
723 Set to <Filename>c:/tmp</Filename> (note the forward slash). For some reason, Win2k invisibly sets this variable to point to a temporary directory in your profile, that contains embedded spaces. If GHC sees the <Constant>TMPDIR</Constant> variable set, it tries to use it for temporary files, but Cygwin doesn't grok filenames with spaces, so disaster results.
725 Furthermore, it seems that <Constant>TMPDIR</Constant> must be set to a directory in the same file system in which you invoke GHC. Otherwise you get very weird messages when you invoke GHC, such as:
729 Reason: file does not exist /tmp/ghc11068.cpp</Screen>
730 We think this is due to a bug in Cygwin.
740 In addition, we've had problems in the past with certain environment
741 variables being set that seem to have bad effects on GHC. If you have
742 installed other systems ported from Unix, you might too. If you get weird
743 inexplicable failures to build GHC, then it might be worth weeding out unused
744 environment variables. Known culprits from the past include
745 <Constant>GCC_EXEC_PREFIX</Constant> and <Constant>INCLUDE</Constant>.
751 <Sect3><Title>Perl5</Title>
754 The driver script is written in Perl, so you'll need to have this
755 installed too. However, the ghc binary distribution includes a
756 perl binary for you to make use of, should you not already have a
757 cygwin compatible one. Note: GHC does <Emphasis>not</Emphasis>
758 work with the ActiveState port of perl.
761 </Sect3> <!-- Perl -->
763 </Sect2> <!-- Reqd software -->
766 <Sect2><Title>Installing GHC</Title>
769 Download a GHC distribution:
775 <Term>ghc-4.08—InstallShield installer, 20M: <ULink
776 URL="http://www.haskell.org/ghc/dist/ghc-4-08.exe">http</ULink>
781 (The version number may change.) It is packaged up using an installer that should be familiar-looking to Windows users.
785 Note: The cygwin support for long file names containing
786 spaces is not 100%, so make sure that you install ghc in a directory
787 that has no embedded spaces (i.e., resist the temptation to put it
788 in <Filename>/Program Files/</Filename>!)
792 When the installer has completed, make sure you add the location of the
793 ghc <Filename>bin/</Filename> directory to your path (i.e.
794 <Filename>/path/to/wherever/ghc-4.08/bin </Filename>).
795 You need to do this in order to bring the various GHC DLLs into scope;
796 if not, then you need to copy the DLLs into a directory that is (the
797 system directory, for example).
801 Note: If you haven't got perl already installed, you will have to manually
802 copy the <Filename>perl.exe</Filename> binary from the ghc
803 <Filename>bin/</Filename> into your <Filename>/bin</Filename> directory
804 before continuing—the installer will not currently do this.
813 Make sure that you set all the environment variables described above
814 under Cygwin installation, including <Constant>TMPDIR</Constant>
817 To test the fruits of your labour, try now to compile a simple
823 module Main(main) where
825 main = putStrLn "Hello, world!"
826 bash$ /path/to/the/ghc/bin/directory/ghc-4.08 -o main main.hs
833 OK, assuming that worked, you're all set. Go forth and write useful
834 Haskell programs :-) If not, consult the installation FAQ (<XRef LinkEnd="winfaq">); if that still doesn't help then please report the problems you're experiencing (see <Xref LinkEnd="wrong">).
837 <Para> Further information on using GHC under Windows can be found in <ULink
838 URL="http://www.dcs.gla.ac.uk/~sof/ghc-win32.html">Sigbjørn Finne's
839 pages</ULink>. Note: ignore the installation instructions, which are rather
840 out of date; the <Emphasis>Miscellaneous</Emphasis> section at the bottom of
841 the page is of most interest, covering topics beyond the scope of this
847 <Sect2 id="winfaq"><title>Installing ghc-win32 FAQ</title>
855 Invoking ghc doesn't seem to do anything, it immediately returns without having compiled the input file.
861 One cause of this is that <Filename>/bin/sh</Filename> is missing. To verify, open up a
862 bash session and type <Command>ls -l /bin/sh.exe</Command>. If <Filename>sh.exe</Filename> is
863 reported as not being there, copy <Filename>bash.exe</Filename> (which you'll find
864 inside the cygwin installation tree as <Filename>H-i586-cygwin32/bin/bash.exe</Filename>)
865 to <Filename>/bin/sh.exe</Filename>.
869 All being well, ghc should then start to function.
879 I'm having trouble with symlinks.
885 Symlinks only work under Cygwin (<Xref LinkEnd="sec-install">), so binaries
886 not linked to the Cygwin DLL, in particular those built for Mingwin, will not
897 I'm having trouble with <Option>-static</Option>.
903 Static linking is no longer supported under Windows, and probably won't work.
913 I'm getting ``permission denied'' messages from <Command>rm</Command> or
914 <Command>mv</Command>.
920 This can have various causes: trying to rename a directory when an Explorer
921 window is open on it tends to fail. Closing the window generally cures the
922 problem, but sometimes its cause is more mysterious, and logging off and back
923 on or rebooting may be the quickest cure.
933 I get errors when trying to build GHC 4.08 with GHC 4.05.
937 <Answer> <Para> This seems to work better if you don't use
938 <Option>-O</Option> in <Constant>GhcHcOpts</Constant>. It's a bug in 4.05,
939 unfortunately. Anyway, better to install 4.08 binaries and use those.
949 When compiling up the <Literal>Hello World</Literal> example, the following happens:
953 bash$ /ghc/ghc-4.05/bin/ghc-4.05 main.hs
954 <stdin>:0:25: Character literal '{-# LINE 1 "main.hs" -}' too long
955 <stdin>:0:25: on input: "'"
963 bash$ /ghc/ghc-4.05/bin/ghc-4.05 main.hs
964 Program too big fit into memory under NT
970 The cause of this is that you're using a version of <Command>perl</Command> that employs the Microsoft <Command>cmd</Command>/<Command>command</Command> shell when launching sub-processes to execute <Function>system()</Function> calls.
974 The GHC driver really needs a <Command>perl</Command> which uses a `UNIX'y shell instead, so
975 make sure that the version you're using is of an compatible ilk. In particular,
976 if <Command>perl -v</Command> reports that you've got a copy of the (otherwise fine) port
977 of perl done by ActiveState, you're in trouble.
981 If you're stuck with an incompatible <Command>perl</Command>, the GHC installation comes with a very basic <Command>perl</Command> binary for you to use. Simply copy it into the <Command>/bin</Command> directory.
985 Notice that copying <Filename>perl.exe</Filename> into <Filename>/bin</Filename> will not cause
986 the GHC install to suddenly start functioning. If you don't want to
987 re-run the InstallShield installer again, you need to edit the following
988 files within the directory tree that the installer created:
992 bin/ghc-4.xx where xx is the minor release number
995 lib/mkdependHS</Screen>
998 For each of these files, you need to edit the first line from instead
999 saying <Command>#!/path/to/your/other/perl/install</Command> to <Command>#!/bin/perl</Command>.
1000 Once that is done, try compiling up the Hello, World example again.
1004 Should you want to pick up a complete installation of a ghc-friendly port
1005 of perl instead, a <ULink URL="http://cygutils.netpedia.net/">cygwin port</ULink> is available.
1019 <Sect1 id="building-docs">
1020 <Title>Building the documentation</Title>
1023 We use the DocBook DTD, which is widely used. Most shrink-wrapped distributions seem to be broken in one way or another; thanks to heroic efforts by Sven Panne and Manuel Chakravarty, we now support most of them, plus properly installed versions.
1027 Instructions on installing and configuring the DocBook tools follow.
1031 <Title>Installing the DocBook tools from RPMs</Title>
1033 <Para> If you're using a system that can handle RedHat RPM packages, you can
1034 probably use the <ULink
1035 URL="http://sourceware.cygnus.com/docbook-tools/">Cygnus DocBook
1036 tools</ULink>, which is the most shrink-wrapped SGML suite that we could
1037 find. You need all the RPMs except for psgml (i.e.
1038 <Filename>docbook</Filename>, <Filename>jade</Filename>,
1039 <Filename>jadetex</Filename>, <Filename>sgmlcommon</Filename> and
1040 <Filename>stylesheets</Filename>). Note that most of these RPMs are
1041 architecture neutral, so are likely to be found in a
1042 <Filename>noarch</Filename> directory. The SuSE RPMs also work; the RedHat
1043 ones <Emphasis>don't</Emphasis> as of version 6.2, but they are easy to fix:
1044 just make a symlink from
1045 <Filename>/usr/lib/sgml/stylesheets/nwalsh-modular/lib/dblib.dsl</Filename> to
1046 <Filename>/usr/lib/sgml/lib/dblib.dsl</Filename>. </Para>
1052 <Title>Installing from binaries on Windows</Title>
1055 It's a good idea to use Norman Walsh's <ULink
1056 URL="http://nwalsh.com/docbook/dsssl/doc/install.html">installation
1057 notes</ULink> as a guide. You should get version
1058 3.1 of DocBook, and note that his file <Filename>test.sgm</Filename> won't
1059 work, as it needs version 3.0. You should unpack Jade into <Filename>\Jade</Filename>, along with the entities, DocBook into <Filename>\docbook</Filename>, and the DocBook stylesheets into <Filename>\docbook\stylesheets</Filename> (so they actually end up in <Filename>\docbook\stylesheets\docbook</Filename>).
1066 <Title>Installing the DocBook tools from source</Title>
1072 Install <ULink URL="http://openjade.sourceforge.net/">OpenJade</ULink> (Windows binaries are available as well as sources). If you want DVI, PS, or PDF then install JadeTeX from the <Filename>dsssl</Filename>
1073 subdirectory. (If you get the error:
1076 ! LaTeX Error: Unknown option implicit=false' for package hyperref'.
1079 your version of <Command>hyperref</Command> is out of date; download it from
1080 CTAN (<Filename>macros/latex/contrib/supported/hyperref</Filename>), and
1081 make it, ensuring that you have first removed or renamed your old copy. If
1082 you start getting file not found errors when making the test for
1083 <Command>hyperref</Command>, you can abort at that point and proceed
1084 straight to <Command>make install</Command>, or enter them as
1085 <Filename>../</Filename><Emphasis>filename</Emphasis>.)
1089 Make links from <Filename>virtex</Filename> to <Filename>jadetex</Filename>
1090 and <Filename>pdfvirtex</Filename> to <Filename>pdfjadetex</Filename>
1091 (otherwise DVI, PostScript and PDF output will not work). Copy
1092 <Filename>dsssl/*.{dtd,dsl}</Filename> and <Filename>catalog</Filename> to <Filename>/usr/[local/]lib/sgml</Filename>.
1098 <Title>DocBook and the DocBook stylesheets</Title>
1102 URL="http://www.oasis-open.org/docbook/sgml/3.1/index.html">DocBook</ULink>
1103 and install the contents in <Filename>/usr/[local/]/lib/sgml</Filename>.
1107 Get the <ULink URL="http://nwalsh.com/docbook/dsssl/">DocBook
1108 stylesheets</ULink> and install in
1109 <Filename>/usr/[local/]lib/sgml/stylesheets</Filename> (thereby creating a
1110 subdirectory docbook). For indexing, copy or link <Filename>collateindex.pl</Filename> from the DocBook stylesheets archive in <Filename>bin</Filename> into a directory on your <Constant>PATH</Constant>.
1115 URL="http://www.oasis-open.org/cover/ISOEnts.zip">ISO
1116 entities</ULink> into <Filename>/usr/[local/]lib/sgml</Filename>.
1124 <Title>Configuring the DocBook tools</Title>
1127 Once the DocBook tools are installed, the configure script will detect them and set up the build system accordingly. If you have a system that isn't supported, let us know, and we'll try to help.
1133 <Title>Remaining problems</Title>
1136 If you install from source, you'll get a pile of warnings of the form
1138 <Screen>DTDDECL catalog entries are not supported</Screen>
1140 every time you build anything. These can safely be ignored, but if you find them tedious you can get rid of them by removing all the <Constant>DTDDECL</Constant> entries from <Filename>docbook.cat</Filename>.
1150 ;;; Local Variables: ***
1152 ;;; sgml-parent-document: ("users_guide.sgml" "book" "chapter") ***