]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/topdocs/INSTALL.texi
release: 1.5.31
[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 @html
6 <!--- @@WEB-TITLE@@=Installation Instructions --->
7 @end html
8
9 @node Top, , , (dir)
10 @top
11
12 @contents
13
14 @chapter INSTALL - compiling and installing GNU LilyPond
15
16
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}.
21
22
23 @html
24 <a name="download-source">
25 @end html
26
27 @section Downloading
28
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
33 site}.
34
35 @subsection Source code
36
37 If you want to compile LilyPond from source, download here:
38 @itemize @bullet
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.
48 @end itemize
49
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
52 from source drill.
53
54 For Red Hat Linux and SuSE Linux, @file{.spec} files are included in the
55 tarball; see instructions below.
56
57 @html
58 <a name="download-binaries">
59 @end html
60
61
62
63 @subsection Precompiled binaries
64
65 If you want to track bleeding edge development, try:
66
67 @itemize @bullet
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.
73 @end itemize
74
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
77 released.
78
79 @itemize @bullet
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/,
83 LinuxPPC}
84 @item
85 @uref{http://www.lilypond.org/gnu-windows/, Windows}
86 @end itemize
87
88 @subsection Upgrading
89
90 There are two options for upgrading sources.
91
92 @itemize
93 @item if you have an unpacked source tree of a previous version, you
94 may the patches.
95
96 @emph{If you upgrade by patching do remember to rerun autoconf after
97 applying the patch}.
98
99 @item if you have the @code{.tar.gz} file of a previous release, you can
100 use
101 @uref{ftp://ftp.xcf.berkeley.edu/pub/xdelta/, xdelta}.
102  This is much safer than using patches, and is the recommended way.
103
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
106 on the FTP site.
107 @example
108   xdelta patch lilypond-1.4.2-1.4.3.xd lilypond-1.4.2.tar.gz
109 @end example
110 @end itemize
111
112 @section Requirements
113
114 @subsection Compilation
115
116 You need the following packages to compile Lilypond.
117
118 @itemize
119 @item A reasonably new version of the GNU C++ compiler:  EGCS 1.1, GCC 2.95.2 or
120 newer. Check out @uref{ftp://ftp.gnu.org/gnu/gcc/, the gcc site}.
121
122 @item Python (version 1.5 or newer; not 2.1.x)
123 Check out @uref{http://www.python.org, the python website}.
124
125 @item GUILE 1.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.
128
129 @item GNU Make. 
130 Check out
131 @uref{ftp://ftp.gnu.org/gnu/make/, the GNU
132 make FTP directory}.
133
134 @item Flex (version 2.5.4a or newer). 
135 Check out @uref{http://www.gnu.org/software/flex/,the Flex webpage}.
136
137 @item Bison (version 1.25 or newer).
138 Check out @uref{http://www.gnu.org/software/bison/,the bison  webpage}
139
140 @item @TeX{}.
141
142 @TeX{} is used as an output backend.
143
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.
147
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}.
151
152 @item The geometry package for LaTeX is needed to use ly2dvi.  
153 It is available at
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.
157
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.
161
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:
167
168 @example
169 ./configure --without-kpathsea --enable-tfm-path=/usr/share/texmf/fonts/tfm/public/cm/:/usr/share/texmf/fonts/tfm/ams/symbols
170 @end example
171
172
173 @item pktrace, [OPTIONAL], needed for generating PostScript Type1
174 fonts. Get it from  @uref{http://www.cs.uu.nl/~hanwen/pktrace/}.  You
175 will need to install some additional packages to get pktrace to work.
176
177 @end itemize
178
179 @subsection Running requirements
180
181 GNU LilyPond does use a lot of resources. For operation you need the
182 following software
183
184 @itemize @bullet
185 @item @TeX{}.
186 @item Xdvi and Ghostscript
187 @item GUILE 1.3.4, or newer.  Check out
188 @uref{http://www.gnu.org/software/guile.html,the GUILE webpage}
189 @end itemize
190
191 For running LilyPond successfully you have to help @TeX{} and MetaFont find
192 various files.  The recommended way of doing so is adjusting the
193 environment variables in the start-up scripts of your shell. Appropriate
194 Csh and bourne sh scripts are left in
195 @file{buildscripts/out/lilypond-profile} and
196 @file{buildscripts/out/lilypond-login} after compilation.
197
198 LilyPond is a big and slow program.  A fast CPU and plenty of RAM is
199 recommended for comfortable use.
200
201 @subsection Website requirements
202
203 The documentation comes in the form of a website. You can view this
204 website on the internet, but you can also build it locally. This process
205 requires a successful compile of lilypond. The website is built 
206 by issuing
207 @example 
208
209   make web-doc
210  
211 @end example 
212
213 Building the website requires some additional tools: 
214
215 @itemize @bullet
216 @item xpmtoppm (from the netpbm package: the Portable Bitmap Utilities).
217         The original is at
218 @uref{ftp://ftp.x.org/contrib/utilities/netpbm-1mar1994.p1.tar.gz,the
219 netpbm FTP site}
220
221 @item pnmtopng. The original is
222 at
223 @uref{ftp://swrinde.nde.swri.edu/pub/png/applications/pnmtopng-2.37.2.tar.gz,in
224 the pnmtopng FTP site}.
225
226 @item texinfo (a development release)
227 The documentation will build with texinfo-4.0, but if you want split
228 html pages, you're best off using the lates pretest version from
229 @uref{ftp://texinfo.org/texinfo/pretests/texinfo-4.0b.tar.gz,
230 texinfo-4.0b} or
231 @uref{ftp://alpha.gnu.org/gnu/texinfo-4.0b.tar.gz,texinfo-4.0b}
232 @end itemize
233
234 @section Building  LilyPond
235
236 to install GNU LilyPond, type:
237 @example 
238         gunzip -c lilypond-x.y.z | tar xf -
239         cd lilypond-x.y.z
240         ./configure             # run with --help to see appropriate options
241         make
242         make install
243         sh buildscripts/clean-fonts.sh      
244 @end example 
245
246 If you are doing an upgrade, you should remove all @file{feta}
247 @code{.pk} and @file{.tfm} files.  A script has been provided to do the
248 work for you, see @file{buildscripts/clean-fonts.sh}.
249
250
251 If you are not root, you should choose a @code{--prefix} argument that
252 points into your home directory, eg.
253 @example 
254
255         ./configure --prefix=$HOME/usr
256  
257 @end example 
258
259 In this case, you have to insert the contents of
260 @code{buildscripts/out/lilypond-login} or
261 @code{buildscripts/out/lilypond-profile} into your start up scripts by
262 hand.
263
264
265
266 @subsection Configuring for multiple platforms
267
268 If you want to build multiple versions of LilyPond with different
269 configuration settings, you can use the @code{--enable-config=CONF}
270 option of configure.  You should use @samp{make conf=CONF} to generate
271 the output in @file{out-CONF}.  Example: suppose I want to build with
272 and without profiling.  Then I'd use the following for the normal build,
273 @example 
274
275       ./configure --prefix=~ --enable-checking
276       make
277       make install
278 @end example 
279
280 and for the profiling version, I specify a different configuration.
281
282 @example 
283
284       ./configure --prefix=~ --enable-profiling --enable-config=prof --disable-checking
285       make conf=prof
286       make conf=prof install
287
288 @end example 
289
290
291
292
293
294 @section Emacs mode
295
296 An Emacs mode for entering music and running LilyPond is included with
297 the source archive as @file{lilypond-mode.el} and
298 @file{lilypond-font-lock.el}.  You should install these files somewhere
299 in your @var{load-path}.  If you have installed a precompiled LilyPond
300 package, these files can be found in
301 @file{/usr/share/doc/lilypond-x.y.z/}.
302
303 Add this to your @file{~/.emacs} or @file{~/.emacs.el}, or install this
304 file in Emacs' @file{site-start.d}:
305 @example
306     ;;; lilypond-init.el --- Startup code for LilyPond mode
307
308     (load-library "lilypond-mode.el")
309     (setq auto-mode-alist
310       (cons '("\\.ly$" . LilyPond-mode) auto-mode-alist))
311     (add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock)))
312 @end example
313
314 If you have the latest LilyPond-1.4.x Debian package, LilyPond-mode is
315 automatically loaded, you not even need to modify your @code{~/.emacs}
316 file.
317
318 @section Compiling for distributions 
319
320 @subsection Red Hat Linux
321
322 Red Hat 7.0 i386 RPMS are available from
323 @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/}.
324
325 You can also compile them yourself.  A spec file is in
326 @file{make/out/lilypond.redhat.spec}. This file is distributed along
327 with the sources.  You can make the rpm by issuing
328 @example 
329
330         tar xfz lilypond-x.y.z.tar.gz
331         rpm -bb lilypond-x.y.z/make/out/lilypond.redhat.spec
332         rpm -i /usr/src/redhat/RPMS/i386/lilypond-x.y.z
333
334 @end example 
335
336 For running on a Red Hat system you need these packages: guile, tetex,
337 tetex-latex, tetex-dvips, libstdc++, python, ghostscript.
338
339 For compilation on a Red Hat system you need these packages, in addition
340 to the those needed for running: glibc-devel, gcc-c++, libstdc++-devel,
341 guile-devel, flex, bison, texinfo, tetex-devel, groff,
342 libgr-progs.
343
344
345 @subsection LinuxPPC
346
347
348 Some LinuxPPC RPMS should available from
349 @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/}.
350
351 A LinuxPPC RPM can be made using the @file{lilypond.redhat.spec} file.
352
353 @subsection SuSE
354
355 Some SUSE RPMS should available from
356 @uref{ftp://ftp.lilypond.org/pub/LilyPond/binaries/SuSE}.
357
358 You can also compile a RPM for SUSE yourself.  A spec file is in
359 @file{make/out/lilypond.suse.spec}, see the instructions for building
360 the Red Hat RPM.
361
362 You must have the following packages: guile tcsh tetex te_latex te_kpath
363 te_mpost libpng python gpp libgpp gettext autoconf netpbm libnetpb
364 gs_serv gs_lib gs_fonts guile
365
366 @subsection Slackware
367
368 No precompiled packages for Slackware are available.
369
370 Problems have been reported with Slackware 7.0; apparently, it ships
371 with a faulty compiler. Do not compile LilyPond with -O2 on this
372 platform.
373
374 @subsection Mandrake
375
376 Some binaries are available at rpmfind.net. Refer to 
377 @uref{http://rpmfind.net/linux/mandrake/cooker/contrib/RPMS/}.
378
379 You can also compile a RPM for Mandrake yourself.  A spec file is in
380 @file{make/out/lilypond.mandrake.spec}, see the instructions for building
381 the Red Hat RPM.
382
383 @subsection Debian GNU/Linux
384
385 A Debian package is also available.  You may install it easily by running
386 @command{apt-get} as root:
387 @example
388
389         apt-get install lilypond lilypond-doc
390 @end example
391
392 You can also compile the .deb for Debian yourself, do:
393 @example
394
395         apt-get -b source lilypond
396 @end example
397
398 If you're real impatient, you may even do:
399 @example
400
401         cd lilypond-x.y.z   # a previous version
402         uscan               # download and build latest directly from upstream
403 @end example
404
405
406 Debian's @TeX{} installation is a bit short on memory, you may want to
407 increase it like this:
408 @example
409 --- texmf.cnf.orig      Sun Dec 16 23:47:07 2001
410 +++ texmf.cnf   Sun Dec 16 23:46:34 2001
411 @@ -411,8 +411,8 @@
412  main_memory.context = 1500000
413  main_memory.mpost = 1000000
414  main_memory = 263000 % words of inimemory available; also applies to inimf&mp
415 -extra_mem_top = 0    % extra high memory for chars, tokens, etc.
416 -extra_mem_bot = 0    % extra low memory for boxes, glue, breakpoints, etc.
417 +extra_mem_top = 1000000    % extra high memory for chars, tokens, etc.
418 +extra_mem_bot = 1000000    % extra low memory for boxes, glue, breakpoints, etc.
419  
420  obj_tab_size.context = 300000
421  
422 @@ -430,7 +430,7 @@
423  % Max number of characters in all strings, including all error messages,
424  % help texts, font names, control sequences.  These values apply to TeX and MP.
425  pool_size.context = 750000
426 -pool_size = 125000             
427 +pool_size = 250000             
428  % Minimum pool space after TeX/MP's own strings; must be at least
429  % 25000 less than pool_size, but doesn't need to be nearly that large.
430  string_vacancies.context = 45000
431 @end example
432
433 You could also export @env{extra_mem_top} and @env{extra_mem_bot} as
434 environment variables if you do not want to or cannot modify
435 @file{/etc/texmf/texmf.cnf}.
436
437 Alternatively, visit
438
439 @itemize @bullet
440 @item @uref{http://packages.debian.org/lilypond,http://packages.debian.org/lilypond}
441 @item @uref{http://people.debian.org/~foka/lilypond/,http://people.debian.org/~foka/lilypond/}
442 for latest semi-unofficial build of LilyPond 1.4.2 for Debian 2.2 (potato) users.
443 The official stable Debian 2.2 is stuck with the old LilyPond-1.3.24.
444 Since LilyPond-1.4 has been released, the older lilypond1.3 Debian
445 package is now obsolete.
446 @end itemize
447
448 Please contact Anthony Fok @email{lilypond@@packages.debian.org} for more
449 information.
450
451 The build scripts are in the subdirectory @file{debian/}; you can
452 make the .deb by doing, for example:
453
454 @example
455         $ su - root
456         # dpkg --purge lilypond lilypond1.3
457         # exit
458         $ tar xzf lilypond-1.4.3.tar.gz
459         $ cd lilypond-1.4.3
460         $ dch -p -v 1.4.3-0.local.1 "Local build."
461         $ debuild -B
462         $ su - root
463         # dpkg -i ../lilypond_1.4.3*.deb
464         # exit
465         $
466 @end example
467
468 Use command @command{debuild} instead of @command{debuild -B} if you have
469 a very fast machine and want to build the HTML, PS and DVI documentation
470 too.
471
472 For compilation on a Debian GNU/Linux system you need these packages,
473 in addition to the those needed for running:
474
475 @itemize @bullet
476 @item g++, cpp, libc6-dev, libstdc++<@var{your-libstdc++-version-here}>-dev
477 @item libguile<@var{your-libguile-version-here}>-dev
478 @item make, m4, flex, bison
479 @item gettext
480 @item groff, texinfo
481 @item tetex-base, tetex-bin, tetex-extra, libkpathsea-dev or tetex-dev
482 @item dpkg-dev, debhelper, fakeroot
483 @item gs, netpbm
484 @item pnmtopng (only in Debian 2.2; pnmtopng has been merged with netpbm
485   in Debian testing/unstable.)
486 @end itemize
487
488 Most of these are listed on the @samp{Build-Depends} line in the
489 @file{debian/control} file.  To ensure the creation of the lilypond deb is
490 trouble-free, we recommend that you first install the following packages
491 by running \@command{apt-get} as root before building the package:
492
493 For Debian 2.2:
494
495 @example
496         apt-get install task-debian-devel task-c++-dev \
497                 python-base libguile6-dev tetex-bin tetex-dev \
498                 tetex-extra flex bison texinfo groff gs \
499                 netpbm pnmtopng m4 gettext
500 @end example
501
502 For Debian in development ("unstable", the future 2.3 or 3.0):
503
504 @example
505         apt-get install binutils cpp gcc libc6-dev \
506                 g++ libstdc++2.10-dev \
507                 python-base libguile-dev tetex-bin libkpathsea-dev \
508                 tetex-extra flex bison texinfo  groff gs \
509                 netpbm m4 gettext
510 @end example
511
512 And, just so that old fonts from previous versions of LilyPond won't
513 interfere with your build, you may want to do this before the build too:
514
515 @example
516         dpkg --purge lilypond lilypond1.3
517 @end example
518
519
520 @c Why isn't this in BUGS (where it belongs?)
521 @section Problems
522
523 For help and questions use @email{lilypond-user@@gnu.org}.  Please
524 consult the FAQ before mailing your problems.  If you find bugs, please
525 send bug reports to @email{bug-lilypond@@gnu.org}.
526
527 Bugs that are not fault of LilyPond are documented here.
528
529 @unnumberedsubsec FLex-2.5.4a and gcc-3.0
530
531 Flex 2.5.4a does not produce g++-3.0 compliant C++ code.  To compile
532 LilyPond with gcc-3.0 you may do:
533
534 @example
535         CC=gcc-3.0 CXX=g++-3.0 ./configure --enable-config=gcc-3.0
536         make conf=gcc-3.0 -C lily out-gcc-3.0/lexer.cc
537         patch -p1 < lexer-gcc-3.0.patch
538         make conf=gcc-3.0 -C lily
539 @end example
540
541 Note that this is fixed in Debian/unstable for flex >= 2.5.4a-13.
542
543 @unnumberedsubsec Python-2.1[.1]
544
545 Regular expressions are broken in Python 2.1.[.1], either upgrade or
546 downgrade python.
547
548 @unnumberedsubsec Linux-2.4.0, Guile-1.4 --with-threads
549
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):
555
556 @example
557          guile-1.4$ ./configure --without-threads; make all install
558 @end example
559
560
561 @unnumberedsubsec NetBSD
562
563 @itemize @bullet
564 @item The flex precompiled in NetBSD-1.4.2 is broken.
565 Download flex-2.5.4a, build, install.
566
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:
569 @example
570
571 CFLAGS='-I /usr/pkg/include' LDFLAGS='-L/usr/pkg/lib' ./configure
572
573 @end example
574
575 @end itemize
576
577 @unnumberedsubsec  Solaris:
578
579 @itemize @bullet
580 @item Sparc64/Solaris 2.6, GNU make-3.77
581
582 GNU make-3.77 is buggy on this platform, upgrade to 3.78.1 or newer.
583
584 @item Sparc64/Solaris 2.6, ld
585
586 Not yet resolved.
587 @end itemize
588
589
590 @unnumberedsubsec   AIX
591
592 @itemize @bullet
593 @item AIX 4.3 ld
594
595 The following is from the gcc install/SPECIFIC file.
596 @quotation
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.   
603
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.
608 @end quotation
609
610 add -Wl,-bbigtoc to USER_LDFLAGS, ie:
611 @example
612     LDFLAGS='-Wl,-bbigtoc' ./configure
613 @end example
614
615 @end itemize
616
617
618 @bye
619