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