]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/included/compile.itexi
Merge branch 'translation' into staging
[lilypond.git] / Documentation / included / compile.itexi
1 @c -*- coding: utf-8; mode: texinfo; -*-
2
3
4 @c DO NOT TRANSLATE THIS FILE
5
6 @c include any node/sections from the higher-level *texi file.
7 @c   @n ode Compiling from source
8 @c   @s ection Compiling from source
9
10 @menu
11 * Overview of compiling::
12 * Requirements::
13 * Getting the source code::
14 * Configuring make::
15 * Compiling LilyPond::
16 * Post-compilation options::
17 * Problems::
18 * Concurrent stable and development versions::
19 * Build system::
20 @end menu
21
22
23 @node Overview of compiling
24 @section Overview of compiling
25
26 Compiling LilyPond from source is an involved process, and is only
27 recommended for developers and packagers.  Typical program users
28 are instead encouraged to obtain the program from a package
29 manager (on Unix) or by downloading a precompiled binary
30 configured for a specific operating system.  Pre-compiled binaries
31 are available on the @rweb{Download} page.
32
33 Compiling LilyPond from source is necessary if you want to build,
34 install, or test your own version of the program.
35
36 A successful compile can also be used to generate and install the
37 documentation, incorporating any changes you may have made.
38 However, a successful compile is not a requirement for generating
39 the documentation.  The documentation can be built using a Git
40 repository in conjunction with a locally installed copy of the
41 program.  For more information, see @ref{Building documentation
42 without compiling}.
43
44 Attempts to compile LilyPond natively on Windows have been
45 unsuccessful, though a workaround is available (see
46 @rcontrib{LilyDev}).
47
48
49 @node Requirements
50 @section Requirements
51
52
53 @menu
54 * Requirements for running LilyPond::
55 * Requirements for compiling LilyPond::
56 * Requirements for building documentation::
57 @end menu
58
59
60 @node Requirements for running LilyPond
61 @subsection Requirements for running LilyPond
62
63 Running LilyPond requires proper installation of the following
64 software:
65
66 @itemize
67 @item @uref{http://www.dejavu-fonts.org/, DejaVu fonts} (normally
68 installed by default)
69
70 @item @uref{http://www.fontconfig.org/, FontConfig} (2.4.0 or newer)
71
72 @item @uref{http://www.freetype.org/, Freetype} (2.1.10 or newer)
73
74 @item @uref{http://www.ghostscript.com, Ghostscript} (8.60 or
75 newer)
76
77 @item @uref{http://www.gnu.org/software/guile/guile.html, Guile}
78 (1.8.2 or newer)
79
80 @item @uref{http://www.pango.org/, Pango} (1.12 or newer)
81
82 @item @uref{http://www.python.org, Python} (2.4 or newer)
83 @end itemize
84
85 International fonts are required to create music with
86 international text or lyrics.
87
88
89 @node Requirements for compiling LilyPond
90 @subsection Requirements for compiling LilyPond
91
92 Below is a full list of packages needed to build LilyPond.
93 However, for most common distributions there is an easy way of
94 installing most all build dependencies in one go:
95
96 @multitable @columnfractions .5 .5
97 @headitem Distribution @tab Command
98 @item Debian, Ubuntu
99 @tab @code{sudo apt-get build-dep lilypond}
100
101 @item Fedora, RHEL
102 @tab @code{sudo yum-builddep lilypond}
103
104 @item openSUSE, SLED
105 @c sorry for the idiosyncratic command, I really asked and argued
106 @c for "zypper build-dep" :-(
107 @tab @code{sudo zypper --build-deps-only source-install lilypond}
108 @end multitable
109
110 @itemize
111 @item Everything listed in @ref{Requirements for running
112 LilyPond}
113
114 @item Development packages for the above items (which should
115 include header files and libraries).
116
117 Red Hat Fedora:
118
119 @c ghostscript-devel-[version] isn't needed
120 @example
121 guile-devel-@var{version}
122 fontconfig-devel-@var{version}
123 freetype-devel-@var{version}
124 pango-devel-@var{version}
125 python-devel-@var{version}
126 @end example
127
128 Debian GNU/Linux:
129
130 @c libgs-dev isn't needed
131 @example
132 guile-@var{version}-dev
133 libfontconfig1-dev
134 libfreetype6-dev
135 libpango1.0-dev
136 python@var{version}-dev
137 @end example
138
139 @item @uref{http://flex.sourceforge.net/, Flex}
140
141 @item @uref{http://fontforge.sf.net/, FontForge} (20060125 or
142 newer; 20100501 or newer is recommended; must be compiled
143 with @option{--enable-double}.  Failure to do so can lead to
144 poor intersection calculations and poorly-rendered glyphs.)
145
146 @item @uref{http://www.gnu.org/software/bison/, GNU Bison}
147
148 @item @uref{http://gcc.gnu.org/, GNU Compiler Collection} (3.4 or
149 newer, 4.@var{x} recommended)
150
151 @item @uref{http://www.gnu.org/software/gettext/gettext.html, GNU
152 gettext} (0.17 or newer)
153
154 @item @uref{http://www.gnu.org/software/make/, GNU Make} (3.78 or
155 newer)
156
157 @item @uref{http://metafont.tutorial.free.fr/, MetaFont}
158 (mf-nowin, mf, mfw or mfont binaries), usually packaged with
159 @uref{http://www.latex-project.org/ftp.html, @TeX{}}.
160
161 @item @uref{http://cm.bell-labs.com/who/hobby/MetaPost.html,
162 MetaPost} (mpost binary), usually packaged with
163 @uref{http://www.latex-project.org/ftp.html, @TeX{}}.
164
165 @item @uref{http://www.perl.org/, Perl}
166
167 @item @uref{http://www.gnu.org/software/texinfo/, Texinfo} (4.11
168 or newer)
169
170 @item @uref{http://www.lcdf.org/~eddietwo/type/#t1utils, Type 1
171 utilities} (1.33 or newer recommended)
172 @end itemize
173
174
175 @node Requirements for building documentation
176 @subsection Requirements for building documentation
177
178 You can view the documentation online at
179 @uref{http://www.lilypond.org/doc/}, but you can also build it
180 locally.  This process requires some additional tools and
181 packages:
182
183 @itemize
184 @item Everything listed in @ref{Requirements for compiling
185 LilyPond}
186
187 @item @uref{http://www.imagemagick.org/, ImageMagick}
188
189 @item @uref{http://netpbm.sourceforge.net/, Netpbm}
190
191 @item @uref{http://gzip.org/, gzip}
192
193 @item @uref{http://rsync.samba.org/, rsync}
194
195 @item @uref{http://www.nongnu.org/texi2html/, Texi2HTML} (1.82)
196
197 @item International fonts
198
199 Red Hat Fedora:
200
201 @example
202 fonts-arabic
203 fonts-hebrew
204 fonts-ja
205 fonts-xorg-truetype
206 taipeifonts
207 ttfonts-ja
208 ttfonts-zh_CN
209 @end example
210
211 Debian GNU/Linux:
212
213 @example
214 emacs-intl-fonts
215 ttf-kochi-gothic
216 ttf-kochi-mincho
217 xfonts-bolkhov-75dpi
218 xfonts-cronyx-75dpi
219 xfonts-cronyx-100dpi
220 xfonts-intl-.*
221 @end example
222 @end itemize
223
224
225 @node Getting the source code
226 @section Getting the source code
227
228
229 @subheading Downloading the Git repository
230
231 In general, developers compile LilyPond from within a local Git
232 repository.  Setting up a local Git repository is explained in
233 @rcontrib{Starting with Git}.
234
235
236 @subheading Downloading a source tarball
237
238 Packagers are encouraged to use source tarballs for compiling.
239
240 The tarball for the latest stable release is available on the
241 @rweb{Source} page.
242
243 @noindent
244 The latest
245 @uref{http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=snapshot, source code snapshot}
246 is also available as a tarball from the GNU Savannah Git server.
247
248 @noindent
249 All tagged releases (including legacy stable
250 versions and the most recent development release) are available
251 here:
252
253 @example
254 @uref{http://download.linuxaudio.org/lilypond/source/}
255 @end example
256
257 Download the tarball to your @file{~/src/} directory, or some
258 other appropriate place.
259
260 @warning{Be careful where you unpack the tarball!  Any
261 subdirectories of the current folder named @file{lilypond/} or
262 @file{lilypond-@var{x.y.z}/} (where @var{x.y.z} is the release
263 number) will be overwritten if there is a name clash with the
264 tarball.}
265
266 Unpack the tarball with this command:
267
268 @example
269 tar -xzf lilypond-@var{x.y.z}.tar.gz
270 @end example
271
272 This creates a subdirectory within the current directory called
273 @file{lilypond-@var{x.y.z}/}.  Once unpacked, the source files
274 occupy about 40 MB of disk space.
275
276 Windows users wanting to look at the source code may have to
277 download and install the free-software
278 @uref{http://www.7-zip.org, 7zip archiver} to extract the tarball.
279
280
281 @node Configuring make
282 @section Configuring @command{make}
283
284
285 @menu
286 * Running ./autogen.sh::
287 * Running ../configure::
288 @end menu
289
290
291 @node Running ./autogen.sh
292 @subsection Running @command{./autogen.sh}
293
294 After you unpack the tarball (or download the Git repository), the
295 contents of your top source directory should be similar to the
296 current source tree listed at
297 @uref{http://git.sv.gnu.org/gitweb/?p=lilypond.git;a=tree}.
298
299 Next, you need to create the generated files; enter the following
300 command from your top source directory:
301
302 @example
303 ./autogen.sh --noconfigure
304 @end example
305
306 This will generate a number of files and directories to aid
307 configuration, such as @file{configure}, @file{README.txt}, etc.
308
309 Next, create the build directory with:
310
311 @example
312 mkdir build/
313 cd build/
314 @end example
315
316 We heavily recommend building lilypond inside a separate directory
317 with this method.
318
319
320 @node Running ../configure
321 @subsection Running @command{../configure}
322
323
324 @menu
325 * Configuration options::
326 * Checking build dependencies::
327 * Configuring target directories::
328 @end menu
329
330
331 @node Configuration options
332 @unnumberedsubsubsec Configuration options
333
334 @warning{make sure that you are in the @file{build/} subdirectory
335 of your source tree.}
336
337 The @command{../configure} command (generated by
338 @command{./autogen.sh}) provides many options for configuring
339 @command{make}.  To see them all, run:
340
341 @example
342 ../configure --help
343 @end example
344
345
346 @node Checking build dependencies
347 @unnumberedsubsubsec Checking build dependencies
348
349 @warning{make sure that you are in the @file{build/} subdirectory
350 of your source tree.}
351
352 When @command{../configure} is run without any arguments, it will
353 check to make sure your system has everything required for
354 compilation:
355
356 @example
357 ../configure
358 @end example
359
360 If any build dependency is missing, @command{../configure} will
361 return with:
362
363 @example
364 ERROR: Please install required programs:  @var{foo}
365 @end example
366
367 The following message is issued if you are missing programs that
368 are only needed for building the documentation:
369
370 @example
371 WARNING: Please consider installing optional programs:  @var{bar}
372 @end example
373
374 If you intend to build the documentation locally, you will need to
375 install or update these programs accordingly.
376
377 @warning{@command{../configure} may fail to issue warnings for
378 certain documentation build requirements that are not met.  If you
379 experience problems when building the documentation, you may need
380 to do a manual check of @ref{Requirements for building
381 documentation}.}
382
383
384 @node Configuring target directories
385 @unnumberedsubsubsec Configuring target directories
386
387 @warning{make sure that you are in the @file{build/} subdirectory
388 of your source tree.}
389
390 If you intend to use your local build to install a local copy of
391 the program, you will probably want to configure the installation
392 directory.  Here are the relevant lines taken from the output of
393 @command{../configure@tie{}--help}:
394
395 @quotation
396 By default, `@command{make@tie{}install}' will install all the
397 files in @file{/usr/local/bin}, @file{/usr/local/lib} etc.  You
398 can specify an installation prefix other than @file{/usr/local}
399 using `@option{--prefix}', for instance `@option{--prefix=$HOME}'.
400 @end quotation
401
402 A typical installation prefix is @file{$HOME/usr}:
403
404 @example
405 ../configure --prefix=$HOME/usr
406 @end example
407
408 Note that if you plan to install a local build on a system where
409 you do not have root privileges, you will need to do something
410 like this anyway---@command{make@tie{}install} will only succeed
411 if the installation prefix points to a directory where you have
412 write permission (such as your home directory).  The installation
413 directory will be automatically created if necessary.
414
415 The location of the @command{lilypond} command installed by this
416 process will be @file{@var{prefix}/bin/lilypond}; you may want to
417 add @file{@var{prefix}/bin/} to your @code{$PATH} if it is not
418 already included.
419
420 It is also possible to specify separate installation directories
421 for different types of program files.  See the full output of
422 @command{../configure@tie{}--help} for more information.
423
424 If you encounter any problems, please see @ref{Problems}.
425
426
427 @node Compiling LilyPond
428 @section Compiling LilyPond
429
430
431 @menu
432 * Using make::
433 * Saving time with the -j option::
434 * Compiling for multiple platforms::
435 * Useful make variables::
436 @end menu
437
438
439 @node Using make
440 @subsection Using @command{make}
441
442 @warning{make sure that you are in the @file{build/} subdirectory
443 of your source tree.}
444
445 LilyPond is compiled with the @command{make} command.  Assuming
446 @command{make} is configured properly, you can simply run:
447
448 @example
449 make
450 @end example
451
452 @samp{make} is short for @samp{make all}.  To view a list of @command{make}
453 targets, run:
454
455 @example
456 make help
457 @end example
458
459 TODO: Describe what @command{make} actually does.
460
461 @seealso
462 @ref{Generating documentation} provides more info on the @command{make} targets
463 used to build the LilyPond documentation.
464
465
466 @node Saving time with the -j option
467 @subsection Saving time with the @option{-j} option
468
469 If your system has multiple CPUs, you can speed up compilation by
470 adding @samp{-j@var{X}} to the @command{make} command, where
471 @samp{@var{X}} is one more than the number of cores you have.  For
472 example, a typical Core2Duo machine would use:
473
474 @example
475 make -j3
476 @end example
477
478 If you get errors using the @option{-j} option, and @samp{make}
479 succeeds without it, try lowering the @code{@var{X}} value.
480
481 Because multiple jobs run in parallel when @option{-j} is used, it can
482 be difficult to determine the source of an error when one occurs.  In
483 that case, running @samp{make} without the @option{-j} is advised.
484
485 @node Compiling for multiple platforms
486 @subsection Compiling for multiple platforms
487
488 If you want to build multiple versions of LilyPond with different
489 configuration settings, you can use the
490 @option{--enable-config=@var{conf}} option of @command{configure}.
491 You should use @code{make@tie{}conf=@var{conf}} to generate the
492 output in @file{out-@var{conf}}.  For example, suppose you want to
493 build with and without profiling, then use the following for the
494 normal build
495
496 @example
497 ./configure --prefix=$HOME/usr/ --enable-checking
498 make
499 @end example
500
501 and for the profiling version, specify a different configuration
502
503 @example
504 ./configure --prefix=$HOME/usr/ --enable-profiling \
505   --enable-config=prof --disable-checking
506 make conf=prof
507 @end example
508
509 If you wish to install a copy of the build with profiling, don't
510 forget to use @code{conf=@var{CONF}} when issuing
511 @command{make@tie{}install}:
512
513 @example
514 make conf=prof install
515 @end example
516
517
518 @seealso
519 @ref{Installing LilyPond from a local build}
520
521
522 @node Useful make variables
523 @subsection Useful @command{make} variables
524
525 If a less verbose build output if desired, the variable
526 @code{QUIET_BUILD} may be set to @code{1} on @command{make}
527 command line, or in @file{local.make} at top of the build tree.
528
529
530 @node Post-compilation options
531 @section Post-compilation options
532
533
534 @menu
535 * Installing LilyPond from a local build::
536 * Generating documentation::
537 * Testing LilyPond binary::
538 @end menu
539
540
541 @node Installing LilyPond from a local build
542 @subsection Installing LilyPond from a local build
543
544 If you configured @command{make} to install your local build in a
545 directory where you normally have write permission (such as your
546 home directory), and you have compiled LilyPond by running
547 @command{make}, you can install the program in your target
548 directory by running:
549
550 @example
551 make install
552 @end example
553
554 If instead, your installation directory is not one that you can
555 normally write to (such as the default @file{/usr/local/}, which
556 typically is only writeable by the superuser), you will need to
557 temporarily become the superuser when running
558 @command{make@tie{}install}:
559
560 @example
561 sudo make install
562 @end example
563
564 @noindent
565 or...
566
567 @example
568 su -c 'make install'
569 @end example
570
571 If you don't have superuser privileges, then you need to configure
572 the installation directory to one that you can write to, and then
573 re-install.  See @ref{Configuring target directories}.
574
575
576 @node Generating documentation
577 @subsection Generating documentation
578
579
580 @menu
581 * Documentation editor's edit/compile cycle::
582 * Building documentation::
583 * Building a single document::
584 * Saving time with CPU_COUNT::
585 * AJAX search::
586 * Installing documentation::
587 * Building documentation without compiling::
588 @end menu
589
590
591 @node Documentation editor's edit/compile cycle
592 @unnumberedsubsubsec Documentation editor's edit/compile cycle
593
594 @itemize
595 @item
596 Initial documentation build:
597
598 @example
599 make [-j@var{X}]
600 make [-j@var{X} CPU_COUNT=@var{X}] doc          @emph{## can take an hour or more}
601 make [-j@var{X} CPU_COUNT=@var{X}] doc-stage-1  @emph{## to build only PDF documentation}
602 @end example
603
604 @item
605 Edit/compile cycle:
606
607 @example
608 @emph{## edit source files, then...}
609
610 make [-j@var{X}]                  @emph{## needed if editing outside}
611                             @emph{##   Documentation/, but useful anyway}
612                             @emph{##   for finding Texinfo errors.}
613 make [-j@var{X} CPU_COUNT=@var{X}] doc  @emph{## usually faster than initial build.}
614 @end example
615
616 @item
617 Reset:
618
619 In some cases, it is possible to clean the compiled documentation
620 with @samp{make@tie{}doc-clean}, but this method is not guaranteed
621 to fix everything.  Instead, we recommend that you delete your
622 @file{build/} directory, and begin compiling from scratch.  Since
623 the documentation compile takes much longer than the
624 non-documentation compile, this does not increase the overall time
625 by a great deal.
626
627 @end itemize
628
629 @node Building documentation
630 @unnumberedsubsubsec Building documentation
631
632 After a successful compile (using @command{make}), the
633 documentation can be built by issuing:
634
635 @example
636 make doc
637 @end example
638
639 or, to build only the PDF documentation and not the HTML,
640
641 @example
642 make doc-stage-1
643 @end example
644
645 @warning{The first time you run @command{make@tie{}doc}, the
646 process can easily take an hour or more with not much output
647 on the command line.}
648
649 After this initial build, @command{make@tie{}doc} only makes
650 changes to the documentation where needed, so it may only take
651 a minute or two to test changes if the documentation is already
652 built.
653
654 If @command{make@tie{}doc} succeeds, the HTML documentation tree
655 is available in @file{out-www/offline-root/}, and can be browsed
656 locally.  Various portions of the documentation can be found by
657 looking in @file{out/} and @file{out-www} subdirectories in other
658 places in the source tree, but these are only @emph{portions} of
659 the docs.  Please do not complain about anything which is broken
660 in those places; the only complete set of documentation is in
661 @file{out-www/offline-root/} from the top of the source tree.
662
663 @code{make doc} compiles the documents for all languages.  To save
664 some compile time, the English language documents can be compiled
665 on their own with:
666
667 @example
668 make LANGS='' doc
669 @end example
670
671 @noindent Similarly, it is possible to compile a subset of the
672 translated documentation by specifying their language codes on the
673 command line.  For example, the French and German translations are
674 compiled with:
675
676 @example
677 make LANGS='de fr' doc
678 @end example
679
680 @noindent Note that this will also compile the English version.
681
682 Compilation of documentation in Info format with images can be
683 done separately by issuing:
684
685 @example
686 make info
687 @end example
688
689 @noindent
690 An issue when switching branches between master and translation
691 is the appearance/disappearance of translated versions of some manuals.
692 If you see such a warning from make:
693
694 @example
695 No rule to make target `X', needed by `Y'
696 @end example
697
698 @noindent
699 Your best bet is to delete the file Y.dep and to try again.
700
701 @node Building a single document
702 @unnumberedsubsubsec Building a single document
703 It's possible to build a single document.  For example, to rebuild
704 only @file{contributor.pdf}, do the following:
705
706 @example
707 cd build/
708 cd Documentation/
709 touch ../../Documentation/contributor.texi
710 make out=www out-www/contributor.pdf
711 @end example
712
713 If you are only working on a single document, test-building it in
714 this way can give substantial time savings - recreating
715 @file{contributor.pdf}, for example, takes a matter of seconds.
716
717 @node Saving time with CPU_COUNT
718 @unnumberedsubsubsec Saving time with @code{CPU_COUNT}
719
720 The most time consuming task for building the documentation is
721 running LilyPond to build images of music, and there cannot be
722 several simultaneously running @command{lilypond-book} instances,
723 so the @option{-j} @command{make} option does not significantly
724 speed up the build process.  To help speed it up, the makefile
725 variable @option{CPU_COUNT} may be set in @file{local.make} or on
726 the command line to the number of @code{.ly} files that LilyPond
727 should process simultaneously, e.g. on a bi-processor or dual core
728 machine:
729
730 @example
731 make -j3 CPU_COUNT=3 doc
732 @end example
733
734 @noindent
735 The recommended value of @option{CPU_COUNT} is one plus the number
736 of cores or processors, but it is advisable to set it to a smaller
737 value unless your system has enough RAM to run that many
738 simultaneous LilyPond instances.  Also, values for the @option{-j}
739 option that pose problems with @samp{make} are less likely to pose
740 problems with @samp{make doc} (this applies to both @option{-j}
741 and @option{CPU_COUNT}).  For example, with a quad-core processor,
742 it is possible for @samp{make -j5 CPU_COUNT=5 doc} to work
743 consistently even if @samp{make -j5} rarely succeeds.
744
745
746 @node AJAX search
747 @unnumberedsubsubsec AJAX search
748
749 To build the documentation with interactive searching, use:
750
751 @example
752 make doc AJAX_SEARCH=1
753 @end example
754
755 This requires PHP, and you must view the docs via a http
756 connection (you cannot view them on your local filesystem).
757
758 @warning{Due to potential security or load issues, this option is
759 not enabled in the official documentation builds.  Enable at your
760 own risk.}
761
762
763 @node Installing documentation
764 @unnumberedsubsubsec Installing documentation
765
766 The HTML, PDF and if available Info files can be installed into
767 the standard documentation path by issuing
768
769 @example
770 make install-doc
771 @end example
772
773 @noindent
774 This also installs Info documentation with images if the
775 installation prefix is properly set; otherwise, instructions to
776 complete proper installation of Info documentation are printed on
777 standard output.
778
779 To install the Info documentation separately, run:
780
781 @example
782 make install-info
783 @end example
784
785 @noindent
786 Note that to get the images in Info documentation, @code{install-doc}
787 target creates symbolic links to HTML and PDF installed documentation
788 tree in @file{@var{prefix}/share/info}, in order to save disk space,
789 whereas @code{install-info} copies images in
790 @file{@var{prefix}/share/info} subdirectories.
791
792 It is possible to build a documentation tree in
793 @file{out-www/online-root/}, with special processing, so it can be
794 used on a website with content negotiation for automatic language
795 selection; this can be achieved by issuing
796
797 @example
798 make WEB_TARGETS=online doc
799 @end example
800
801 @noindent
802 and both @q{offline} and @q{online} targets can be generated by issuing
803
804 @example
805 make WEB_TARGETS="offline online" doc
806 @end example
807
808 Several targets are available to clean the documentation build and
809 help with maintaining documentation; an overview of these targets is
810 available with
811
812 @example
813 make help
814 @end example
815
816 @noindent
817 from every directory in the build tree.  Most targets for
818 documentation maintenance are available from
819 @file{Documentation/}; for more information, see
820 @rcontrib{Documentation work}.
821
822 The makefile variable @code{QUIET_BUILD} may be set to @code{1}
823 for a less verbose build output, just like for building the
824 programs.
825
826
827 @node Building documentation without compiling
828 @unnumberedsubsubsec Building documentation without compiling
829
830
831 The documentation can be built locally without compiling LilyPond
832 binary, if LilyPond is already installed on your system.
833
834 From a fresh Git checkout, do
835
836 @example
837 ./autogen.sh   # ignore any warning messages
838 cp GNUmakefile.in GNUmakefile
839 make -C scripts && make -C python
840 nice make LILYPOND_EXTERNAL_BINARY=/path/to/bin/lilypond doc
841 @end example
842
843 Please note that this may break sometimes -- for example, if a new
844 feature is added with a test file in input/regression, even the latest
845 development release of LilyPond will fail to build the docs.
846
847 You may build the manual without building all the @file{input/*} stuff
848 (i.e. mostly regression tests): change directory, for example to
849 @file{Documentation/}, issue @code{make doc}, which will build
850 documentation in a subdirectory @file{out-www} from the source files in
851 current directory.  In this case, if you also want to browse the
852 documentation in its post-processed form, change back to top directory
853 and issue
854
855 @example
856 make out=www WWW-post
857 @end example
858
859 @knownissues
860
861 You may also need to create a script for @command{pngtopnm} and
862 @code{pnmtopng}.  On GNU/Linux, I use this:
863
864 @verbatim
865 export LD_LIBRARY_PATH=/usr/lib
866 exec /usr/bin/pngtopnm "$@"
867 @end verbatim
868
869 On MacOS X with fink, I use this:
870
871 @verbatim
872 export DYLD_LIBRARY_PATH=/sw/lib
873 exec /sw/bin/pngtopnm "$@"
874 @end verbatim
875
876 On MacOS X with macports, you should use this:
877
878 @verbatim
879 export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib
880 exec /opt/local/bin/pngtopnm "$@"
881 @end verbatim
882
883
884 @node Testing LilyPond binary
885 @subsection Testing LilyPond binary
886
887
888 LilyPond comes with an extensive suite that exercises the entire
889 program.  This suite can be used to test that the binary has
890 been built correctly.
891
892 The test suite can be executed with:
893
894 @verbatim
895 make test
896 @end verbatim
897
898 If the test suite completes successfully, the LilyPond binary
899 has been verified.
900
901 More information on the regression test suite is found at
902 @rcontrib{Regression tests}.
903
904 @node Problems
905 @section Problems
906
907 For help and questions use @email{lilypond-user@@gnu.org}.  Send
908 bug reports to @email{bug-lilypond@@gnu.org}.
909
910 Bugs that are not fault of LilyPond are documented here.
911
912 @unnumberedsubsubsec Bison 1.875
913
914 There is a bug in bison-1.875: compilation fails with "parse error
915 before `goto'" in line 4922 due to a bug in bison.  To fix, please
916 recompile bison 1.875 with the following fix
917
918 @example
919 $ cd lily; make out/parser.cc
920 $ vi +4919 out/parser.cc
921 # append a semicolon to the line containing "__attribute__ ((__unused__))
922 # save
923 $ make
924 @end example
925
926
927 @unnumberedsubsubsec Compiling on MacOS@tie{}X
928
929 Here are special instructions for compiling under MacOS@tie{}X.
930 These instructions assume that dependencies are installed using
931 @uref{http://www.macports.org/, MacPorts.} The instructions have
932 been tested using OS X 10.5 (Leopard).
933
934 First, install the relevant dependencies using MacPorts.
935
936 Next, add the following to your relevant shell initialization
937 files.  This is @code{~/.profile} by default.  You should create
938 this file if it does not exist.
939
940 @example
941 export PATH=/opt/local/bin:/opt/local/sbin:$PATH
942 export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib:$DYLD_FALLBACK_LIBRARY_PATH
943 @end example
944
945 Now you must edit the generated @file{config.make} file.  Change
946
947 @example
948 FLEXLEXER_FILE = /usr/include/FlexLexer.h
949 @end example
950
951 @noindent
952 to:
953
954 @example
955 FLEXLEXER_FILE = /opt/local/include/FlexLexer.h
956 @end example
957
958 At this point, you should verify that you have the appropriate
959 fonts installed with your ghostscript installation.  Check @code{ls
960 /opt/local/share/ghostscript/fonts} for: 'c0590*' files (.pfb,
961 .pfb and .afm).  If you don't have them, run the following
962 commands to grab them from the ghostscript SVN server and install
963 them in the appropriate location:
964
965 @example
966 svn export http://svn.ghostscript.com/ghostscript/tags/urw-fonts-1.0.7pre44/
967 sudo mv urw-fonts-1.0.7pre44/* /opt/local/share/ghostscript/fonts/
968 rm -rf urw-fonts-1.07pre44
969 @end example
970
971 Now run the @code{./configure} script.  To avoid complications with
972 automatic font detection, add
973
974 @example
975 --with-ncsb-dir=/opt/local/share/ghostscript/fonts
976 @end example
977
978
979 @unnumberedsubsubsec Solaris
980
981 Solaris7, ./configure
982
983 @file{./configure} needs a POSIX compliant shell.  On Solaris7,
984 @file{/bin/sh} is not yet POSIX compliant, but @file{/bin/ksh} or bash
985 is.  Run configure like
986
987 @example
988 CONFIG_SHELL=/bin/ksh ksh -c ./configure
989 @end example
990
991 @noindent
992 or
993
994 @example
995 CONFIG_SHELL=/bin/bash bash -c ./configure
996 @end example
997
998 @unnumberedsubsubsec FreeBSD
999
1000 To use system fonts, dejaview must be installed.  With the default
1001 port, the fonts are installed in @file{usr/X11R6/lib/X11/fonts/dejavu}.
1002
1003 Open the file @file{$LILYPONDBASE/usr/etc/fonts/local.conf} and add the
1004 following line just after the @code{<fontconfig>} line.  (Adjust as necessary
1005 for your hierarchy.)
1006
1007 @example
1008 <dir>/usr/X11R6/lib/X11/fonts</dir>
1009 @end example
1010
1011
1012 @unnumberedsubsubsec International fonts
1013
1014 On Mac OS X, all fonts are installed by default.  However, finding all
1015 system fonts requires a bit of configuration; see
1016 @uref{http://lists.gnu.org/archive/html/lilypond-user/2007-03/msg00472.html,
1017 this post} on the @code{lilypond-user} mailing list.
1018
1019 On Linux, international fonts are installed by different means on
1020 every distribution.  We cannot list the exact commands or packages
1021 that are necessary, as each distribution is different, and the exact
1022 package names within each distribution changes.  Here are some
1023 hints, though:
1024
1025 @verbatim
1026 Red Hat Fedora
1027
1028     taipeifonts fonts-xorg-truetype ttfonts-ja fonts-arabic \
1029          ttfonts-zh_CN fonts-ja fonts-hebrew
1030
1031 Debian GNU/Linux
1032
1033    apt-get install emacs-intl-fonts xfonts-intl-.* \
1034         ttf-kochi-gothic ttf-kochi-mincho \
1035         xfonts-bolkhov-75dpi xfonts-cronyx-100dpi xfonts-cronyx-75dpi
1036 @end verbatim
1037
1038
1039 @unnumberedsubsubsec Using lilypond python libraries
1040
1041 If you want to use lilypond's python libraries (either running
1042 certain build scripts manually, or using them in other programs),
1043 set @code{PYTHONPATH} to @file{python/out} in your build
1044 directory, or @file{.../usr/lib/lilypond/current/python} in the
1045 installation directory structure.
1046
1047
1048
1049
1050 @node Concurrent stable and development versions
1051 @section Concurrent stable and development versions
1052
1053
1054 It can be useful to have both the stable and the development versions
1055 of Lilypond available at once.  One way to do this on GNU/Linux is to
1056 install the stable version using the precompiled binary, and run the
1057 development version from the source tree.  After running @command{make
1058 all} from the top directory of the Lilypond source files, there will
1059 be a binary called @code{lilypond} in the @code{out} directory:
1060
1061 @example
1062 <@var{path to}>/lilypond/out/bin/lilypond
1063 @end example
1064
1065 This binary can be run without actually doing the @code{make
1066 install} command.  The advantage to this is that you can have all
1067 of the latest changes available after pulling from git and running
1068 @code{make all}, without having to uninstall the old version and
1069 reinstall the new.
1070
1071 So, to use the stable version, install it as usual and use the
1072 normal commands:
1073
1074 @example
1075 lilypond foobar.ly
1076 @end example
1077
1078 To use the development version, create a link to the binary in the
1079 source tree by saving the following line in a file somewhere in your
1080 @code{$PATH}:
1081
1082 @example
1083 exec <@var{path to}>/lilypond/out/bin/lilypond "$@@"
1084 @end example
1085
1086 Save it as @code{Lilypond} (with a capital L to distinguish it
1087 from the stable @code{lilypond}), and make it executable:
1088
1089 @example
1090 chmod +x Lilypond
1091 @end example
1092
1093 Then you can invoke the development version this way:
1094
1095 @example
1096 Lilypond foobar.ly
1097 @end example
1098
1099
1100 TODO: ADD
1101
1102 - other compilation tricks for developers
1103
1104
1105 @node Build system
1106 @section Build system
1107
1108
1109 We currently use make and stepmake, which is complicated and only
1110 used by us.  Hopefully this will change in the future.
1111
1112
1113 @subsubheading Version-specific texinfo macros
1114
1115 @itemize
1116
1117 @item
1118 made with @command{scripts/build/create-version-itexi.py} and@*
1119 @command{scripts/build/create-weblinks-itexi.py}
1120
1121 @item
1122 used extensively in the @code{WEBSITE_ONLY_BUILD} version of the
1123 website (made with @file{website.make}, used on lilypond.org)
1124
1125 @item
1126 not (?) used in the main docs?
1127
1128 @item
1129 the numbers in VERSION file: MINOR_VERSION should be 1 more than
1130 the last release, VERSION_DEVEL should be the last @strong{online}
1131 release.  Yes, VERSION_DEVEL is less than VERSION.
1132
1133 @end itemize