3 @comment node-name, next, previous, up\input texinfo @c -*-texinfo-*-
4 @setfilename INSTALL.info
5 @settitle INSTALL - compiling and installing GNU LilyPond
7 @comment FIXME -- this information is getting rather stale
11 @chapter Compiling and installing on Unix
15 <a name="download-source">
20 Even numbered versions are `stable' (2.0, 1.8 etc), while odd version
21 are development releases (2.1, 1.9, etc). Building LilyPond is an
22 involved process, so if possible, download a precompiled binary from
23 @uref{http://lilypond.org/,the lilypond site}.
26 @subsection Source code
28 Download source tarballs from here:
30 @item Download development releases from
31 @uref{http://lilypond.org/download/} by HTTP.
32 @item @uref{ftp://sca.uwaterloo.ca/pub/} by FTP (Canadian mirror).
36 Use Xdelta to patch tarballs, e.g. to patch
37 @file{lilypond-1.4.2.tar.gz} to @file{lilypond-1.4.3.tar.gz}, do
39 xdelta patch lilypond-1.4.2-1.4.3.xd lilypond-1.4.2.tar.gz
42 For information on packaging and CVS, see
43 @uref{http://lilypond.org/}, under ``development''.
46 @subsection Precompiled binaries
48 Check out @uref{http://lilypond.org} for up to date information on
52 @subsection Font problems
54 If you are upgrading from a previous version of LilyPond, be sure to
55 remove all old font files. These include @file{.pk} and @file{.tfm} files
56 that may be located in @file{/var/lib/texmf}, @file{/var/spool/texmf},
57 @file{/var/tmp/texmf} or @file{@var{prefix}/share/lilypond/fonts/}. A
58 script automating this has been included, see
59 @file{buildscripts/clean-fonts.sh}.
66 @subsection Compilation
68 You need the following packages to compile LilyPond:
72 @item @uref{http://www.xs4all.nl/~hanwen/mftrace/,mftrace} (1.0.17 or
75 You will need to install some additional packages to get mftrace to
78 @item @uref{http://www.gnu.org/software/guile/guile.html,GUILE} (version 1.6.0 or newer).
79 If you are installing a binary packages, you may need to install
80 guile-devel or guile-dev or libguile-dev too.
82 @item @uref{http://www.gnu.org/software/flex/,Flex} (version 2.5.4a or newer).
84 WARNING: plain Flex 2.5.4(a) generates invalid C++ code. GCC 3.x
85 chokes on this. If you wish to use GCC 3.x, make sure that your
86 distribution supports g++ 3.x and flex. For workarounds, see
87 lexer-gcc-3.1.sh in the source directory.
91 @TeX{} is used as an output backend.
93 Also, @TeX{}'s libkpathsea is used to find the fonts (@file{.mf},
94 @file{.afm}, @file{.tfm}). Make sure you have tetex 1.0 or newer
95 (1.0.6 is known to work). If you are installing binary packages, you
96 may need to install tetex-devel, tetex-dev or libkpathsea-dev too.
98 @item @uref{ftp://ftp.gnu.org/gnu/texinfo/,Texinfo} (version 4.7 or newer).
100 @item kpathsea, a library for searching (@TeX{}) files.
103 @uref{http://gcc.gnu.org/, The GNU c++ compiler} (version 3.1 or
104 newer). EGCS and 2.x are known to cause crashes.
106 @item @uref{http://www.python.org,Python} (version 2.1 or newer).
108 @item @uref{ftp://ftp.gnu.org/gnu/make/,GNU Make} (version 3.78 or newer).
110 @item @uref{http://www.gnu.org/software/bison/,Bison} (version 1.25 or
111 newer, but not 1.50 or 1.75).
113 @item @uref{http://www.gnu.org/software/gettext/gettext.html,gettext}.
116 @subsection Running requirements
118 GNU LilyPond does use a lot of resources. For operation you need the
122 @item @uref{http://lilypond.org/download/fonts,ec-fonts-mftraced} (version 1.0.5 or newer).
123 @item @uref{http://www.gnu.org/software/guile/guile.html,GUILE} (version 1.6.0 or newer).
124 @item @uref{http://www.python.org,Python} (version 2.1 or newer).
126 @item Xdvi and Ghostscript.
129 You have to help @TeX{} and MetaFont find LilyPond support
130 files. After compiling, scripts to do this can be found in
131 @file{buildscripts/out/lilypond-profile} and
132 @file{buildscripts/out/lilypond-login}.
134 @subsection Building documentation
136 You can view the documentation online at
137 @uref{http://lilypond.org/doc/}, but you can also build it
138 locally. This process requires a successful compile of lilypond. The
139 documentation is built by issuing:
144 Building the website requires some additional tools and packages:
147 @item @uref{http://lilypond.org/download/fonts,ec-fonts-mftraced}
148 @item The @uref{http://netpbm.sourceforge.net/,netpbm utilities}
152 The HTML files can be installed into the standard documentation path
156 make out=www web-install
160 @section Building LilyPond
162 To install GNU LilyPond, type
164 gunzip -c lilypond-x.y.z | tar xf -
166 ./configure # run with --help to see appropriate options
169 sh buildscripts/clean-fonts.sh
172 The most time-consuming part of compiling LilyPond is tracing the
173 Type1 fonts. You can shortcut this operation by issuing
174 one of the following commands:
177 make -C mf get-pfa # requires rpm2cpio
178 make -C mf get-debian-pfa # may not be up to date
181 If you are doing an upgrade, you should remove all @file{feta}
182 @code{.pk} and @code{.tfm} files. A script has been provided to do the
183 work for you, see @file{buildscripts/clean-fonts.sh}.
185 If you are not root, you should choose a @code{--prefix} argument that
186 points into your home directory, e.g.:
188 ./configure --prefix=$HOME/usr
191 In this case, you have to insert the contents of
192 @code{buildscripts/out/lilypond-login} or
193 @code{buildscripts/out/lilypond-profile} into your start up scripts by
198 @subsection Configuring for multiple platforms
200 If you want to build multiple versions of LilyPond with different
201 configuration settings, you can use the @code{--enable-config=CONF}
202 option of configure. You should use @samp{make conf=CONF} to generate
203 the output in @file{out-CONF}. Example: Suppose I want to build with
204 and without profiling. Then I'd use the following for the normal
208 ./configure --prefix=$HOME/usr/ --enable-checking
213 and for the profiling version, I specify a different configuration:
216 ./configure --prefix=$HOME/usr/ --enable-profiling --enable-config=prof --disable-checking
218 make conf=prof install
225 An Emacs mode for entering music and running LilyPond is contained in
226 the source archive in the @file{elisp} directory. Do @command{make
227 install} to install it to @var{elispdir}. The file @file{lilypond-init.el}
228 should be placed to @var{load-path}@file{/site-start.d/} or appended
229 to your @file{~/.emacs} or @file{~/.emacs.el}.
231 As a user, you may want add your source path (e.g. @file{~/site-lisp/}) to
232 your @var{load-path} by appending the following line (as modified) to your
234 @c any reason we do not advise: (push "~/site-lisp" load-path)
237 (setq load-path (append (list (expand-file-name "~/site-lisp")) load-path))
244 A Vim mode for entering music and running LilyPond is contained in the
245 source archive in @code{$VIM} directory. For version 6.2 and newer,
246 Vim-mode works directly after installing LilyPond. Otherwise,
247 complete the following two steps.
249 For earlier versions (and if @code{$VIM} environment variable does not
250 fall-back to @file{/usr/local/share/vim}, see @code{:version} in vim),
251 the LilyPond file type is detected if your file @file{~/.vim/filetype.vim} @c
252 has the following content:
254 if exists("did_load_filetypes")
257 augroup filetypedetect
258 au! BufNewFile,BufRead *.ly setf lilypond
261 If Vim has been (pre-)installed to @file{/usr/...} (or any other place)
262 instead of @file{/usr/local/...}, then @file{/usr/local/share/vim} may not
263 be specified in your @code{$VIMRUNTIME} environment variable and you have to
264 include this path explicitly by appending the following line to your
267 set runtimepath+=/usr/local/share/vim/
272 For help and questions use @email{lilypond-user@@gnu.org}. Send bug
273 reports to @email{bug-lilypond@@gnu.org}.
275 Bugs that are not fault of LilyPond are documented here.
277 @subsection Bison 1.875
279 There is a bug in bison-1.875: compilation fails with "parse error
280 before `goto'" in line 4922 due to a bug in bison. To fix, either
281 recompile bison 1.875 with the following fix:
284 $ cd lily; make out/parser.cc
285 $ vi +4919 out/parser.cc
286 # append a semicolon to the line containing "__attribute__ ((__unused__))
291 @subsection Linking to kpathsea
293 If kpathsea and the corresponding header files are installed in some
294 directory where GCC does not search by default, for example in
295 @file{/usr/local/lib/} and @file{/usr/local/include/} respectively,
296 you have to explicitly tell configure where to find it. To do this:
299 @item @code{rm config.cache}
300 @item @code{export LDFLAGS=-L/usr/share/texmf/lib}
301 @item @code{export CPPFLAGS=-I/usr/share/texmf/include}
302 @item @code{./configure}
304 Once configure has found them, the paths are stored in
305 @file{config.make} and will be used even if you don't have the
306 environment variables set during make.
309 @unnumberedsubsec Gcc-3.0.4
311 Gcc 3.0.4 is flaky; upgrade GCC.
313 @unnumberedsubsec Flex-2.5.4a and gcc-3.x
315 Flex 2.5.4a does not produce g++-3.1.1 compliant C++ code. To compile
316 LilyPond with gcc-3.1.1 you may do
319 CONF=gcc-3.1 ./lexer-gcc-3.1.sh
320 CPPFLAGS=-I$(pwd)/lily/out-gcc-3.1 CC=gcc-3.1 CXX=g++-3.1 \
321 ./configure --enable-config=gcc-3.1
322 CONF=gcc-3.1 ./lexer-gcc-3.1.sh
327 @unnumberedsubsec OpenBSD
331 Refer to the section ``Linking to kpathsea'': GCC on OpenBSD doesn't
332 set include paths for kpathsea.
335 @unnumberedsubsec NetBSD
338 @item The flex precompiled in NetBSD-1.4.2 is broken.
339 Upgrade to flex-2.5.4a.
342 @unnumberedsubsec Solaris
345 @item Solaris7, ./configure
347 @file{./configure} needs a POSIX compliant shell. On Solaris7,
348 @file{/bin/sh} is not yet POSIX compliant, but @file{/bin/ksh} or bash
349 is. Run configure like:
351 CONFIG_SHELL=/bin/ksh ksh -c ./configure
355 CONFIG_SHELL=/bin/bash bash -c ./configure