1 \input texinfo @c -*-texinfo-*-
2 @setfilename INSTALL.info
3 @settitle INSTALL - compiling and installing GNU LilyPond
6 <!--- @@WEB-TITLE@@=Installation Instructions --->
14 @chapter INSTALL - compiling and installing GNU LilyPond
17 This document describes how to build LilyPond on Unix platforms. It is
18 also known to run and compile on Windows NT/95/98 as well. More
19 information on this topic can be found at the
20 @uref{http://www.lilypond.org/gnu-windows/, LilyPond on Windows page}.
24 <a name="download-source">
29 Even numbered versions are `stable'. The webpages for the stable version
30 (1.2) reside @uref{http://www.gnu.org/software/lilypond, on the GNU
31 servers}. Big enhancements go into the latest odd numbered version
32 (1.3), whose webpages are on @uref{http://www.lilypond.org/,the lilypond
35 @subsection Source code
37 If you want to compile LilyPond from source, download here:
39 @item Download development releases from
40 @c Hmm, these won't show up in lilypond.org/stats
41 @c Otoh, lilypond.org is not updated when release mail arrives
42 @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/} by FTP and
43 @uref{http://ftp.cs.uu.nl/pub/GNU/LilyPond/}, by HTTP.
44 @item @uref{ftp://sca.uwaterloo.ca/pub/} by FTP (Canadian mirror)
45 @item at @code{lilypond.org}
46 @uref{ftp://ftp.lilypond.org/pub/LilyPond/} by FTP and
47 @uref{http://www.lilypond.org/ftp/} by HTTP.
50 Of course, if your platform supports LilyPond, such as Debian GNU/Linux,
51 FreeBSD, OpenBSD or NetBSD, you're encouraged to use the native build
54 For Red Hat Linux and SuSE Linux, @file{.spec} files are included in the
55 tarball; see instructions below.
58 <a name="download-binaries">
63 @subsection Precompiled binaries
65 If you want to track bleeding edge development, try:
68 @item @uref{ftp://ftp.debian.org/debian/pool/main/l/lilypond/, Debian
69 GNU/Linux} usually has the latest binaries for the most useful stable
70 and development versions, while
71 @item @uref{http://rpmfind.net/linux/mandrake/cooker/contrib/RPMS/,
72 Mandrake Cooker} also provides fairly recent versions.
75 Binaries are made available for other popular platforms, but as we need
76 to compile them ourselves, they are not updated for every version
80 @item @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/RedHat/RPMS/, Red Hat i386}
81 @item @uref{ftp://ftp.lilypond.org/pub/LilyPond/binaries/SuSE, SuSE}
82 @item @uref{ftp://ftp.lilypond.org/pub/LilyPond/binaries/linuxppc/,
85 @uref{http://www.lilypond.org/gnu-windows/, Windows}
90 There are two options for upgrading sources.
93 @item if you have an unpacked source tree of a previous version, you
96 @emph{If you upgrade by patching do remember to rerun autoconf after
99 @item if you have the @code{.tar.gz} file of a previous release, you can
101 @uref{ftp://ftp.xcf.berkeley.edu/pub/xdelta/, xdelta}.
102 This is much safer than using patches, and is the recommended way.
104 The following command produces @file{lilypond-1.4.3.tar.gz} from
105 @file{lilypond-1.4.2.tar.gz} identical (up to compression dates) to the .3
108 xdelta patch lilypond-1.4.2-1.4.3.xd lilypond-1.4.2.tar.gz
112 @section Requirements
114 @subsection Compilation
116 You need the following packages to compile Lilypond.
119 @item A reasonably new C++ compiler: EGCS 1.1, GCC 2.95.2 or
120 newer. Check out @uref{ftp://ftp.gnu.org/gnu/gcc/, the gcc site}.
123 Check out @uref{http://www.python.org, the python website}.
125 @item GUILE 1.3.4 or newer, check out
126 @uref{http://www.gnu.org/software/guile/guile.html,the GUILE webpage}.
127 Version 1.4 is recommended for better performance.
131 @uref{ftp://ftp.gnu.org/gnu/make/, the GNU
134 @item Flex (version 2.5.4a or newer).
135 Check out @uref{http://www.gnu.org/software/flex/,the Flex webpage}.
137 @item Bison (version 1.25 or newer).
138 Check out @uref{http://www.gnu.org/software/bison/,the bison webpage}
142 @TeX{} is used as an output backend.
144 Also, @TeX{}'s libkpathsea is used to find the fonts (@file{.mf}, @file{.afm}, @file{.tfm}).
145 Make sure you have tetex 1.0 or newer (1.0.6 is known to work). You may
146 need to install a tetex-devel or tetex-dev package too.
148 @item Texinfo (version 4.0 or newer).
149 The documentation of lily is written in texinfo. Check out
150 @uref{ftp://ftp.gnu.org/gnu/texinfo/,the texinfo FTP directory}.
152 @item The geometry package for LaTeX is needed to use ly2dvi.
154 @uref{ftp://ftp.ctan.org/tex-archive/macros/latex/contrib/supported/geometry,the
155 FTP directory for @code{geometry}}. This package is normally included
156 with the @TeX{} distribution.
158 @item kpathsea, a library for searching (@TeX{}) files. @code{kpathsea} is
159 usually included with your installation of @TeX{}. You may need to install
160 a tetex-devel or tetex-dev package too.
162 In the very unlikely case that kpathsea is not available for your
163 platform (ie, you're not running GNU/Linux, Windows, or any recent
164 UNIX), you can compile LilyPond without kpathsea support. In that case,
165 you'll probably have to indicate where @TeX{}'s tfm files live. Invoke
166 configure something like:
169 ./configure --without-kpathsea --enable-tfm-path=/usr/share/texmf/fonts/tfm/public/cm/:/usr/share/texmf/fonts/tfm/ams/symbols
173 @item pktrace, [OPTIONAL], needed for generating PostScript Type1
174 fonts. Get it from @uref{http://www.cs.uu.nl/~hanwen/pktrace/}
176 @item autotrace-0.27a, [OPTIONAL], needed for generating PostScript Type1
177 fonts. @uref{http://autotrace.sourceforge.net}.
179 @item MetaPost [OPTIONAL] needed for generating PostScript Type3 fonts. Please
180 note that tetex-0.4pl8 (included with Red Hat 5.x) does not include
181 @file{mfplain.mp}, which is needed for producing the scalable font
184 If you don't have MetaPost and don't want to use PostScript output, then
185 edit @file{mf/GNUmakefile}, removing the line saying @code{PFA_FILES=}.
191 @subsection Running requirements
193 GNU LilyPond does use a lot of resources. For operation you need the
198 @item Xdvi and Ghostscript
199 @item GUILE 1.3.4, or newer. Check out
200 @uref{http://www.gnu.org/software/guile.html,the GUILE webpage}
203 For running LilyPond successfully you have to help @TeX{} and MetaFont find
204 various files. The recommended way of doing so is adjusting the
205 environment variables in the start-up scripts of your shell. Appropriate
206 Csh and bourne sh scripts are left in
207 @file{buildscripts/out/lilypond-profile} and
208 @file{buildscripts/out/lilypond-login} after compilation.
210 LilyPond is a big and slow program. A fast CPU and plenty of RAM is
211 recommended for comfortable use.
213 @subsection Website requirements
215 The documentation comes in the form of a website. You can view this
216 website on the internet, but you can also build it locally. This process
217 requires a successful compile of lilypond. The website is built
225 Building the website requires some additional tools:
228 @item xpmtoppm (from the netpbm package: the Portable Bitmap Utilities).
230 @uref{ftp://ftp.x.org/contrib/utilities/netpbm-1mar1994.p1.tar.gz,the
233 @item pnmtopng. The original is
235 @uref{ftp://swrinde.nde.swri.edu/pub/png/applications/pnmtopng-2.37.2.tar.gz,in
236 the pnmtopng FTP site}.
238 @item texinfo (a development release)
239 The documentation will build with texinfo-4.0, but if you want split
240 html pages, you're best off using the lates pretest version from
241 @uref{ftp://texinfo.org/texinfo/pretests/texinfo-4.0b.tar.gz,
243 @uref{ftp://alpha.gnu.org/gnu/texinfo-4.0b.tar.gz,texinfo-4.0b}
246 @section Building LilyPond
248 to install GNU LilyPond, type:
250 gunzip -c lilypond-x.y.z | tar xf -
252 ./configure # run with --help to see appropriate options
255 sh buildscripts/clean-fonts.sh
258 If you are doing an upgrade, you should remove all @file{feta}
259 @code{.pk} and @file{.tfm} files. A script has been provided to do the
260 work for you, see @file{buildscripts/clean-fonts.sh}.
263 If you are not root, you should choose a @code{--prefix} argument that
264 points into your home directory, eg.
267 ./configure --prefix=$HOME/usr
271 In this case, you have to insert the contents of
272 @code{buildscripts/out/lilypond-login} or
273 @code{buildscripts/out/lilypond-profile} into your start up scripts by
278 @subsection Configuring for multiple platforms
280 If you want to build multiple versions of LilyPond with different
281 configuration settings, you can use the @code{--enable-config=CONF}
282 option of configure. You should use @samp{make conf=CONF} to generate
283 the output in @file{out-CONF}. Example: suppose I want to build with
284 and without profiling. Then I'd use the following for the normal build,
287 ./configure --prefix=~ --enable-checking
292 and for the profiling version, I specify a different configuration.
296 ./configure --prefix=~ --enable-profiling --enable-config=prof --disable-checking
298 make conf=prof install
308 An Emacs mode for entering music and running LilyPond is included with
309 the source archive as @file{lilypond-mode.el} and
310 @file{lilypond-font-lock.el}. You should install these files somewhere
311 in your @var{load-path}. If you have installed a precompiled LilyPond
312 package, these files can be found in
313 @file{/usr/share/doc/lilypond-x.y.z/}.
315 Add this to your @file{~/.emacs} or @file{~/.emacs.el}, or install this
316 file in Emacs' @file{site-start.d}:
318 ;;; lilypond-init.el --- Startup code for LilyPond mode
320 (load-library "lilypond-mode.el")
321 (setq auto-mode-alist
322 (cons '("\\.ly$" . LilyPond-mode) auto-mode-alist))
323 (add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock)))
326 If you have the latest LilyPond-1.4.x Debian package, LilyPond-mode is
327 automatically loaded, you not even need to modify your @code{~/.emacs}
330 @section Compiling for distributions
332 @subsection Red Hat Linux
334 Red Hat 7.0 i386 RPMS are available from
335 @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/}.
337 You can also compile them yourself. A spec file is in
338 @file{make/out/lilypond.redhat.spec}. This file is distributed along
339 with the sources. You can make the rpm by issuing
342 tar xfz lilypond-x.y.z.tar.gz
343 rpm -bb lilypond-x.y.z/make/out/lilypond.redhat.spec
344 rpm -i /usr/src/redhat/RPMS/i386/lilypond-x.y.z
348 For running on a Red Hat system you need these packages: guile, tetex,
349 tetex-latex, tetex-dvips, libstdc++, python, ghostscript.
351 For compilation on a Red Hat system you need these packages, in addition
352 to the those needed for running: glibc-devel, gcc-c++, libstdc++-devel,
353 guile-devel, flex, bison, texinfo, tetex-devel, groff,
360 Some LinuxPPC RPMS should available from
361 @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/}.
363 A LinuxPPC RPM can be made using the @file{lilypond.redhat.spec} file.
367 Some SUSE RPMS should available from
368 @uref{ftp://ftp.lilypond.org/pub/LilyPond/binaries/SuSE}.
370 You can also compile a RPM for SUSE yourself. A spec file is in
371 @file{make/out/lilypond.suse.spec}, see the instructions for building
374 You must have the following packages: guile tcsh tetex te_latex te_kpath
375 te_mpost libpng python gpp libgpp gettext autoconf netpbm libnetpb
376 gs_serv gs_lib gs_fonts guile
378 @subsection Slackware
380 No precompiled packages for Slackware are available.
382 Problems have been reported with Slackware 7.0; apparently, it ships
383 with a faulty compiler. Do not compile LilyPond with -O2 on this
388 Some binaries are available at rpmfind.net. Refer to
389 @uref{http://rpmfind.net/linux/mandrake/cooker/contrib/RPMS/}.
391 You can also compile a RPM for Mandrake yourself. A spec file is in
392 @file{make/out/lilypond.mandrake.spec}, see the instructions for building
395 @subsection Debian GNU/Linux
397 A Debian package is also available. You may install it easily by running
398 @command{apt-get} as root:
401 apt-get install lilypond lilypond-doc
404 You can also compile the .deb for Debian yourself, do:
407 apt-get -b source lilypond
410 If you're real impatient, you may even do:
413 cd lilypond-x.y.z # a previous version
414 uscan # download and build latest directly from upstream
418 Debian's @TeX{} installation is a bit short on memory, you may want to
419 increase it like this:
421 --- /etc/texmf/texmf.cnf.dpkg Sun Jan 28 14:12:14 2001
422 +++ /etc/texmf/texmf.cnf Fri Apr 27 11:09:35 2001
424 main_memory.context = 1500000
425 main_memory.mpost = 1000000
426 main_memory = 263000 % words of inimemory available; also applies to inimf&mp
427 -extra_mem_top = 0 % extra high memory for chars, tokens, etc.
428 -extra_mem_bot = 0 % extra low memory for boxes, glue, breakpoints, etc.
429 +extra_mem_top = 100000 % extra high memory for chars, tokens, etc.
430 +extra_mem_bot = 100000 % extra low memory for boxes, glue, breakpoints, etc.
432 obj_tab_size.context = 256000
436 You could also export @env{extra_mem_top} and @env{extra_mem_bot} as
437 environment variables if you do not want to or cannot modify
438 @file{/etc/texmf/texmf.cnf}.
443 @item @uref{http://packages.debian.org/lilypond,http://packages.debian.org/lilypond}
444 @item @uref{http://people.debian.org/~foka/lilypond/,http://people.debian.org/~foka/lilypond/}
445 for latest semi-unofficial build of LilyPond 1.4.2 for Debian 2.2 (potato) users.
446 The official stable Debian 2.2 is stuck with the old LilyPond-1.3.24.
447 Since LilyPond-1.4 has been released, the older lilypond1.3 Debian
448 package is now obsolete.
451 Please contact Anthony Fok @email{lilypond@@packages.debian.org} for more
454 The build scripts are in the subdirectory @file{debian/}; you can
455 make the .deb by doing, for example:
459 # dpkg --purge lilypond lilypond1.3
461 $ tar xzf lilypond-1.4.3.tar.gz
463 $ dch -p -v 1.4.3-0.local.1 "Local build."
466 # dpkg -i ../lilypond_1.4.3*.deb
471 Use command @command{debuild} instead of @command{debuild -B} if you have
472 a very fast machine and want to build the HTML, PS and DVI documentation
475 For compilation on a Debian GNU/Linux system you need these packages,
476 in addition to the those needed for running:
479 @item g++, cpp, libc6-dev, libstdc++<@var{your-libstdc++-version-here}>-dev
480 @item libguile<@var{your-libguile-version-here}>-dev
481 @item make, m4, flex, bison
484 @item tetex-base, tetex-bin, tetex-extra, libkpathsea-dev or tetex-dev
485 @item dpkg-dev, debhelper, fakeroot
487 @item pnmtopng (only in Debian 2.2; pnmtopng has been merged with netpbm
488 in Debian testing/unstable.)
491 Most of these are listed on the @samp{Build-Depends} line in the
492 @file{debian/control} file. To ensure the creation of the lilypond deb is
493 trouble-free, we recommend that you first install the following packages
494 by running \@command{apt-get} as root before building the package:
499 apt-get install task-debian-devel task-c++-dev \
500 python-base libguile6-dev tetex-bin tetex-dev \
501 tetex-extra flex bison texinfo groff gs \
502 netpbm pnmtopng m4 gettext
505 For Debian in development ("unstable", the future 2.3 or 3.0):
508 apt-get install binutils cpp gcc libc6-dev \
509 g++ libstdc++2.10-dev \
510 python-base libguile-dev tetex-bin libkpathsea-dev \
511 tetex-extra flex bison texinfo groff gs \
515 And, just so that old fonts from previous versions of LilyPond won't
516 interfere with your build, you may want to do this before the build too:
519 dpkg --purge lilypond lilypond1.3
523 @c Why isn't this in BUGS (where it belongs?)
526 For help and questions use @email{lilypond-user@@gnu.org}. Please
527 consult the FAQ before mailing your problems. If you find bugs, please
528 send bug reports to @email{bug-lilypond@@gnu.org}.
530 Bugs that are not fault of LilyPond are documented here.
532 @unnumberedsubsec FLex-2.5.4a and gcc-3.0
534 Flex 2.5.4a does not produce g++-3.0 compliant C++ code. To compile
535 LilyPond with gcc-3.0 you may do:
538 CC=gcc-3.0 CXX=g++-3.0 ./configure --enable-config=gcc-3.0
539 make conf=gcc-3.0 -C lily out-gcc-3.0/lexer.cc
540 patch -p1 < lexer-gcc-3.0.patch
541 make conf=gcc-3.0 -C lily
544 Note that this is fixed in Debian/unstable for flex >= 2.5.4a-13.
548 @unnumberedsubsec Linux-2.4.0, Guile-1.4 --with-threads
550 There's a bug in certain kernels around version 2.4.0, that is
551 triggered when using Guile 1.4 compiled with pthreads. You'll see
552 random segmentation fault crashes of LilyPond. Upgrade to a newer
553 version of Linux. If you can't do that, you may try to recompiling
554 Guile without threads (YMMV):
557 guile-1.4$ ./configure --without-threads; make all install
561 @unnumberedsubsec NetBSD
564 @item The flex precompiled in NetBSD-1.4.2 is broken.
565 Download flex-2.5.4a, build, install.
567 @item The configuration of Gcc (egcs-2.91.60 19981201 (egcs-1.1.1
568 release)) does not include @file{/usr/pkg} paths. Configure using:
571 CFLAGS='-I /usr/pkg/include' LDFLAGS='-L/usr/pkg/lib' ./configure
577 @unnumberedsubsec Solaris:
580 @item Sparc64/Solaris 2.6, GNU make-3.77
582 GNU make-3.77 is buggy on this platform, upgrade to 3.78.1 or newer.
584 @item Sparc64/Solaris 2.6, ld
590 @unnumberedsubsec AIX
595 The following is from the gcc install/SPECIFIC file.
597 Some versions of the AIX binder (linker) can fail with a relocation
598 overflow severe error when the -bbigtoc option is used to link
599 GCC-produced object files into an executable that overflows the TOC.
600 A fix for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND
601 -BBIGTOC) is available from IBM Customer Support and from its
602 27service.boulder.ibm.com website as PTF U455193.
604 Binutils does not support AIX 4.3 (at least through release 2.9). GNU
605 as and GNU ld will not work properly and one should not configure GCC
606 to use those GNU utilities. Use the native AIX tools which do
607 interoperate with GCC.
610 add -Wl,-bbigtoc to USER_LDFLAGS, ie:
612 LDFLAGS='-Wl,-bbigtoc' ./configure