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