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