[project @ 2001-07-16 11:29:22 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. The 4.08 InstallShield package comes with some Cygwin
544 binaries, which unfortunately won't work with another Cygwin installation on
545 the same machine, unless it uses exactly the same version of the Cygwin DLL
546 (1.3.1 in this InstallShield).
547 </Para>
548
549 <Para>
550 Note: The Cygwin support for long file names containing
551 spaces is not 100%, so make sure that you install ghc in a directory
552 that has no embedded spaces (i.e., resist the temptation to put it
553 in <Filename>/Program Files/</Filename>!)
554 </Para>
555
556 <Para>
557 When the installer has completed, make sure you add the location of the
558 ghc <Filename>bin/</Filename> directory to your path (e.g.
559 <Filename>/ghc/ghc-4.08/bin</Filename>).
560 You need to do this in order to bring the various GHC binaries into scope.
561 Also, if the directory <Filename>C:/TEMP</Filename> doesn't already exist,
562 you should create it.
563 </Para>
564
565 <Para>
566 To test the fruits of your labour, try now to compile a simple
567 Haskell program:
568 </Para>
569
570 <Screen>
571 bash$ cat main.hs
572 module Main(main) where
573
574 main = putStrLn "Hello, world!"
575 bash$ ghc -o main main.hs
576 ..
577 bash$ ./main
578 Hello, world!
579 bash$ </Screen>
580
581 <Para>
582 OK, assuming that worked, you're all set. Go forth and write useful
583 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">).
584 </Para>
585
586 <Para>
587 Further information on using GHC under Windows can be found in <ULink
588 URL="http://www.dcs.gla.ac.uk/~sof/ghc-win32.html">Sigbj&oslash;rn Finne's
589 pages</ULink>. Note: ignore the installation instructions, which are rather
590 out of date; the <Emphasis>Miscellaneous</Emphasis> section at the bottom of
591 the page is of most interest, covering topics beyond the scope of this
592 manual.
593 </Para>
594
595 </Sect2>
596
597
598 <Sect2 id="winfaq"><title>Installing ghc-win32 FAQ</title>
599
600 <QandASet>
601
602 <QandAEntry>
603
604 <Question>
605 <Para>
606 I'm having trouble with symlinks.
607 </Para>
608 </Question>
609
610 <Answer>
611 <Para>
612 Symlinks only work under Cygwin (<Xref LinkEnd="sec-install">), so binaries
613 not linked to the Cygwin DLL, in particular those built for Mingwin, will not
614 work with symlinks.
615 </Para>
616 </Answer>
617
618 </QandAEntry>
619
620 <QandAEntry>
621
622 <Question>
623 <Para>
624 I'm getting &ldquo;permission denied&rdquo; messages from <Command>rm</Command> or
625 <Command>mv</Command>.
626 </Para>
627 </Question>
628
629 <Answer>
630 <Para>
631 This can have various causes: trying to rename a directory when an Explorer
632 window is open on it tends to fail. Closing the window generally cures the
633 problem, but sometimes its cause is more mysterious, and logging off and back
634 on or rebooting may be the quickest cure.
635 </Para>
636 </Answer>
637
638 </QandAEntry>
639
640 <QandAEntry>
641
642 <Question>
643 <Para>
644 I get errors when trying to build GHC 4.08 with GHC 4.05.
645 </Para>
646 </Question>
647
648 <Answer> <Para> This seems to work better if you don't use
649 <Option>-O</Option> in <Constant>GhcHcOpts</Constant>. It's a bug in 4.05,
650 unfortunately. Anyway, better to install 4.08 binaries and use those.
651 </Para> </Answer>
652
653 </QandAEntry>
654
655 </QandASet>
656
657 </Sect2>
658
659 </Sect1>
660
661
662 <Sect1 id="building-docs">
663 <Title>Building the documentation</Title>
664
665 <Para>
666 We use the DocBook DTD, which is widely used. Most shrink-wrapped
667 distributions seem to be broken in one way or another; thanks to
668 heroic efforts by Sven Panne and Manuel Chakravarty, we now support
669 most of them, plus properly installed versions.
670 </Para>
671
672 <Para>
673 Instructions on installing and configuring the DocBook tools follow.
674 </Para>
675
676 <Sect2>
677 <Title>Installing the DocBook tools from RPMs</Title>
678
679 <Para> If you're using a system that can handle RedHat RPM packages,
680 you can probably use the <ULink
681 URL="http://sourceware.cygnus.com/docbook-tools/">Cygnus DocBook
682 tools</ULink>, which is the most shrink-wrapped SGML suite that we
683 could find. You need all the RPMs except for psgml (i.e.
684 <Filename>docbook</Filename>, <Filename>jade</Filename>,
685 <Filename>jadetex</Filename>, <Filename>sgmlcommon</Filename> and
686 <Filename>stylesheets</Filename>). Note that most of these RPMs are
687 architecture neutral, so are likely to be found in a
688 <Filename>noarch</Filename> directory. The SuSE RPMs also work; the
689 RedHat ones <Emphasis>don't</Emphasis> in RedHat 6.2 (7.0 and later
690 should be OK), but they are easy to fix: just make a symlink from
691 <Filename>/usr/lib/sgml/stylesheets/nwalsh-modular/lib/dblib.dsl</Filename>
692 to <Filename>/usr/lib/sgml/lib/dblib.dsl</Filename>. </Para>
693
694 </Sect2>
695
696     <sect2>
697       <title>Installing DocBook on FreeBSD</title>
698
699       <para>On FreeBSD systems, the easiest way to get DocBook up and
700       running is to install it from the ports tree or a pre-compiled
701       package (packages are available from your local FreeBSD mirror
702       site).</para>
703
704       <para>To use the ports tree, do this:
705 <screen>
706       $ cd /usr/ports/textproc/docproj
707       $ make install
708 </screen>
709       This installs the FreeBSD documentation project tools, which
710       includes everything needed to format the GHC
711       documentation.</para>
712     </sect2>
713
714 <Sect2>
715 <Title>Installing from binaries on Windows</Title>
716
717 <Para>
718 It's a good idea to use Norman Walsh's <ULink
719 URL="http://nwalsh.com/docbook/dsssl/doc/install.html">installation
720 notes</ULink> as a guide. You should get version 3.1 of DocBook, and note
721 that his file <Filename>test.sgm</Filename> won't work, as it needs version
722 3.0. You should unpack Jade into <Filename>\Jade</Filename>, along with the
723 entities, DocBook into <Filename>\docbook</Filename>, and the DocBook
724 stylesheets into <Filename>\docbook\stylesheets</Filename> (so they actually
725 end up in <Filename>\docbook\stylesheets\docbook</Filename>).
726 </Para>
727
728 </Sect2>
729
730
731 <Sect2>
732 <Title>Installing the DocBook tools from source</Title>
733
734 <Sect3>
735 <Title>Jade</Title>
736
737 <Para>
738 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>
739 subdirectory. (If you get the error:
740
741 <Screen>
742 ! LaTeX Error: Unknown option implicit=false' for package hyperref'.
743 </Screen>
744
745 your version of <Command>hyperref</Command> is out of date; download it from
746 CTAN (<Filename>macros/latex/contrib/supported/hyperref</Filename>), and
747 make it, ensuring that you have first removed or renamed your old copy. If
748 you start getting file not found errors when making the test for
749 <Command>hyperref</Command>, you can abort at that point and proceed
750 straight to <Command>make install</Command>, or enter them as
751 <Filename>../</Filename><Emphasis>filename</Emphasis>.)
752 </Para>
753
754 <Para>
755 Make links from <Filename>virtex</Filename> to <Filename>jadetex</Filename>
756 and <Filename>pdfvirtex</Filename> to <Filename>pdfjadetex</Filename>
757 (otherwise DVI, PostScript and PDF output will not work). Copy
758 <Filename>dsssl/*.{dtd,dsl}</Filename> and <Filename>catalog</Filename> to <Filename>/usr/[local/]lib/sgml</Filename>.
759 </Para>
760
761 </Sect3>
762
763 <Sect3>
764 <Title>DocBook and the DocBook stylesheets</Title>
765
766 <Para>
767 Get a Zip of <ULink
768 URL="http://www.oasis-open.org/docbook/sgml/3.1/index.html">DocBook</ULink> 
769 and install the contents in <Filename>/usr/[local/]/lib/sgml</Filename>.
770 </Para>
771
772 <Para>
773 Get the <ULink URL="http://nwalsh.com/docbook/dsssl/">DocBook
774 stylesheets</ULink> and install in
775 <Filename>/usr/[local/]lib/sgml/stylesheets</Filename> (thereby creating a
776 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>.
777 </Para>
778
779 <Para>
780 Download the <ULink
781 URL="http://www.oasis-open.org/cover/ISOEnts.zip">ISO
782 entities</ULink> into <Filename>/usr/[local/]lib/sgml</Filename>.
783 </Para>
784
785 </Sect3>
786
787 </Sect2>
788
789 <Sect2>
790 <Title>Configuring the DocBook tools</Title>
791
792 <Para>
793 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.
794 </Para>
795
796 </Sect2>
797
798 <Sect2>
799 <Title>Remaining problems</Title>
800
801 <Para>
802 If you install from source, you'll get a pile of warnings of the form
803
804 <Screen>DTDDECL catalog entries are not supported</Screen>
805
806 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>.
807 </Para>
808
809 </Sect2>
810
811 </Sect1>
812
813 </Chapter>
814
815 <!-- Emacs stuff:
816      ;;; Local Variables: ***
817      ;;; mode: sgml ***
818      ;;; sgml-parent-document: ("users_guide.sgml" "book" "chapter") ***
819      ;;; End: ***
820  -->