]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/topdocs/INSTALL.texi
45eb1b5e4558abedba50e14787210e7eb539aa14
[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 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 1.5,
123 Check out @uref{http://www.python.org, the python website}.
124
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.
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
175  @uref{http://www.cs.uu.nl/~hanwen/public/software/pktrace-0.1.tar.gz}
176
177 @item autotrace-0.27a, [OPTIONAL], needed for generating PostScript Type1
178 fonts. You must apply the patch included pktrace-0.1 first.
179 @uref{http://autotrace.sourceforge.net}.
180  
181 @item MetaPost [OPTIONAL] needed for generating PostScript Type3 fonts. Please
182 note that tetex-0.4pl8 (included with Red Hat 5.x) does not include
183 @file{mfplain.mp}, which is needed for producing the scalable font
184 files.
185
186 If you don't have MetaPost and don't want to use PostScript output, then
187 edit @file{mf/GNUmakefile}, removing the line saying @code{PFA_FILES=}.
188
189
190
191 @end itemize
192
193 @subsection Running requirements
194
195 GNU LilyPond does use a lot of resources. For operation you need the
196 following software
197
198 @itemize @bullet
199 @item @TeX{}.
200 @item Xdvi and Ghostscript
201 @item GUILE 1.3.4, or newer.  Check out
202 @uref{http://www.gnu.org/software/guile.html,the GUILE webpage}
203 @end itemize
204
205 For running LilyPond successfully you have to help @TeX{} and MetaFont find
206 various files.  The recommended way of doing so is adjusting the
207 environment variables in the start-up scripts of your shell. Appropriate
208 Csh and bourne sh scripts are left in
209 @file{buildscripts/out/lilypond-profile} and
210 @file{buildscripts/out/lilypond-login} after compilation.
211
212 LilyPond is a big and slow program.  A fast CPU and plenty of RAM is
213 recommended for comfortable use.
214
215 @subsection Website requirements
216
217 The documentation comes in the form of a website. You can view this
218 website on the internet, but you can also build it locally. This process
219 requires a successful compile of lilypond. The website is built 
220 by issuing
221 @example 
222
223   make web-doc
224  
225 @end example 
226
227 Building the website requires some additional tools: 
228
229 @itemize @bullet
230 @item xpmtoppm (from the netpbm package: the Portable Bitmap Utilities).
231         The original is at
232 @uref{ftp://ftp.x.org/contrib/utilities/netpbm-1mar1994.p1.tar.gz,the
233 netpbm FTP site}
234
235 @item pnmtopng. The original is
236 at
237 @uref{ftp://swrinde.nde.swri.edu/pub/png/applications/pnmtopng-2.37.2.tar.gz,in
238 the pnmtopng FTP site}.
239
240 @item @uref{http://www.lri.fr/~filliatr/ftp/bibtex2html/, Bibtex2html}, or
241 @uref{http://www.uni-koblenz.de/ag-ki/ftp/bib2html/, Bib2html}.
242 Bibtex2html is available in debian, while bib2html is in some rpm based
243 distributions.
244 Bib2html, in turn depends on man2html for proper installation.
245 man2html can be had from @uref{http://askdonald.ask.uni-karlsruhe.de/hppd/hpux/Networking/WWW/Man2html-1.05,http://askdonald.ask.uni-karlsruhe.de/hppd/hpux/Networking/WWW/Man2html-1.05}.
246
247 The website will build without bib converter utility, but you will not
248 see our hypertextified bibliography.
249
250 @item texinfo (a development release)
251 The documentation will build with texinfo-4.0, but if you want split
252 html pages, you're best off using the lates pretest version from
253 @uref{ftp://texinfo.org/texinfo/pretests/texinfo-4.0b.tar.gz,
254 texinfo-4.0b} or
255 @uref{ftp://alpha.gnu.org/gnu/texinfo-4.0b.tar.gz,texinfo-4.0b}
256 @end itemize
257
258 @section Building  LilyPond
259
260 to install GNU LilyPond, type:
261 @example 
262         gunzip -c lilypond-x.y.z | tar xf -
263         cd lilypond-x.y.z
264         ./configure             # run with --help to see appropriate options
265         make
266         make install
267         sh buildscripts/clean-fonts.sh      
268 @end example 
269
270 If you are doing an upgrade, you should remove all @file{feta}
271 @code{.pk} and @file{.tfm} files.  A script has been provided to do the
272 work for you, see @file{buildscripts/clean-fonts.sh}.
273
274
275 If you are not root, you should choose a @code{--prefix} argument that
276 points into your home directory, eg.
277 @example 
278
279         ./configure --prefix=$HOME/usr
280  
281 @end example 
282
283 In this case, you have to insert the contents of
284 @code{buildscripts/out/lilypond-login} or
285 @code{buildscripts/out/lilypond-profile} into your start up scripts by
286 hand.
287
288
289
290 @subsection Configuring for multiple platforms
291
292 If you want to build multiple versions of LilyPond with different
293 configuration settings, you can use the @code{--enable-config=CONF}
294 option of configure.  You should use @samp{make conf=CONF} to generate
295 the output in @file{out-CONF}.  Example: suppose I want to build with
296 and without profiling.  Then I'd use the following for the normal build,
297 @example 
298
299       ./configure --prefix=~ --enable-checking
300       make
301       make install
302 @end example 
303
304 and for the profiling version, I specify a different configuration.
305
306 @example 
307
308       ./configure --prefix=~ --enable-profiling --enable-config=prof --disable-checking
309       make conf=prof
310       make conf=prof install
311
312 @end example 
313
314
315
316
317
318 @section Emacs mode
319
320 An Emacs mode for entering music and running LilyPond is included with
321 the source archive as @file{lilypond-mode.el} and
322 @file{lilypond-font-lock.el}.  You should install these files somewhere
323 in your @var{load-path}.  If you have installed a precompiled LilyPond
324 package, these files can be found in
325 @file{/usr/share/doc/lilypond-x.y.z/}.
326
327 Add this to your @file{~/.emacs} or @file{~/.emacs.el}, or install this
328 file in Emacs' @file{site-start.d}:
329 @example
330     ;;; lilypond-init.el --- Startup code for LilyPond mode
331
332     (load-library "lilypond-mode.el")
333     (setq auto-mode-alist
334       (cons '("\\.ly$" . LilyPond-mode) auto-mode-alist))
335     (add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock)))
336 @end example
337
338 If you have the latest LilyPond-1.4.x Debian package, LilyPond-mode is
339 automatically loaded, you not even need to modify your @code{~/.emacs}
340 file.
341
342 @section Compiling for distributions 
343
344 @subsection Red Hat Linux
345
346 Red Hat 7.0 i386 RPMS are available from
347 @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/}.
348
349 You can also compile them yourself.  A spec file is in
350 @file{make/out/lilypond.redhat.spec}. This file is distributed along
351 with the sources.  You can make the rpm by issuing
352 @example 
353
354         tar xfz lilypond-x.y.z.tar.gz
355         rpm -bb lilypond-x.y.z/make/out/lilypond.redhat.spec
356         rpm -i /usr/src/redhat/RPMS/i386/lilypond-x.y.z
357
358 @end example 
359
360 For running on a Red Hat system you need these packages: guile, tetex,
361 tetex-latex, tetex-dvips, libstdc++, python, ghostscript.
362
363 For compilation on a Red Hat system you need these packages, in addition
364 to the those needed for running: glibc-devel, gcc-c++, libstdc++-devel,
365 guile-devel, flex, bison, texinfo, tetex-devel, groff,
366 libgr-progs.
367
368
369 @subsection LinuxPPC
370
371
372 Some LinuxPPC RPMS should available from
373 @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/}.
374
375 A LinuxPPC RPM can be made using the @file{lilypond.redhat.spec} file.
376
377 @subsection SuSE
378
379 Some SUSE RPMS should available from
380 @uref{ftp://ftp.lilypond.org/pub/LilyPond/binaries/SuSE}.
381
382 You can also compile a RPM for SUSE yourself.  A spec file is in
383 @file{make/out/lilypond.suse.spec}, see the instructions for building
384 the Red Hat RPM.
385
386 You must have the following packages: guile tcsh tetex te_latex te_kpath
387 te_mpost libpng python gpp libgpp gettext autoconf netpbm libnetpb
388 gs_serv gs_lib gs_fonts guile
389
390 @subsection Slackware
391
392 No precompiled packages for Slackware are available.
393
394 Problems have been reported with Slackware 7.0; apparently, it ships
395 with a faulty compiler. Do not compile LilyPond with -O2 on this
396 platform.
397
398 @subsection Mandrake
399
400 Some binaries are available at rpmfind.net. Refer to 
401 @uref{http://rpmfind.net/linux/mandrake/cooker/contrib/RPMS/}.
402
403 You can also compile a RPM for Mandrake yourself.  A spec file is in
404 @file{make/out/lilypond.mandrake.spec}, see the instructions for building
405 the Red Hat RPM.
406
407 @subsection Debian GNU/Linux
408
409 A Debian package is also available.  You may install it easily by running
410 @command{apt-get} as root:
411 @example
412
413         apt-get install lilypond lilypond-doc
414 @end example
415
416 You can also compile the .deb for Debian yourself, do:
417 @example
418
419         apt-get -b source lilypond
420 @end example
421
422 If you're real impatient, you may even do:
423 @example
424
425         cd lilypond-x.y.z   # a previous version
426         uscan               # download and build latest directly from upstream
427 @end example
428
429
430 Debian's @TeX{} installation is a bit short on memory, you may want to
431 increase it like this:
432 @example
433 --- /etc/texmf/texmf.cnf.dpkg   Sun Jan 28 14:12:14 2001
434 +++ /etc/texmf/texmf.cnf        Fri Apr 27 11:09:35 2001
435 @@ -384,8 +384,8 @@
436  main_memory.context = 1500000
437  main_memory.mpost = 1000000
438  main_memory = 263000 % words of inimemory available; also applies to inimf&mp
439 -extra_mem_top = 0    % extra high memory for chars, tokens, etc.
440 -extra_mem_bot = 0    % extra low memory for boxes, glue, breakpoints, etc.
441 +extra_mem_top = 100000    % extra high memory for chars, tokens, etc.
442 +extra_mem_bot = 100000    % extra low memory for boxes, glue, breakpoints, etc.
443  
444  obj_tab_size.context = 256000
445
446 @end example
447
448 You could also export @env{extra_mem_top} and @env{extra_mem_bot} as
449 environment variables if you do not want to or cannot modify
450 @file{/etc/texmf/texmf.cnf}.
451
452 Alternatively, visit
453
454 @itemize @bullet
455 @item @uref{http://packages.debian.org/lilypond,http://packages.debian.org/lilypond}
456 @item @uref{http://people.debian.org/~foka/lilypond/,http://people.debian.org/~foka/lilypond/}
457 for latest semi-unofficial build of LilyPond 1.4.2 for Debian 2.2 (potato) users.
458 The official stable Debian 2.2 is stuck with the old LilyPond-1.3.24.
459 Since LilyPond-1.4 has been released, the older lilypond1.3 Debian
460 package is now obsolete.
461 @end itemize
462
463 Please contact Anthony Fok @email{lilypond@@packages.debian.org} for more
464 information.
465
466 The build scripts are in the subdirectory @file{debian/}; you can
467 make the .deb by doing, for example:
468
469 @example
470         $ su - root
471         # dpkg --purge lilypond lilypond1.3
472         # exit
473         $ tar xzf lilypond-1.4.3.tar.gz
474         $ cd lilypond-1.4.3
475         $ dch -p -v 1.4.3-0.local.1 "Local build."
476         $ debuild -B
477         $ su - root
478         # dpkg -i ../lilypond_1.4.3*.deb
479         # exit
480         $
481 @end example
482
483 Use command @command{debuild} instead of @command{debuild -B} if you have
484 a very fast machine and want to build the HTML, PS and DVI documentation
485 too.
486
487 For compilation on a Debian GNU/Linux system you need these packages,
488 in addition to the those needed for running:
489
490 @itemize @bullet
491 @item g++, cpp, libc6-dev, libstdc++<@var{your-libstdc++-version-here}>-dev
492 @item libguile<@var{your-libguile-version-here}>-dev
493 @item make, m4, flex, bison
494 @item gettext
495 @item groff, texinfo
496 @item bibtex2html (not in Debian 2.2)
497 @item tetex-base, tetex-bin, tetex-extra, libkpathsea-dev or tetex-dev
498 @item dpkg-dev, debhelper, fakeroot
499 @item gs, netpbm
500 @item pnmtopng (only in Debian 2.2; pnmtopng has been merged with netpbm
501   in Debian testing/unstable.)
502 @end itemize
503
504 Most of these are listed on the @samp{Build-Depends} line in the
505 @file{debian/control} file.  To ensure the creation of the lilypond deb is
506 trouble-free, we recommend that you first install the following packages
507 by running \@command{apt-get} as root before building the package:
508
509 For Debian 2.2:
510
511 @example
512         apt-get install task-debian-devel task-c++-dev \
513                 python-base libguile6-dev tetex-bin tetex-dev \
514                 tetex-extra flex bison texinfo groff gs \
515                 netpbm pnmtopng m4 gettext
516 @end example
517
518 For Debian in development ("unstable", the future 2.3 or 3.0):
519
520 @example
521         apt-get install binutils cpp gcc libc6-dev \
522                 g++ libstdc++2.10-dev \
523                 python-base libguile-dev tetex-bin libkpathsea-dev \
524                 tetex-extra flex bison texinfo bibtex2html groff gs \
525                 netpbm m4 gettext
526 @end example
527
528 And, just so that old fonts from previous versions of LilyPond won't
529 interfere with your build, you may want to do this before the build too:
530
531 @example
532         dpkg --purge lilypond lilypond1.3
533 @end example
534
535
536 @c Why isn't this in BUGS (where it belongs?)
537 @section Problems
538
539 For help and questions use @email{lilypond-user@@gnu.org}.  Please
540 consult the FAQ before mailing your problems.  If you find bugs, please
541 send bug reports to @email{bug-lilypond@@gnu.org}.
542
543 Bugs that are not fault of LilyPond are documented here.
544
545 @unnumberedsubsec FLex-2.5.4a and gcc-3.0
546
547 Flex 2.5.4a does not produce g++-3.0 compliant C++ code.  To compile
548 LilyPond with gcc-3.0 you may do:
549
550 @example
551         rm -f config.cache
552         CC=gcc-3.0 CXX=g++-3.0 ./configure --enable-config=gcc-3.0
553         make conf=gcc-3.0 -C lily out-gcc-3.0/lexer.cc
554         patch -p1 < lexer-gcc-3.0.patch
555         make conf=gcc-3.0 -C lily
556 @end example
557
558 Note that this is fixed in Debian/unstable for flex >= 2.5.4a-13.
559
560 @unnumberedsubsec Linux-2.4.0, Guile-1.4 --with-threads
561
562 There's a bug in certain kernels around version 2.4.0, that is
563 triggered when using Guile 1.4 compiled with pthreads.  You'll see
564 random segmentation fault craches of LilyPond.  Upgrade to a newer
565 version of Linux.  If you can't do that, you may try to recompiling
566 Guile without threads (YMMV):
567
568 @example
569          guile-1.4$ ./configure --without-threads; make all install
570 #end example
571
572 @unnumberedsubsec NetBSD
573
574 @itemize @bullet
575 @item The flex precompiled in NetBSD-1.4.2 is broken.
576 Download flex-2.5.4a, build, install.
577
578 @item The configuration of Gcc (egcs-2.91.60 19981201 (egcs-1.1.1
579 release)) does not include @file{/usr/pkg} paths.  Configure using:
580 @example
581
582 CFLAGS='-I /usr/pkg/include' LDFLAGS='-L/usr/pkg/lib' ./configure
583
584 @end example
585
586 @end itemize
587
588 @unnumberedsubsec  Solaris:
589
590 @itemize @bullet
591 @item Sparc64/Solaris 2.6, GNU make-3.77
592
593 GNU make-3.77 is buggy on this platform, upgrade to 3.78.1 or newer.
594
595 @item Sparc64/Solaris 2.6, ld
596
597 Not yet resolved.
598 @end itemize
599
600
601 @unnumberedsubsec   AIX
602
603 @itemize @bullet
604 @item AIX 4.3 ld
605
606 The following is from the gcc install/SPECIFIC file.
607 @quotation
608    Some versions of the AIX binder (linker) can fail with a relocation
609    overflow severe error when the -bbigtoc option is used to link
610    GCC-produced object files into an executable that overflows the TOC.
611    A fix for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND  
612    -BBIGTOC) is available from IBM Customer Support and from its
613    27service.boulder.ibm.com website as PTF U455193.   
614
615    Binutils does not support AIX 4.3 (at least through release 2.9). GNU
616    as and GNU ld will not work properly and one should not configure GCC
617    to use those GNU utilities. Use the native AIX tools which do
618    interoperate with GCC.
619 @end quotation
620
621 add -Wl,-bbigtoc to USER_LDFLAGS, ie:
622 @example
623     LDFLAGS='-Wl,-bbigtoc' ./configure
624 @end example
625
626 @end itemize
627
628
629 @bye
630