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