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