1 \input texinfo @c -*-texinfo-*-
2 @setfilename INSTALL.info
3 @settitle INSTALL - compiling and installing GNU LilyPond
5 @documentencoding utf-8
13 @chapter Compiling and installing on Unix
17 <a name="download-source">
22 Even numbered minor versions are `stable' (2.2, 2.4 etc), while odd
23 version are development releases (2.3, 2.5, etc). Building LilyPond
24 is an involved process. If possible
25 @uref{http://lilypond.org/download,download a precompiled binary}
28 @subsection Source code
34 @uref{http://lilypond.org/download/} by HTTP.
35 @item @uref{ftp://sca.uwaterloo.ca/pub/} by FTP (Canadian mirror).
38 CVS from @uref{http://savannah.gnu.org/cvs/?group=lilypond,savannah.gnu.org}
42 CVS_RSH=ssh cvs -d:ext:anoncvs@@savannah.gnu.org:/cvsroot/lilypond co lilypond
45 The CVS repository does not contain generated files. To create
53 For information on packaging, see @uref{http://lilypond.org/devel}.
55 @subsection Precompiled binary packages
57 Check out @uref{http://lilypond.org/download} for up to date information on
58 binary packages for your platform.
63 @subsection Compilation
65 In addition to the packages needed for running Lilypond (see below),
66 you need the following extra packages for building.
68 When installing a binary package FOO, you may need to install the
69 FOO-devel, libFOO-dev or FOO-dev package too.
73 @item @uref{http://fontforge.sf.net/,FontForge} 20041211 or newer.
75 @item @uref{http://www.xs4all.nl/~hanwen/mftrace/,mftrace} (1.1.0 or
78 You will need to install some additional packages to get mftrace to
81 @item @uref{http://www.gnu.org/software/guile/guile.html,GUILE}
82 (version 1.6.5 or newer). If you are installing binary packages, you
83 may need to install guile-devel or guile-dev or libguile-dev too.
87 @TeX{} is used as an optional output backend.
89 Also, @TeX{}'s libkpathsea is used to find the fonts (@file{.mf},
90 @file{.afm}, @file{.tfm}). Make sure you have tetex 1.0 or newer
91 (1.0.6 is known to work). If you are installing binary packages, you
92 may need to install tetex-devel, tetex-dev or libkpathsea-dev too.
95 @item @uref{ftp://ftp.gnu.org/gnu/texinfo/,Texinfo} (version 4.7 or newer).
98 @uref{http://gcc.gnu.org/, The GNU c++ compiler} (version 3.1 or
99 newer). EGCS and 2.x are known to cause crashes.
101 @item @uref{http://www.python.org,Python} (version 2.1 or newer).
103 @item @uref{ftp://ftp.gnu.org/gnu/make/,GNU Make} (version 3.78 or newer).
105 @item @uref{http://www.gnu.org/software/gettext/gettext.html,gettext}.
107 @item All packages required for running, including development packages with
108 header files and libraries.
112 @subsection Running requirements
114 Running LilyPond requires proper installation of the following
119 @item @uref{http://www.freetype.org/,Freetype} (version 2).
120 @item @uref{http://www.pango.org/,Pango} (version 1.6 or newer).
121 @item @uref{http://www.gnu.org/software/guile/guile.html,GUILE}
122 (version 1.6.5 or newer).
123 @item @uref{http://www.python.org,Python} (version 2.1 or newer).
124 @item @uref{http://www.ghostscript.com,Ghostscript} (version 8.15 or
128 @subsection Building documentation
130 You can view the documentation online at
131 @uref{http://lilypond.org/doc/}, but you can also build it locally.
132 This process requires a successful compile of lilypond. The
133 documentation is built by issuing
140 Building the website requires some additional tools and packages
143 @item @uref{http://lilypond.org/download/fonts,ec-fonts-mftraced}
144 @item The @uref{http://netpbm.sourceforge.net/,netpbm utilities}
146 @item International fonts (see input/regression/utf-8.ly for hints
147 about which font packages are necessary for your platform)
150 The HTML files can be installed into the standard documentation path
155 make out=www web-install
160 @section Building LilyPond
162 To install GNU LilyPond, type
165 gunzip -c lilypond-x.y.z | tar xf -
167 ./configure # run with --help for applicable options
173 The most time-consuming part of compiling LilyPond is tracing the
174 Type1 fonts. You can shortcut this operation by issuing
175 one of the following commands
179 make -C mf get-pfa # requires rpm2cpio
180 make -C mf get-debian-pfa # may not be up to date
184 If you are not root, you should choose a @code{--prefix} argument that
185 points into your home directory, e.g.
188 ./configure --prefix=$HOME/usr
193 In this case, you have to insert the contents of
194 @code{buildscripts/out/lilypond-login} or
195 @code{buildscripts/out/lilypond-profile} into your start up scripts by
200 @subsection Configuring for multiple platforms
202 If you want to build multiple versions of LilyPond with different
203 configuration settings, you can use the @code{--enable-config=CONF}
204 option of configure. You should use @samp{make conf=CONF} to generate
205 the output in @file{out-CONF}. Example: Suppose you want to build
206 with and without profiling, then use the following for the normal
211 ./configure --prefix=$HOME/usr/ --enable-checking
217 and for the profiling version, specify a different configuration
221 ./configure --prefix=$HOME/usr/ --enable-profiling --enable-config=prof --disable-checking
223 make conf=prof install
230 An Emacs mode for entering music and running LilyPond is contained in
231 the source archive in the @file{elisp} directory. Do @command{make
232 install} to install it to @var{elispdir}. The file @file{lilypond-init.el}
233 should be placed to @var{load-path}@file{/site-start.d/} or appended
234 to your @file{~/.emacs} or @file{~/.emacs.el}.
236 As a user, you may want add your source path (e.g. @file{~/site-lisp/}) to
237 your @var{load-path} by appending the following line (as modified) to your
239 @c any reason we do not advise: (push "~/site-lisp" load-path)
242 (setq load-path (append (list (expand-file-name "~/site-lisp")) load-path))
249 A Vim mode for entering music and running LilyPond is contained in the
250 source archive in @code{$VIM} directory. For version 6.2 and newer,
251 Vim-mode works directly after installing LilyPond. Otherwise,
252 complete the following two steps.
254 For earlier versions (and if @code{$VIM} environment variable does not
255 fall-back to @file{/usr/local/share/vim}, see @code{:version} in vim),
256 the LilyPond file type is detected if your file @file{~/.vim/filetype.vim} @c
257 has the following content
260 if exists("did_load_filetypes")
263 augroup filetypedetect
264 au! BufNewFile,BufRead *.ly setf lilypond
268 If Vim has been (pre-)installed to @file{/usr/...} (or any other place)
269 instead of @file{/usr/local/...}, then @file{/usr/local/share/vim} may not
270 be specified in your @code{$VIMRUNTIME} environment variable and you have to
271 include this path explicitly by appending the following line to your
275 set runtimepath+=/usr/local/share/vim/
281 For help and questions use @email{lilypond-user@@gnu.org}. Send bug
282 reports to @email{bug-lilypond@@gnu.org}.
284 Bugs that are not fault of LilyPond are documented here.
286 @subsection Bison 1.875
288 There is a bug in bison-1.875: compilation fails with "parse error
289 before `goto'" in line 4922 due to a bug in bison. To fix, either
290 recompile bison 1.875 with the following fix
294 $ cd lily; make out/parser.cc
295 $ vi +4919 out/parser.cc
296 # append a semicolon to the line containing "__attribute__ ((__unused__))
302 @subsection Linking to kpathsea
304 If kpathsea and the corresponding header files are installed in some
305 directory where GCC does not search by default, for example in
306 @file{/usr/local/lib/} and @file{/usr/local/include/} respectively,
307 you have to explicitly tell configure where to find it. To do this
310 @item @code{rm config.cache}
311 @item @code{export LDFLAGS=-L/usr/share/texmf/lib}
312 @item @code{export CPPFLAGS=-I/usr/share/texmf/include}
313 @item @code{./configure}
315 Once configure has found them, the paths are stored in
316 @file{config.make} and will be used even if you don't have the
317 environment variables set during make.
320 @unnumberedsubsec Gcc-3.0.4
322 Gcc 3.0.4 is flaky; upgrade GCC.
324 @unnumberedsubsec Flex-2.5.4a and gcc-3.x
326 Flex 2.5.4a does not produce g++-3.1.1 compliant C++ code. To compile
327 LilyPond with gcc-3.1.1 or higher you may do
331 CONF=gcc-3.1 ./lexer-gcc-3.1.sh
332 CPPFLAGS=-I$(pwd)/lily/out-gcc-3.1 CC=gcc-3.1 CXX=g++-3.1 \
333 ./configure --enable-config=gcc-3.1
334 CONF=gcc-3.1 ./lexer-gcc-3.1.sh
339 @unnumberedsubsec MacOS X
341 For Fink, use the following command to compile.
344 export GUILE=guile-1.6
345 export GUILE_CONFIG=guile-1.6-config
346 export PKG_CONFIG_PATH=/sw/lib/freetype219/lib/pkgconfig/:/sw/lib/fontconfig2/lib/pkgconfig/
347 ./configure --without-kpathsea
350 @unnumberedsubsec OpenBSD
354 Refer to the section ``Linking to kpathsea'': GCC on OpenBSD doesn't
355 set include paths for kpathsea.
358 @unnumberedsubsec NetBSD
361 @item The flex precompiled in NetBSD-1.4.2 is broken.
362 Upgrade to flex-2.5.4a.
365 @unnumberedsubsec Solaris
368 @item Solaris7, ./configure
370 @file{./configure} needs a POSIX compliant shell. On Solaris7,
371 @file{/bin/sh} is not yet POSIX compliant, but @file{/bin/ksh} or bash
372 is. Run configure like
375 CONFIG_SHELL=/bin/ksh ksh -c ./configure
381 CONFIG_SHELL=/bin/bash bash -c ./configure