[project @ 2001-04-23 15:21:48 by rrt]
[ghc-hetmet.git] / ghc / docs / users_guide / installing.sgml
1 <Chapter id="sec-installing-bin-distrib">
2   <Title>Installing GHC</Title>
3 <IndexTerm><Primary>binary installations</Primary></IndexTerm>
4 <IndexTerm><Primary>installation, of binaries</Primary></IndexTerm>
5
6 <Para>
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 machine-generated
10 C-files-from-Haskell for this purpose, but it's really quite a pain to
11 use them.  If you must build GHC from its sources, using a
12 binary-distributed GHC to do so is a sensible way to proceed. For the
13 other <Literal>fptools</Literal> programs, many are written in
14 Haskell, so binary distributions allow you to install them without
15 having a Haskell compiler.)
16 </Para>
17
18 <Para>This guide is in two parts: installing on Unix-a-likes, and installing on Windows.</Para>
19
20
21   <Sect1><Title>Installing on Unix-a-likes</Title>
22
23     <sect2>
24       <title>When a platform-specific package is available</title>
25       
26       <para>For certain platforms, we provide GHC binaries packaged
27       using the native package format for the platform.  This is
28       likely to be by far the best way to install GHC for your
29       platform if one of these packages is available, since
30       dependencies will automatically be handled and the package
31       system normally provides a way to uninstall the package at a
32       later date.</para>
33
34       <para>We generally provide the following packages:</para>
35
36       <variablelist>
37         <varlistentry>
38           <term>RedHat Linux/x86</term>
39           <listitem>
40             <para>RPM source & binary packages for RedHat Linux (x86
41             only) are available for most major releases.</para>
42           </listitem>
43         </varlistentry>
44
45         <varlistentry>
46           <term>Debian Linux/x86</term>
47           <listitem>
48             <para>Debian packages for Linux (x86 only), also for most
49             major releases.</para>
50           </listitem>
51         </varlistentry>
52
53         <varlistentry>
54           <term>FreeBSD/x86</term>
55           <listitem>
56             <para>On FreeBSD/x86, GHC can be installed using either
57             the ports tree (<literal>cd /usr/ports/lang/ghc && make
58             install</literal>) or from a pre-compiled package
59             available from your local FreeBSD mirror.</para>
60           </listitem>
61         </varlistentry>
62       </variablelist>
63       
64       <para>Other platform-specific packages may be available, check
65       the GHC download page for details.</para>
66     </sect2>
67
68 <Sect2>
69 <Title>GHC binary distributions</Title>
70
71 <Para>
72 <IndexTerm><Primary>bundles of binary stuff</Primary></IndexTerm>
73 </Para>
74
75 <Para>
76 Binary distributions come in &ldquo;bundles,&rdquo; one bundle per file called
77 <literal><replaceable>bundle</replaceable>-<replaceable>platform</replaceable>.tar.gz</Literal>.  (See the building guide for the definition of a platform.)  Suppose that you untar a binary-distribution bundle, thus:
78 </Para>
79
80 <Para>
81
82 <Screen>
83 % cd /your/scratch/space
84 % gunzip &#60; ghc-x.xx-sun-sparc-solaris2.tar.gz | tar xvf -</Screen>
85
86 </Para>
87
88 <Para>
89 Then you should find a single directory, <Literal>fptools</Literal>, with the following
90 structure:
91 </Para>
92
93 <Para>
94 <IndexTerm><Primary>binary distribution, layout</Primary></IndexTerm>
95 <IndexTerm><Primary>directory layout (binary distributions)</Primary></IndexTerm>
96 <VariableList>
97
98 <VarListEntry>
99 <Term><Literal>Makefile.in</Literal></Term>
100 <ListItem>
101 <Para>
102 the raw material from which the <Literal>Makefile</Literal>
103 will be made (<Xref LinkEnd="sec-install">).
104 </Para>
105 </ListItem></VarListEntry>
106 <VarListEntry>
107 <Term><Literal>configure</Literal></Term>
108 <ListItem>
109 <Para>
110 the configuration script (<Xref LinkEnd="sec-install">).
111 </Para>
112 </ListItem></VarListEntry>
113 <VarListEntry>
114 <Term><Literal>README</Literal></Term>
115 <ListItem>
116 <Para>
117 Contains this file summary.
118 </Para>
119 </ListItem></VarListEntry>
120 <VarListEntry>
121 <Term><Literal>INSTALL</Literal></Term>
122 <ListItem>
123 <Para>
124 Contains this description of how to install
125 the bundle.
126 </Para>
127 </ListItem></VarListEntry>
128 <VarListEntry>
129 <Term><Literal>ANNOUNCE</Literal></Term>
130 <ListItem>
131 <Para>
132 The announcement message for the bundle.
133 </Para>
134 </ListItem></VarListEntry>
135 <VarListEntry>
136 <Term><Literal>NEWS</Literal></Term>
137 <ListItem>
138 <Para>
139 release notes for the bundle&mdash;a longer version
140 of <Literal>ANNOUNCE</Literal>.  For GHC, the release notes are contained in the User
141 Guide and this file isn't present.
142 </Para>
143 </ListItem></VarListEntry>
144 <VarListEntry>
145             <Term><Literal>bin/<replaceable>platform</replaceable></Literal></Term>
146 <ListItem>
147 <Para>
148 contains platform-specific executable
149 files to be invoked directly by the user.  These are the files that
150 must end up in your path.
151 </Para>
152 </ListItem></VarListEntry>
153 <VarListEntry>
154 <Term><Literal>lib/<replaceable>platform</replaceable>/</Literal></Term>
155 <ListItem>
156 <Para>
157 contains platform-specific support
158 files for the installation.  Typically there is a subdirectory for
159 each <Literal>fptools</Literal> project, whose name is the name of the project with its
160 version number.  For example, for GHC there would be a sub-directory
161 <Literal>ghc-x.xx</Literal>/ where <Literal>x.xx</Literal> is the version number of GHC in the bundle.
162 </Para>
163
164 <Para>
165 These sub-directories have the following general structure:
166 </Para>
167
168 <Para>
169 <VariableList>
170
171 <VarListEntry>
172 <Term><Literal>libHSstd.a</Literal> etc:</Term>
173 <ListItem>
174 <Para>
175 supporting library archives.
176 </Para>
177 </ListItem></VarListEntry>
178 <VarListEntry>
179 <Term><Literal>ghc-iface.prl</Literal> etc:</Term>
180 <ListItem>
181 <Para>
182 support scripts.
183 </Para>
184 </ListItem></VarListEntry>
185 <VarListEntry>
186 <Term><Literal>import/</Literal></Term>
187 <ListItem>
188 <Para>
189 <IndexTerm><Primary>Interface files</Primary></IndexTerm> (<Literal>.hi</Literal>) for the prelude.
190 </Para>
191 </ListItem></VarListEntry>
192 <VarListEntry>
193 <Term><Literal>include/</Literal></Term>
194 <ListItem>
195 <Para>
196 A few C <Literal>&num;include</Literal> files.
197 </Para>
198 </ListItem></VarListEntry>
199 </VariableList>
200 </Para>
201 </ListItem></VarListEntry>
202 <VarListEntry>
203 <Term><Literal>share/</Literal></Term>
204 <ListItem>
205 <Para>
206 contains platform-independent support files
207 for the installation.  Again, there is a sub-directory for each
208 <Literal>fptools</Literal> project.
209 </Para>
210 </ListItem></VarListEntry>
211 <VarListEntry>
212 <Term><Literal>html/</Literal></Term>
213 <ListItem>
214 <Para>
215 contains HTML documentation files (one
216 sub-directory per project).
217 </Para>
218 </ListItem></VarListEntry>
219 <VarListEntry>
220 <Term><Literal>man/</Literal></Term>
221 <ListItem>
222 <Para>
223 contains Unix manual pages.
224 </Para>
225 </ListItem></VarListEntry>
226 </VariableList>
227 </Para>
228
229 <Sect3 id="sec-install">
230 <Title>Installing</Title>
231
232 <Para>
233 OK, so let's assume that you have unpacked your chosen bundles into a
234 scratch directory <Literal>fptools</Literal>. What next? Well, you will at least need
235 to run the <Literal>configure</Literal><IndexTerm><Primary>configure</Primary></IndexTerm> script by changing your
236 directory to <Literal>fptools</Literal> and typing <Literal>./configure</Literal>.  That should convert
237 <Literal>Makefile.in</Literal> to <Literal>Makefile</Literal>.
238 </Para>
239
240 <Para>
241 <IndexTerm><Primary>installing in-place</Primary></IndexTerm>
242 <IndexTerm><Primary>in-place installation</Primary></IndexTerm>
243 You can now either start using the tools <Emphasis>in-situ</Emphasis> without going
244 through any installation process, just type <Literal>make in-place</Literal> to set the
245 tools up for this. You'll also want to add the path which <Literal>make</Literal> will
246 now echo to your <Literal>PATH</Literal> environment variable. This option is useful if
247 you simply want to try out the package and/or you don't have the
248 necessary privileges (or inclination) to properly install the tools
249 locally. Note that if you do decide to install the package `properly'
250 at a later date, you have to go through the installation steps that
251 follows.
252 </Para>
253
254 <Para>
255 To install an <Literal>fptools</Literal> package, you'll have to do the following:
256 </Para>
257
258 <Para>
259
260 <OrderedList>
261 <ListItem>
262
263 <Para>
264  Edit the <Literal>Makefile</Literal> and check the settings of the following variables:
265
266 <IndexTerm><Primary>directories, installation</Primary></IndexTerm>
267 <IndexTerm><Primary>installation directories</Primary></IndexTerm>
268
269 <VariableList>
270
271 <VarListEntry>
272 <Term><Literal>platform</Literal></Term>
273 <ListItem>
274 <Para>
275 the platform you are going to install for.
276 </Para>
277 </ListItem></VarListEntry>
278 <VarListEntry>
279 <Term><Literal>bindir</Literal></Term>
280 <ListItem>
281 <Para>
282 the directory in which to install user-invokable
283 binaries.
284 </Para>
285 </ListItem></VarListEntry>
286 <VarListEntry>
287 <Term><Literal>libdir</Literal></Term>
288 <ListItem>
289 <Para>
290 the directory in which to install
291 platform-dependent support files.
292 </Para>
293 </ListItem></VarListEntry>
294 <VarListEntry>
295 <Term><Literal>datadir</Literal></Term>
296 <ListItem>
297 <Para>
298 the directory in which to install
299 platform-independent support files.
300 </Para>
301 </ListItem></VarListEntry>
302 <VarListEntry>
303 <Term><Literal>infodir</Literal></Term>
304 <ListItem>
305 <Para>
306 the directory in which to install Emacs info
307 files.
308 </Para>
309 </ListItem></VarListEntry>
310 <VarListEntry>
311 <Term><Literal>htmldir</Literal></Term>
312 <ListItem>
313 <Para>
314 the directory in which to install HTML
315 documentation.
316 </Para>
317 </ListItem></VarListEntry>
318 <VarListEntry>
319 <Term><Literal>dvidir</Literal></Term>
320 <ListItem>
321 <Para>
322 the directory in which to install DVI
323 documentation.
324 </Para>
325 </ListItem></VarListEntry>
326 </VariableList>
327
328 The values for these variables can be set through invocation of the
329 <Command>configure</Command><IndexTerm><Primary>configure</Primary></IndexTerm>
330 script that comes with the distribution, but doing an optical diff to
331 see if the values match your expectations is always a Good Idea.
332 </para>
333
334 <para>
335 <Emphasis>Instead of running <Command>configure</Command>, it is
336 perfectly OK to copy <Filename>Makefile.in</Filename> to
337 <Filename>Makefile</Filename> and set all these variables directly
338 yourself.  But do it right!</Emphasis>
339 </Para>
340
341 </ListItem>
342 <ListItem>
343
344 <Para>
345 Run <Literal>make install</Literal>.  This <Emphasis>
346 should</Emphasis> work with ordinary Unix
347 <Literal>make</Literal>&mdash;no need for fancy stuff like GNU
348 <Literal>make</Literal>.
349
350 </Para>
351 </ListItem>
352 <ListItem>
353
354 <Para>
355 <Literal>rehash</Literal> (t?csh or zsh users), so your shell will see the new
356 stuff in your bin directory.
357
358 </Para>
359 </ListItem>
360 <ListItem>
361
362 <Para>
363  Once done, test your &ldquo;installation&rdquo; as suggested in 
364 <XRef LinkEnd="sec-GHC-test">.  Be sure to use a <Literal>-v</Literal>
365 option, so you can see exactly what pathnames it's using.
366
367 If things don't work as expected, check the list of known pitfalls in
368 the building guide.
369 </Para>
370 </ListItem>
371
372 </OrderedList>
373
374 </Para>
375
376 <Para>
377 <IndexTerm><Primary>link, installed as ghc</Primary></IndexTerm>
378 When installing the user-invokable binaries, this installation
379 procedure will install GHC as <Literal>ghc-x.xx</Literal> where <Literal>x.xx</Literal> is the version
380 number of GHC.  It will also make a link (in the binary installation
381 directory) from <Literal>ghc</Literal> to <Literal>ghc-x.xx</Literal>.  If you install multiple versions
382 of GHC then the last one &ldquo;wins&rdquo;, and &ldquo;<Literal>ghc</Literal>&rdquo; will invoke the last
383 one installed.  You can change this manually if you want.  But
384 regardless, <Literal>ghc-x.xx</Literal> should always invoke GHC version <Literal>x.xx</Literal>.
385 </Para>
386
387 </Sect3>
388
389
390 <Sect3>
391 <Title>What bundles there are</Title>
392
393 <Para>
394 <IndexTerm><Primary>bundles, binary</Primary></IndexTerm> There are
395 plenty of &ldquo;non-basic&rdquo; GHC bundles.  The files for them are
396 called
397 <Literal>ghc-x.xx-<replaceable>bundle</replaceable>-<replaceable>platform</replaceable>.tar.gz</Literal>,
398 where the <replaceable>platform</replaceable> is as above, and
399 <replaceable>bundle</replaceable> is one of these:
400 </Para>
401
402 <Para>
403 <VariableList>
404
405 <VarListEntry>
406 <Term><Literal>prof</Literal>:</Term>
407 <ListItem>
408 <Para>
409 Profiling with cost-centres.  You probably want this.
410 <IndexTerm><Primary>profiling bundles</Primary></IndexTerm>
411 <IndexTerm><Primary>bundles, profiling</Primary></IndexTerm>
412 </Para>
413 </ListItem></VarListEntry>
414 <VarListEntry>
415 <Term><Literal>par</Literal>:</Term>
416 <ListItem>
417 <Para>
418 Parallel Haskell features (sits on top of PVM).
419 You'll want this if you're into that kind of thing.
420 <IndexTerm><Primary>parallel bundles</Primary></IndexTerm>
421 <IndexTerm><Primary>bundles, parallel</Primary></IndexTerm>
422 </Para>
423 </ListItem></VarListEntry>
424 <VarListEntry>
425 <Term><Literal>gran</Literal>:</Term>
426 <ListItem>
427 <Para>
428 The &ldquo;GranSim&rdquo; parallel-Haskell simulator
429 (hmm&hellip; mainly for implementors).
430 <IndexTerm><Primary>bundles, gransim</Primary></IndexTerm>
431 <IndexTerm><Primary>gransim bundles</Primary></IndexTerm>
432 </Para>
433 </ListItem></VarListEntry>
434 <VarListEntry>
435 <Term><Literal>ticky</Literal>:</Term>
436 <ListItem>
437 <Para>
438 &ldquo;Ticky-ticky&rdquo; profiling; very detailed
439 information about &ldquo;what happened when I ran this program&rdquo;&mdash;really
440 for implementors.
441 <IndexTerm><Primary>bundles, ticky-ticky</Primary></IndexTerm>
442 <IndexTerm><Primary>ticky-ticky bundles</Primary></IndexTerm>
443 </Para>
444 </ListItem></VarListEntry>
445 </VariableList>
446 </Para>
447
448 <Para>
449 One likely scenario is that you will grab <Emphasis>two</Emphasis>
450 binary bundles&mdash;basic, and profiling.  We don't usually make the
451 rest, although you can build them yourself from a source distribution.
452 </Para>
453
454 <para>The various GHC bundles are designed to be unpacked into the
455 same directory; then installing as per the directions above will
456 install the whole lot in one go.  Note: you <emphasis>must</emphasis>
457 at least have the basic GHC binary distribution bundle, these extra
458 bundles won't install on their own.</para>
459
460 </Sect3>
461
462 <Sect3 id="sec-GHC-test">
463 <Title>Testing that GHC seems to be working
464 </Title>
465
466 <Para>
467 <IndexTerm><Primary>testing a new GHC</Primary></IndexTerm>
468 </Para>
469
470 <Para>
471 The way to do this is, of course, to compile and run <Emphasis>this</Emphasis> program
472 (in a file <Literal>Main.hs</Literal>):
473 </Para>
474
475 <Para>
476
477 <ProgramListing>
478 main = putStr "Hello, world!\n"
479 </ProgramListing>
480
481 </Para>
482
483 <Para>
484 Compile the program, using the <Literal>-v</Literal> (verbose) flag to verify that
485 libraries, etc., are being found properly:
486
487 <Screen>
488 % ghc -v -o hello Main.hs</Screen>
489
490 </Para>
491
492 <Para>
493 Now run it:
494
495 <Screen>
496 % ./hello
497 Hello, world!</Screen>
498
499 </Para>
500
501 <Para>
502 Some simple-but-profitable tests are to compile and run the notorious
503 <Literal>nfib</Literal><IndexTerm><Primary>nfib</Primary></IndexTerm> program, using different numeric types.  Start with
504 <Literal>nfib :: Int -&gt; Int</Literal>, and then try <Literal>Integer</Literal>, <Literal>Float</Literal>, <Literal>Double</Literal>,
505 <Literal>Rational</Literal> and perhaps the overloaded version.  Code for this is
506 distributed in <Literal>ghc/misc/examples/nfib/</Literal> in a source distribution.
507 </Para>
508
509 <para>For more information on how to &ldquo;drive&rdquo; GHC, read
510 on...</para>
511
512 </Sect3>
513
514 </Sect2>
515
516 </Sect1>
517
518
519 <Sect1 id="sec-install-windows"><Title>Installing on Windows</Title>
520
521 <Para>
522 Getting the Glasgow Haskell Compiler (GHC) to run on Windows platforms can
523 be a bit of a trying experience. It should be much easier now than in the
524 past, since all the software required to build and use GHC is included in
525 the InstallShield.
526 </Para>
527
528 <Para>
529 An installation of GHC requires about 70M of disk space (which can be
530 reduced by choosing a &ldquo;compact&rdquo; installation).
531 To run GHC comfortably, your machine should have at least
532 64M of memory.
533 </Para>
534
535
536 <Sect2><Title>Installing GHC</Title>
537
538 <Para>
539 Download the latest GHC distribution (ghc-4.08 InstallShield installer, 19M)
540 from <ULink
541 URL="http://www.haskell.org/ghc/download.html">haskell.org</ULink>
542 It is packaged up using an installer that should be familiar-looking to
543 Windows users.
544 </Para>
545
546 <Para>
547 Note: The Cygwin support for long file names containing
548 spaces is not 100%, so make sure that you install ghc in a directory
549 that has no embedded spaces (i.e., resist the temptation to put it
550 in <Filename>/Program Files/</Filename>!)
551 </Para>
552
553 <Para>
554 When the installer has completed, make sure you add the location of the
555 ghc <Filename>bin/</Filename> directory to your path (e.g.
556 <Filename>/ghc/ghc-4.08/bin </Filename>).
557 You need to do this in order to bring the various GHC binaries into scope.
558 Also, if the directory <Filename>C:/TEMP</Filename> doesn't already exist,
559 you should create it.
560 </Para>
561
562 <Para>
563 To test the fruits of your labour, try now to compile a simple
564 Haskell program:
565 </Para>
566
567 <Screen>
568 bash$ cat main.hs
569 module Main(main) where
570
571 main = putStrLn "Hello, world!"
572 bash$ ghc -o main main.hs
573 ..
574 bash$ ./main
575 Hello, world!
576 bash$ </Screen>
577
578 <Para>
579 OK, assuming that worked, you're all set. Go forth and write useful
580 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">).
581 </Para>
582
583 <Para>
584 Further information on using GHC under Windows can be found in <ULink
585 URL="http://www.dcs.gla.ac.uk/~sof/ghc-win32.html">Sigbj&oslash;rn Finne's
586 pages</ULink>. Note: ignore the installation instructions, which are rather
587 out of date; the <Emphasis>Miscellaneous</Emphasis> section at the bottom of
588 the page is of most interest, covering topics beyond the scope of this
589 manual.
590 </Para>
591
592 </Sect2>
593
594
595 <Sect2 id="winfaq"><title>Installing ghc-win32 FAQ</title>
596
597 <QandASet>
598
599 <QandAEntry>
600
601 <Question>
602 <Para>
603 I'm having trouble with symlinks.
604 </Para>
605 </Question>
606
607 <Answer>
608 <Para>
609 Symlinks only work under Cygwin (<Xref LinkEnd="sec-install">), so binaries
610 not linked to the Cygwin DLL, in particular those built for Mingwin, will not
611 work with symlinks.
612 </Para>
613 </Answer>
614
615 </QandAEntry>
616
617 <QandAEntry>
618
619 <Question>
620 <Para>
621 I'm getting &ldquo;permission denied&rdquo; messages from <Command>rm</Command> or
622 <Command>mv</Command>.
623 </Para>
624 </Question>
625
626 <Answer>
627 <Para>
628 This can have various causes: trying to rename a directory when an Explorer
629 window is open on it tends to fail. Closing the window generally cures the
630 problem, but sometimes its cause is more mysterious, and logging off and back
631 on or rebooting may be the quickest cure.
632 </Para>
633 </Answer>
634
635 </QandAEntry>
636
637 <QandAEntry>
638
639 <Question>
640 <Para>
641 I get errors when trying to build GHC 4.08 with GHC 4.05.
642 </Para>
643 </Question>
644
645 <Answer> <Para> This seems to work better if you don't use
646 <Option>-O</Option> in <Constant>GhcHcOpts</Constant>. It's a bug in 4.05,
647 unfortunately. Anyway, better to install 4.08 binaries and use those.
648 </Para> </Answer>
649
650 </QandAEntry>
651
652 </QandASet>
653
654 </Sect2>
655
656 </Sect1>
657
658
659 <Sect1 id="building-docs">
660 <Title>Building the documentation</Title>
661
662 <Para>
663 We use the DocBook DTD, which is widely used. Most shrink-wrapped
664 distributions seem to be broken in one way or another; thanks to
665 heroic efforts by Sven Panne and Manuel Chakravarty, we now support
666 most of them, plus properly installed versions.
667 </Para>
668
669 <Para>
670 Instructions on installing and configuring the DocBook tools follow.
671 </Para>
672
673 <Sect2>
674 <Title>Installing the DocBook tools from RPMs</Title>
675
676 <Para> If you're using a system that can handle RedHat RPM packages,
677 you can probably use the <ULink
678 URL="http://sourceware.cygnus.com/docbook-tools/">Cygnus DocBook
679 tools</ULink>, which is the most shrink-wrapped SGML suite that we
680 could find. You need all the RPMs except for psgml (i.e.
681 <Filename>docbook</Filename>, <Filename>jade</Filename>,
682 <Filename>jadetex</Filename>, <Filename>sgmlcommon</Filename> and
683 <Filename>stylesheets</Filename>). Note that most of these RPMs are
684 architecture neutral, so are likely to be found in a
685 <Filename>noarch</Filename> directory. The SuSE RPMs also work; the
686 RedHat ones <Emphasis>don't</Emphasis> in RedHat 6.2 (7.0 and later
687 should be OK), but they are easy to fix: just make a symlink from
688 <Filename>/usr/lib/sgml/stylesheets/nwalsh-modular/lib/dblib.dsl</Filename>
689 to <Filename>/usr/lib/sgml/lib/dblib.dsl</Filename>. </Para>
690
691 </Sect2>
692
693     <sect2>
694       <title>Installing DocBook on FreeBSD</title>
695
696       <para>On FreeBSD systems, the easiest way to get DocBook up and
697       running is to install it from the ports tree or a pre-compiled
698       package (packages are available from your local FreeBSD mirror
699       site).</para>
700
701       <para>To use the ports tree, do this:
702 <screen>
703       $ cd /usr/ports/textproc/docproj
704       $ make install
705 </screen>
706       This installs the FreeBSD documentation project tools, which
707       includes everything needed to format the GHC
708       documentation.</para>
709     </sect2>
710
711 <Sect2>
712 <Title>Installing from binaries on Windows</Title>
713
714 <Para>
715 It's a good idea to use Norman Walsh's <ULink
716 URL="http://nwalsh.com/docbook/dsssl/doc/install.html">installation
717 notes</ULink> as a guide. You should get version 3.1 of DocBook, and note
718 that his file <Filename>test.sgm</Filename> won't work, as it needs version
719 3.0. You should unpack Jade into <Filename>\Jade</Filename>, along with the
720 entities, DocBook into <Filename>\docbook</Filename>, and the DocBook
721 stylesheets into <Filename>\docbook\stylesheets</Filename> (so they actually
722 end up in <Filename>\docbook\stylesheets\docbook</Filename>).
723 </Para>
724
725 </Sect2>
726
727
728 <Sect2>
729 <Title>Installing the DocBook tools from source</Title>
730
731 <Sect3>
732 <Title>Jade</Title>
733
734 <Para>
735 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>
736 subdirectory. (If you get the error:
737
738 <Screen>
739 ! LaTeX Error: Unknown option implicit=false' for package hyperref'.
740 </Screen>
741
742 your version of <Command>hyperref</Command> is out of date; download it from
743 CTAN (<Filename>macros/latex/contrib/supported/hyperref</Filename>), and
744 make it, ensuring that you have first removed or renamed your old copy. If
745 you start getting file not found errors when making the test for
746 <Command>hyperref</Command>, you can abort at that point and proceed
747 straight to <Command>make install</Command>, or enter them as
748 <Filename>../</Filename><Emphasis>filename</Emphasis>.)
749 </Para>
750
751 <Para>
752 Make links from <Filename>virtex</Filename> to <Filename>jadetex</Filename>
753 and <Filename>pdfvirtex</Filename> to <Filename>pdfjadetex</Filename>
754 (otherwise DVI, PostScript and PDF output will not work). Copy
755 <Filename>dsssl/*.{dtd,dsl}</Filename> and <Filename>catalog</Filename> to <Filename>/usr/[local/]lib/sgml</Filename>.
756 </Para>
757
758 </Sect3>
759
760 <Sect3>
761 <Title>DocBook and the DocBook stylesheets</Title>
762
763 <Para>
764 Get a Zip of <ULink
765 URL="http://www.oasis-open.org/docbook/sgml/3.1/index.html">DocBook</ULink> 
766 and install the contents in <Filename>/usr/[local/]/lib/sgml</Filename>.
767 </Para>
768
769 <Para>
770 Get the <ULink URL="http://nwalsh.com/docbook/dsssl/">DocBook
771 stylesheets</ULink> and install in
772 <Filename>/usr/[local/]lib/sgml/stylesheets</Filename> (thereby creating a
773 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>.
774 </Para>
775
776 <Para>
777 Download the <ULink
778 URL="http://www.oasis-open.org/cover/ISOEnts.zip">ISO
779 entities</ULink> into <Filename>/usr/[local/]lib/sgml</Filename>.
780 </Para>
781
782 </Sect3>
783
784 </Sect2>
785
786 <Sect2>
787 <Title>Configuring the DocBook tools</Title>
788
789 <Para>
790 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.
791 </Para>
792
793 </Sect2>
794
795 <Sect2>
796 <Title>Remaining problems</Title>
797
798 <Para>
799 If you install from source, you'll get a pile of warnings of the form
800
801 <Screen>DTDDECL catalog entries are not supported</Screen>
802
803 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>.
804 </Para>
805
806 </Sect2>
807
808 </Sect1>
809
810 </Chapter>
811
812 <!-- Emacs stuff:
813      ;;; Local Variables: ***
814      ;;; mode: sgml ***
815      ;;; sgml-parent-document: ("users_guide.sgml" "book" "chapter") ***
816      ;;; End: ***
817  -->