]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/topdocs/INSTALL.texi
(Top): add perl flex bison.
[lilypond.git] / Documentation / topdocs / INSTALL.texi
1 \input texinfo @c -*-texinfo-*-
2 @setfilename INSTALL.info
3 @settitle INSTALL - compiling and installing GNU LilyPond
4
5 @documentencoding utf-8
6 @documentlanguage en
7
8 @node Top
9 @top
10
11 @contents
12
13 @chapter Compiling and installing on Unix
14
15
16 @html
17 <a name="download-source">
18 @end html
19
20 @section Downloading
21
22 Even numbered minor versions are `stable' (2.4, 2.6 etc), while odd
23 version are development releases (2.5, 2.7, etc).  Building LilyPond
24 is an involved process.  If possible
25 @uref{http://lilypond.org/download,download a precompiled binary}
26 for your platform.
27
28 @subsection Source code
29
30 Download source
31 @itemize @bullet
32 @item tarballs from
33 @itemize @bullet
34 @uref{http://lilypond.org/download/} by HTTP.
35 @item @uref{ftp://sca.uwaterloo.ca/pub/} by FTP (Canadian mirror).
36 @end itemize
37 @item 
38 CVS from @uref{http://savannah.gnu.org/cvs/?group=lilypond,savannah.gnu.org}
39 @itemize @bullet
40 @c @quotation
41 @example
42 CVS_RSH=ssh cvs -d:ext:anoncvs@@savannah.gnu.org:/cvsroot/lilypond co lilypond
43 @end example
44 @c @end quotation
45 The CVS repository does not contain generated files.  To create
46 @file{configure}, run
47 @example
48 ./autogen.sh
49 @end example
50 @end itemize
51 @end itemize
52
53 For information on packaging, see @uref{http://lilypond.org/devel}.
54
55 @subsection Precompiled binary packages
56
57 Check out @uref{http://lilypond.org/web/install/} for up to date
58 information on binary packages for your platform.
59
60
61 @section Requirements
62
63 @subsection Compilation
64
65 In addition to the packages needed for running Lilypond (see below),
66 you need the following extra packages for building.
67
68 When installing a binary package FOO, you may need to install the
69 FOO-devel, libFOO-dev or FOO-dev package too.
70
71 @itemize
72
73 @item @uref{http://fontforge.sf.net/,FontForge} 20050624 or newer.
74
75 @item @uref{http://www.xs4all.nl/~hanwen/mftrace/,mftrace} (1.1.9 or
76 newer),
77
78 You will need to install some additional packages to get mftrace to
79 work.
80
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.
84
85 @item @uref{ftp://ftp.gnu.org/gnu/texinfo/,Texinfo} (version 4.8 or newer).
86
87 @item
88  @uref{http://gcc.gnu.org/, The GNU c++ compiler} (version 3.3 or
89 newer).  EGCS and 2.x are known to cause crashes.
90
91 @item @uref{http://www.python.org,Python} (version 2.1 or newer).
92
93 @item @uref{ftp://ftp.gnu.org/gnu/make/,GNU Make} (version 3.78 or newer).
94
95 @item @uref{http://www.gnu.org/software/gettext/gettext.html,gettext}.
96
97
98 @item @uref{http://www.gnu.org/software/flex/,Flex} 
99
100 @item @uref{http://www.perl.org/,Perl} 
101
102 @item @uref{http://www.gnu.org/software/flex/,GNU Bison} 
103
104 @item All packages required for running, including development packages with
105 header files and libraries.
106
107 @end itemize
108
109 @subsection Running requirements
110
111 Running LilyPond requires proper installation of the following
112 software
113
114 @itemize @bullet
115
116 @item @uref{http://www.freetype.org/,Freetype} (version 2).
117 @item @uref{http://www.freetype.org/,FontConfig} (version 2.2).
118 @item @uref{http://www.pango.org/,Pango} (version 1.6 or newer).
119 @item @uref{http://www.gnu.org/software/guile/guile.html,GUILE}
120 (version 1.6.5 or newer).
121 @item @uref{http://www.python.org,Python} (version 2.1 or newer).
122 @item @uref{http://www.ghostscript.com,Ghostscript} (version 8.15 or
123 newer)
124 @end itemize
125
126 @subsection Building documentation
127
128 You can view the documentation online at
129 @uref{http://lilypond.org/doc/}, but you can also build it locally.
130 This process requires a successful compile of lilypond.  The
131 documentation is built by issuing
132 @quotation
133 @example
134 make web
135 @end example
136 @end quotation
137
138 Building the website requires some additional tools and packages
139
140 @itemize @bullet
141 @item The @uref{http://netpbm.sourceforge.net/,netpbm utilities}
142 @item ImageMagick
143 @item International fonts (see input/regression/utf-8.ly for hints
144 about which font packages are necessary for your platform)
145 @item Ghostscript, 8.15 with the patch from
146 @uref{http://bugs.ghostscript.com/show_bug.cgi?id=688154}
147
148 @end itemize
149
150 The HTML files can be installed into the standard documentation path
151 by issuing
152
153 @quotation
154 @example
155 make out=www web-install
156 @end example
157 @end quotation
158
159
160 @section Building LilyPond
161
162 To install GNU LilyPond, type
163 @quotation
164 @example
165 gunzip -c lilypond-x.y.z | tar xf -
166 cd lilypond-x.y.z
167 ./configure             # run with --help for applicable options
168 make
169 make install
170 @end example
171 @end quotation
172
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
176
177 @quotation
178 @example
179 make -C mf get-pfa                # requires rpm2cpio
180 make -C mf get-debian-pfa         # may not be up to date
181 @end example
182 @end quotation
183
184 If you are not root, you should choose a @code{--prefix} argument that
185 points into your home directory, e.g.
186 @quotation
187 @example
188 ./configure --prefix=$HOME/usr
189 @end example
190 @end quotation
191
192
193 @subsection Configuring for multiple platforms
194
195 If you want to build multiple versions of LilyPond with different
196 configuration settings, you can use the @code{--enable-config=CONF}
197 option of configure.  You should use @samp{make conf=CONF} to generate
198 the output in @file{out-CONF}.  Example: Suppose you want to build
199 with and without profiling, then use the following for the normal
200 build
201
202 @quotation
203 @example
204 ./configure --prefix=$HOME/usr/ --enable-checking
205 make
206 make install
207 @end example
208 @end quotation
209
210 and for the profiling version, specify a different configuration
211
212 @quotation
213 @example
214 ./configure --prefix=$HOME/usr/ --enable-profiling --enable-config=prof --disable-checking
215 make conf=prof
216 make conf=prof install
217 @end example
218 @end quotation
219
220
221 @section Emacs mode
222
223 An Emacs mode for entering music and running LilyPond is contained in
224 the source archive in the @file{elisp} directory.  Do @command{make
225 install} to install it to @var{elispdir}.  The file @file{lilypond-init.el}
226 should be placed to @var{load-path}@file{/site-start.d/} or appended
227 to your @file{~/.emacs} or @file{~/.emacs.el}.
228
229 As a user, you may want add your source path (e.g. @file{~/site-lisp/}) to
230 your @var{load-path} by appending the following line (as modified) to your
231 @file{~/.emacs}
232 @c any reason we do not advise:  (push "~/site-lisp" load-path)
233 @quotation
234 @example
235 (setq load-path (append (list (expand-file-name "~/site-lisp")) load-path))
236 @end example
237 @end quotation
238
239
240 @section Vim mode
241
242 A Vim mode for entering music and running LilyPond is contained in the
243 source archive in @code{$VIM} directory.
244
245 The LilyPond file type is detected if the file @file{~/.vim/filetype.vim} @c
246 has the following content
247 @quotation
248 @example
249 if exists("did_load_filetypes")
250   finish
251 endif
252 augroup filetypedetect
253   au! BufNewFile,BufRead *.ly           setf lilypond
254 augroup END
255 @end example
256 @end quotation
257
258 Please include this path by appending the following line to your
259 @file{~/.vimrc}
260
261 @quotation
262 @example
263 set runtimepath+=/usr/local/share/lilypond/$@{LILYPOND_VERSION@}/vim/
264 @end example
265 @end quotation
266
267 @noindent
268 where $@{LILYPOND_VERISON@} is your lilypond version.  If Lilypond was not
269 installed in @file{/usr/local/}, then change this path accordingly.
270
271
272 @section Problems
273
274 For help and questions use @email{lilypond-user@@gnu.org}.  Send bug
275 reports to @email{bug-lilypond@@gnu.org}.
276
277 Bugs that are not fault of LilyPond are documented here.
278
279 @subsection Bison 1.875
280
281 There is a bug in bison-1.875: compilation fails with "parse error
282 before `goto'" in line 4922 due to a bug in bison. To fix, please
283 recompile bison 1.875 with the following fix
284
285 @quotation
286 @example
287 $ cd lily; make out/parser.cc
288 $ vi +4919 out/parser.cc
289 # append a semicolon to the line containing "__attribute__ ((__unused__))
290 # save
291 $ make
292 @end example
293 @end quotation
294
295 @subsection Linking to kpathsea
296
297 If kpathsea and the corresponding header files are installed in some
298 directory where GCC does not search by default, for example in
299 @file{/usr/local/lib/} and @file{/usr/local/include/} respectively,
300 you have to explicitly tell configure where to find it.  To do this
301
302 @itemize
303 @item @code{rm config.cache}
304 @item @code{export LDFLAGS=-L/usr/share/texmf/lib}
305 @item @code{export CPPFLAGS=-I/usr/share/texmf/include}
306 @item @code{./configure}
307 @end itemize
308 Once configure has found them, the paths are stored in
309 @file{config.make} and will be used even if you don't have the
310 environment variables set during make.
311
312
313 @unnumberedsubsec Gcc-3.0.4
314
315 Gcc 3.0.4 is flaky; upgrade GCC.
316
317 @unnumberedsubsec Flex-2.5.4a and gcc-3.x
318
319 Flex 2.5.4a does not produce g++-3.1.1 compliant C++ code.  To compile
320 LilyPond with gcc-3.1.1 or higher you may do
321
322 @quotation
323 @example
324 CONF=gcc-3.1 ./lexer-gcc-3.1.sh
325 CPPFLAGS=-I$(pwd)/lily/out-gcc-3.1 CC=gcc-3.1 CXX=g++-3.1 \
326 ./configure --enable-config=gcc-3.1
327 CONF=gcc-3.1 ./lexer-gcc-3.1.sh
328 make conf=gcc-3.1
329 @end example
330 @end quotation
331
332 @unnumberedsubsec MacOS X
333
334 For Fink, use the following command to compile.
335
336 @verbatim
337 export GUILE=guile-1.6
338 export GUILE_CONFIG=guile-1.6-config
339 export PKG_CONFIG_PATH=/sw/lib/freetype219/lib/pkgconfig/:/sw/lib/fontconfig2/lib/pkgconfig/
340 ./configure --without-kpathsea
341 @end verbatim
342
343 @unnumberedsubsec OpenBSD
344
345 @itemize @bullet
346 @item
347 Refer to the section ``Linking to kpathsea'': GCC on OpenBSD doesn't
348 set include paths for kpathsea.
349 @end itemize
350
351 @unnumberedsubsec NetBSD
352
353 @itemize @bullet
354 @item The flex precompiled in NetBSD-1.4.2 is broken.
355 Upgrade to flex-2.5.4a.
356 @end itemize
357
358 @unnumberedsubsec  Solaris
359
360 @itemize @bullet
361 @item Solaris7, ./configure
362
363 @file{./configure} needs a POSIX compliant shell.  On Solaris7,
364 @file{/bin/sh} is not yet POSIX compliant, but @file{/bin/ksh} or bash
365 is.  Run configure like
366 @quotation
367 @example
368         CONFIG_SHELL=/bin/ksh ksh -c ./configure
369 @end example
370 @end quotation
371 or
372 @quotation
373 @example
374         CONFIG_SHELL=/bin/bash bash -c ./configure
375 @end example
376 @end quotation
377
378 @end itemize
379
380 @bye
381