]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/install.itely
Thinko: document Metapost requirement
[lilypond.git] / Documentation / user / install.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond-program.tely
3 @ignore
4     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5
6     When revising a translation, copy the HEAD committish of the
7     version that you are working on.  See TRANSLATION for details.
8 @end ignore
9
10 @c \version "2.11.51"
11
12 @ifclear INSTALL
13 @node Install
14 @chapter Install
15 @end ifclear
16
17 There are two sets of releases for LilyPond: stable releases, and
18 unstable development releases.  Stable versions have an even-numbered
19 @q{minor} version number (i.e. 2.8, 2.10, 2.12, etc).  Development
20 versions have an odd-numbered @q{minor} version number (i.e. 2.7, 2.9,
21 2.11, etc).
22
23 Building LilyPond is a very involved process, so we @strong{highly}
24 recommend using the precompiled binaries.
25
26 @menu
27 * Precompiled binaries::        
28 * Compiling from source::       
29 @end menu
30
31
32 @node Precompiled binaries
33 @section Precompiled binaries
34
35 @unnumberedsubsec Downloading
36
37 Check out @uref{http://lilypond.org/web/install/} for up to date
38 information on binary packages for your platform.  If your operating
39 system is not covered on that general page, please see the complete list
40 at @uref{http://download.linuxaudio.org/lilypond/binaries/}
41
42 We currently create binaries for
43
44 @example
45 darwin-ppc  - MacOS X powerpc
46 darwin-x86  - MacOS X intel
47 freebsd-64  - FreeBSD 6.x, x86_64
48 freebsd-x86 - FreeBSD 4.x, x86
49 linux-64    - Any GNU/Linux distribution, x86_64
50 linux-arm   - Any GNU/Linux distribution, arm
51 linux-ppc   - Any GNU/Linux distribution, powerpc
52 linux-x86   - Any GNU/Linux distribution, x86
53 mingw       - Windows x86
54 @end example
55
56
57 @c TRANSLATORS:
58 @c   Please **do not** translate anything below this line.  Users
59 @c   should not be compiling LilyPond themselves; if they really 
60 @c   want to do so, they should be able to read the English docs,
61 @c   because they'll probably need to ask questions in English
62 @c   on the -devel list.   -gp
63
64 @node Compiling from source
65 @section Compiling from source
66
67 @menu
68 * Downloading source code::     
69 * Requirements::                
70 * Building LilyPond::           
71 * Building documentation::      
72 * Testing LilyPond::            
73 * Problems::                    
74 @end menu
75
76 @node Downloading source code
77 @subsection Downloading source code
78
79 Download source
80
81 @itemize
82 @item tarballs from
83 @uref{http://lilypond.org/download/} by HTTP.
84 @item tarballs from
85 @uref{http://download.linuxaudio.org/lilypond/} by HTTP.
86 @item 
87 GIT from @uref{http://git.sv.gnu.org/gitweb/?p=lilypond.git;a=summary,git.sv.gnu.org}
88
89 @example
90 git clone git://git.sv.gnu.org/lilypond.git
91 @end example
92
93 The repository does not contain generated files.  To create
94 @file{configure}, run
95 @example
96 ./autogen.sh
97 @end example
98 @end itemize
99
100 For information on packaging, see @uref{http://lilypond.org/devel}.
101
102
103 @node Requirements
104 @subsection Requirements
105
106 @unnumberedsubsubsec Compilation
107
108 In addition to the packages needed for running LilyPond (see below), you
109 need the following extra packages for building.
110
111 When installing a binary package FOO, you may need to install the
112 FOO-devel, libFOO-dev or FOO-dev package too.
113
114 @itemize
115
116 @item @uref{http://fontforge.sf.net/,FontForge} 20060125 or newer.
117
118 @item MetaFont (mf-nowin, mf, mfw or mfont binaries) and MetaPost
119 (mpost binary), usually packaged with a @LaTeX{} distribution like
120 tetex or texlive.
121
122 @item @uref{http://www.lcdf.org/~eddietwo/type/#t1utils,t1utils}
123 (version 1.33 or newer recommended).
124
125 @item New Century Schoolbook fonts, as PFB files.  These are shipped with
126 X11 and Ghostscript, and are named @file{c059033l.pfb}
127 @file{c059036l.pfb}, @file{c059013l.pfb} and @file{c059016l.pfb}.
128
129 @item @uref{http://www.gnu.org/software/guile/guile.html,GUILE} (version
130 1.8.2 or newer).  If you are installing binary packages, you may need to
131 install guile-devel or guile-dev or libguile-dev too.
132
133 @item @uref{ftp://ftp.gnu.org/gnu/texinfo/,Texinfo} (version 4.11 or newer).
134
135 @item @uref{http://gcc.gnu.org/, The GNU c++ compiler} (version 3.4 or
136 newer.  4.x is strongly recommended).
137
138 @item @uref{http://www.python.org,Python} (version 2.4 or newer)
139
140 @item @uref{ftp://ftp.gnu.org/gnu/make/,GNU Make} (version 3.78 or newer).
141
142 @item @uref{http://www.gnu.org/software/gettext/gettext.html,gettext}.
143
144 @item @uref{http://www.gnu.org/software/flex/,Flex}.
145
146 @item @uref{http://www.perl.org/,Perl}.
147
148 @item @uref{http://www.gnu.org/software/flex/,GNU Bison}.
149
150 @item All packages required for running, including development packages with
151 header files and libraries.
152
153 @end itemize
154
155
156 @unnumberedsubsubsec Running requirements
157
158 Running LilyPond requires proper installation of the following software
159
160 @itemize
161
162 @item @uref{http://www.freetype.org/,Freetype} (version 2.1.10 or newer).
163 @item @uref{http://www.freetype.org/,FontConfig} (version 2.2).
164 @item @uref{http://www.pango.org/,Pango} (version 1.12 or newer).
165 @item @uref{http://www.gnu.org/software/guile/guile.html,GUILE}
166 (version 1.8.2 or newer), or patch 1.8.1 with
167 @uref{http://lilypond.org/vc/gub.darcs/patches/guile-1.8-rational.patch}.
168 @item @uref{http://www.python.org,Python} (version 2.4 or newer).
169 @item @uref{http://www.ghostscript.com,Ghostscript} (version 8.15 or
170 newer. 8.50 recommended)
171 @item Dejaview.  (This is normally installed by default)
172 @end itemize
173
174 International fonts are required to create music with international text
175 or lyrics.
176
177
178 @unnumberedsubsubsec Requirements for building documentation
179
180 You can view the documentation online at
181 @uref{http://lilypond.org/doc/}, but you can also build it locally.
182 This process requires a successful compile of LilyPond, and some
183 additional tools and packages
184
185 @itemize
186 @item The @uref{http://netpbm.sourceforge.net/,netpbm utilities}
187 @item ImageMagick
188 @item International fonts (see input/regression/utf-8.ly for hints
189 about which font packages are necessary for your platform)
190 @item Ghostscript, 8.50 with the patch from
191 @uref{http://bugs.ghostscript.com/show_bug.cgi?id=688154}
192 and the patch from
193 @uref{http://bugs.ghostscript.com/show_bug.cgi?id=688017}, or use
194 a release of Ghostscript which includes these patches, for example
195 8.60 or newer.
196 @end itemize
197
198
199 @node Building LilyPond
200 @subsection Building LilyPond
201
202 @unnumberedsubsubsec Compiling
203
204 To install GNU LilyPond, type
205
206 @example
207 gunzip -c lilypond-x.y.z | tar xf -
208 cd lilypond-x.y.z
209 ./configure             # run with --help for applicable options
210 make
211 su -c 'make install'
212 @end example
213
214 @noindent
215 If you are not root, you should choose a @code{--prefix} argument that
216 points into your home directory, e.g.
217
218 @example
219 ./configure --prefix=$HOME/usr
220 @end example
221
222
223 @unnumberedsubsubsec Compiling for multiple platforms
224
225 If you want to build multiple versions of LilyPond with different
226 configuration settings, you can use the @code{--enable-config=CONF}
227 option of @command{configure}.  You should use @code{make conf=CONF}
228 to generate the output in @file{out-CONF}.  For example, suppose you
229 want to build with and without profiling, then use the following for
230 the normal build
231
232 @example
233 ./configure --prefix=$HOME/usr/ --enable-checking
234 make
235 make install
236 @end example
237
238 and for the profiling version, specify a different configuration
239
240 @example
241 ./configure --prefix=$HOME/usr/ --enable-profiling --enable-config=prof --disable-checking
242 make conf=prof
243 make conf=prof install
244 @end example
245
246
247 @unnumberedsubsubsec Compiling outside the source tree
248
249 It is possible to compile LilyPond in a build tree different from the
250 source tree, with @code{--srcdir} option of @command{configure}:
251
252 @example
253 mkdir lily-build && cd lily-build
254 @var{sourcedir}/configure --srcdir=@var{sourcedir}
255
256 @end example
257
258
259 @unnumberedsubsubsec Useful @command{make} variables
260
261 If a less verbose build output if desired, the variable
262 @code{QUIET_BUILD} may be set to @code{1} on @command{make} command
263 line, or in @file{local.make} at top of the build tree.
264
265
266 @node Building documentation
267 @subsection Building documentation
268
269 This requires a successful compile of LilyPond, or using an external
270 LilyPond binary.
271
272 @menu
273 * Commands for building documentation:: Compiling and installing the documentation.
274 * Building documentation without compiling LilyPond:: Using a LilyPond binary already installed.
275 @end menu
276
277 @node Commands for building documentation
278 @unnumberedsubsubsec Commands for building documentation
279
280 The documentation is built by issuing
281
282 @example
283 make web
284 @end example
285
286 After compilation, the HTML documentation tree is available in
287 @file{out-www/offline-root/}, and can be browsed locally.
288
289 The HTML and PDF files can be installed into the standard documentation
290 path by issuing
291
292 @example
293 make web-install
294 @end example
295
296 @noindent
297 This also installs Info documentation with images if the installation
298 prefix is properly set; otherwise, instructions for manual installation
299 of Info documentation are printed on standard output.
300
301 It is also possible to build a documentation tree in
302 @file{out-www/online-root/}, with special processing, so it can be used
303 on a website with content negotiation for automatic language selection;
304 this can be achieved by issuing
305
306 @example
307 make WEB_TARGETS=online web
308 @end example
309
310 @noindent
311 and both @q{offline} and @q{online} targets can be generated by issuing
312
313 @example
314 make WEB_TARGETS="offline online" web
315 @end example
316
317 Several targets are available to clean the documentation build and
318 help with maintaining documentation; an overview of these targets is
319 available with
320
321 @example
322 make help
323 @end example
324
325 @noindent
326 from every directory in the build tree.  Most targets for
327 documentation maintenance are available from @file{Documentation/};
328 for more information, see @file{Documentation/user/README.txt} and
329 @file{Documentation/TRANSLATION}.
330
331 The makefile variable @code{QUIET_BUILD} may be set to @code{1} for a
332 less verbose build output, just like for building the programs.
333
334 @knownissues
335
336 @code{-j} command-line option of @command{make} is unsupported for
337 building the documentation.  As the most time consuming task is
338 running LilyPond to build images of music, the makefile variable
339 @code{CPU_COUNT} may be set in @file{local.make} or on the command line
340 to the number of @code{.ly} files that LilyPond should process
341 simultaneously, e.g. on a bi-processor or dual core machine
342
343 @example
344 make CPU_COUNT=2 web
345 @end example
346
347 If source files have changed since last documentation build, output
348 files that need to be rebuilt are normally rebuilt, even if you do not
349 run @code{make web-clean} first.  However, building dependencies in the
350 documentation are so complex that rebuilding of some targets may not
351 be triggered as they should be; a workaround is to force rebuilding
352 by touching appropriate files, e.g.
353
354 @example
355 touch Documentation/user/*.itely
356 touch input/lsr/*.ly
357 @end example
358
359
360 @node Building documentation without compiling LilyPond
361 @unnumberedsubsubsec Building documentation without compiling LilyPond
362
363 The documentation can be built locally without compiling LilyPond
364 binary, if LilyPond is already installed on your system.
365
366 From a fresh Git checkout, do
367
368 @example
369 ./autogen.sh   # ignore any warning messages
370 cp GNUmakefile.in GNUmakefile
371 make -C python
372 nice make LILYPOND_EXTERNAL_BINARY=/path/to/bin/lilypond web
373 @end example
374
375 Please note that this may break sometimes -- for example, if a new
376 feature is added with a test file in input/regression, even the latest
377 development release of LilyPond will fail to build the docs.
378
379 You may build the manual without building all the @file{input/*}
380 stuff: change directory, for example to @file{Documentation/user},
381 issue @code{make web}, which will build documentation in a
382 subdirectory @file{out-www} from the source files in current
383 directory.  In this case, if you also want to browse the documentation
384 in its post-processed form, change back to top directory and issue
385
386 @example
387 make out=www WWW-post
388 @end example
389
390 @knownissues
391
392 You may also need to create a script for @command{pngtopnm} and
393 @code{pnmtopng}.  On GNU/Linux, I use this:
394
395 @verbatim
396 export LD_LIBRARY_PATH=/usr/lib
397 exec /usr/bin/pngtopnm "$@"
398 @end verbatim
399
400 On MacOS@tie{}X, I use this:
401
402 @verbatim
403 export DYLD_LIBRARY_PATH=/sw/lib
404 exec /sw/bin/pngtopnm "$@" 
405 @end verbatim
406
407
408
409 @node Testing LilyPond
410 @subsection Testing LilyPond
411
412 @html
413 <a name="testing"></a>
414 @end html
415
416 LilyPond comes with an extensive suite that exercises the entire
417 program.  This suite can be used to automatically check the impact of a
418 change.  This is done as follows
419
420 @example
421 make test-baseline
422 @emph{## apply your changes, compile}
423 make check
424 @end example
425
426 This will leave an HTML page @file{out/test-results/index.html}.  This
427 page shows all the important differences that your change introduced,
428 whether in the layout, MIDI, performance or error reporting.
429
430 To rerun tests, use
431
432 @example
433 make test-redo           @emph{## redo files differing from baseline}
434 make test-clean          @emph{## remove all test results}
435 @end example
436
437 @noindent
438 and then run @code{make check} again.
439
440 For tracking memory usage as part of this test, you will need GUILE
441 CVS; especially the following patch:
442 @uref{http://lilypond.org/vc/gub.darcs/patches/guile-1.9-gcstats.patch}.
443
444 For checking the coverage of the test suite, do the following
445
446 @example
447 ./buildscripts/build-coverage.sh
448 @emph{# uncovered files, least covered first}
449 python ./buildscripts/coverage.py  --summary out-cov/*.cc
450 @emph{# consecutive uncovered lines, longest first} 
451 python ./buildscripts/coverage.py  --uncovered out-cov/*.cc
452 @end example
453
454
455 @node Problems
456 @subsection Problems
457
458 For help and questions use @email{lilypond-user@@gnu.org}.  Send bug
459 reports to @email{bug-lilypond@@gnu.org}.
460
461 Bugs that are not fault of LilyPond are documented here.
462
463 @unnumberedsubsubsec Bison 1.875
464
465 There is a bug in bison-1.875: compilation fails with "parse error
466 before `goto'" in line 4922 due to a bug in bison.  To fix, please
467 recompile bison 1.875 with the following fix
468
469 @example
470 $ cd lily; make out/parser.cc
471 $ vi +4919 out/parser.cc
472 # append a semicolon to the line containing "__attribute__ ((__unused__))
473 # save
474 $ make
475 @end example
476
477
478 @unnumberedsubsubsec Solaris
479
480 Solaris7, ./configure
481
482 @file{./configure} needs a POSIX compliant shell.  On Solaris7,
483 @file{/bin/sh} is not yet POSIX compliant, but @file{/bin/ksh} or bash
484 is.  Run configure like
485
486 @example
487 CONFIG_SHELL=/bin/ksh ksh -c ./configure
488 @end example
489
490 @noindent
491 or
492
493 @example
494 CONFIG_SHELL=/bin/bash bash -c ./configure
495 @end example
496
497 @unnumberedsubsubsec FreeBSD
498
499 To use system fonts, dejaview must be installed.  With the default
500 port, the fonts are installed in @file{usr/X11R6/lib/X11/fonts/dejavu}.
501
502 Open the file @file{$LILYPONDBASE/usr/etc/fonts/local.conf} and add the
503 following line just after the @code{<fontconfig>} line.  (Adjust as necessary
504 for your hierarchy.)
505
506 @example
507 <dir>/usr/X11R6/lib/X11/fonts</dir>
508 @end example
509
510
511 @unnumberedsubsubsec International fonts
512
513 On MacOS@tie{}X, all fonts are installed by default.  However, finding all
514 system fonts requires a bit of configuration; see
515 @uref{http://lists.gnu.org/archive/html/lilypond-user/2007-03/msg00472.html,
516 this post} on the @code{lilypond-user} mailing list.
517
518 On Linux, international fonts are installed by different means on
519 every distribution.  We cannot list the exact commands or packages
520 that are necessary, as each distribution is different, and the exact
521 package names within each distribution changes.  Here are some
522 hints, though:
523
524 @verbatim
525 Red Hat Fedora
526
527     taipeifonts fonts-xorg-truetype ttfonts-ja fonts-arabic \
528          ttfonts-zh_CN fonts-ja fonts-hebrew 
529
530 Debian GNU/Linux
531
532    apt-get install emacs-intl-fonts xfonts-intl-.* \
533         ttf-kochi-gothic ttf-kochi-mincho \
534         xfonts-bolkhov-75dpi xfonts-cronyx-100dpi xfonts-cronyx-75dpi 
535 @end verbatim
536