cabin crew: take your seats!
[lyx.git] / INSTALL
blob108190f746f4d71156095ec20184dc4c62ceb680
1 Compiling and installing LyX
2 ============================
4 Quick compilation guide
5 -----------------------
7 These four steps will compile, test and install LyX:
9         0) Linux users beware: if compiling the Qt frontend, you need
10            qt4 and qt4-devel packages of the same version to compile LyX.
12         1) ./configure
13            configures LyX according to your system. 
14            When compiling for Qt, you may have to set
15              --with-qt4-dir=<path-to-your-qt4-installation>
16            if the environment variable QTDIR is not set. 
18         2) make
19            compiles the program.
21         3) src/lyx
22            runs the program so you can check it out.
24         4) make install
25            will install it. You can use "make install-strip" instead
26            if you want a smaller binary.
29 Note for Subversion checkouts
30 -----------------------------
32 If you have checked this out from Subversion, you need to have:
33 * automake >= 1.5
34 * autoconf >= 2.52
35 * gettext >= 0.12
36 Then type "./autogen.sh" to build the needed configuration
37 files and proceed as stated below.
39 You will also probably need GNU m4 (perhaps installed as gm4).
41 Requirements
42 ------------
44 First of all, you will also need a recent C++ compiler, where recent
45 means that the compilers are close to C++ standard conforming (gcc 3.x).
47 LyX makes great use of C++ Standard Template Library (STL). This means
48 that gcc users will have to install the relevant libstdc++ library to
49 be able to compile this version of LyX.
51 LyX should be compatible with Qt version 4.1.x to 4.3.x. The only
52 special point to make is that you must ensure that both LyX and the Qt
53 libraries are compiled with the same C++ compiler.
55 Note that if Qt is using Xft2/fontconfig, you may need to install the
56 latex-xft-fonts package (at ftp://ftp.lyx.org/pub/lyx/contrib/) to get
57 maths symbols displayed properly. To find out, type:
59         ldd `which lyx` | grep fontconfig
61 at the console. Most recent distributions are known to use fontconfig.
63 If, however, your version of Qt does not use fontconfig, then TeX
64 fonts should be added to the font path. 'man xset' is your friend.
67 * Other things to note
69 If you make modifications to files in src/ (for example by applying a
70 patch), you will need to have the GNU gettext package installed, due
71 to some dependencies in the makefiles. You can get the latest version
72 from:
73         ftp://ftp.gnu.org/gnu/gettext/
75 To use the thesaurus, you will need to install libAikSaurus, available
76 from:
77         http://aiksaurus.sourceforge.net/
79 The two following programs should be available at configuration time:
81   o LaTeX2e should be correctly setup for the user you are logged in
82     as. Otherwise, LyX will not be able to run a number of tests. Note
83     that users can run these tests manually with Tools>Reconfigure.
85   o Python 2.3 or newer installed to be able to import older LyX files
86     with the lyx2lyx script (this script is called automatically when
87     opening a file).
90 Creating the Makefile
91 ---------------------
93 LyX can be configured using GNU autoconf utility which attempts to guess
94 the configuration needed to suit your system.  The standard way to use it
95 is described in the file INSTALL.autoconf.  In most cases you will be able
96 to create the Makefile by typing
98   ./configure
100 For more complicated cases, LyX configure takes the following specific
101 flags:
103   o --enable-build-type=[rel(ease), dev(elopment), pre(release)]
104     allows to tweak the compiled code. The following table describes
105     the settings in terms of various options that are described later
107                       release   prerelease  development
108     optimization        -O2         -O2         -O
109     assertions                       X           X
110     stdlib-debug                                 X
111     concept-checks                   X           X
112     warnings                         X           X
113     debug                            X           X
115     The default are as follows in terms of version number
116     release: stable release (1.x.y)
117     prerelease: version number contains alpha, beta, rc or pre.
118     development: version number contains svn.
120   o --with-extra-lib=DIRECTORY that specifies the path where LyX will
121     find extra libraries (qt4) it needs. Defaults to NONE
122     (i.e. search in standard places). You can specify several
123     directories, separated by colons.
125   o --with-extra-inc=DIRECTORY that gives the place where LyX will find
126     extra headers.  Defaults to NONE (i.e.  search in standard places).
127     You can specify several directories, separated by colons.
129   o --with-extra-prefix[=DIRECTORY] that is equivalent to
130        --with-extra-lib=DIRECTORY/lib --with-extra-inc=DIRECTORY/include
131     If DIRECTORY is not specified, the current prefix is used.
133   o --with-version-suffix will install LyX as lyx-<version>, e.g. lyx-1.5.1
134     The LyX data directory will be something like <whatever>/lyx-1.5.1/.
135     Additionally your user configuration files will be found in e.g.
136     $HOME/.lyx-1.5.1
138     You can use this feature to install more than one version of LyX
139     on the same system. You can optionally specify a "version" of your
140     own, by doing something like :
141        ./configure --with-version-suffix=-latestsvn
143     Note that the standard configure options --program-prefix,
144     --program-suffix and the others will not affect the shared LyX
145     directory etc. so it is recommended that you use --with-version-suffix
146     (or --prefix) instead.
148 There are also flags to control the internationalization support in
149 LyX:
151   o --disable-nls suppresses all internationalization support,
152     yielding a somewhat smaller code.
154   o --with-included-gettext forces the use of the included GNU gettext
155     library, although you might have another one installed.
157   o --with-catgets allows to use the catget() functions which can
158     exist on your system.  This can cause problems, though. Use with
159     care.
161   o You can also set the environment variable LINGUAS to a list of
162     language in case you do not want to install all the translation
163     files. For example, if you are only interested in German and
164     Finnish, you can type (with sh or bash)
165         export LINGUAS='de fi'
166     before running configure.
168 Moreover, the following generic configure flags may be useful:
170   o --prefix=DIRECTORY specifies the root directory to use for
171     installation. [defaults to /usr/local]
173   o --datadir=DIRECTORY gives the directory where all extra LyX
174     files (documentation, templates and layout definitions)
175     will be installed.
176     [defaults to ${prefix}/share/lyx${program_suffix}]
178   o --bindir=DIRECTORY gives the directory where the lyx binary
179     will be installed. [defaults to ${prefix}/bin]
181   o --mandir=DIRECTORY gives the directory where the man pages will go.
182     [defaults to ${prefix}/man]
184   o --enable-maintainer-mode enables some code that automatically
185     rebuilds the configure script, makefiles templates and other useful
186     files when needed. This is off by default on releases, to avoid
187     surprises.
189 Note that the --with-extra-* commands are not really robust when it
190 comes to use of relative paths.  If you really want to use a relative path
191 here, you can prepend it with "`pwd`/".
193 If you do not like the default compile flags used (-g -O2 on gcc), you can
194 set CXXFLAGS variable to other values as follows:
196   o CXXFLAGS='-O2' (sh, bash)
197   o setenv CXXFLAGS '-O2' (csh, tcsh)
199 Similarly, if you want to force the use of some specific compiler, you can
200 give a value to the CXX variable.
202 If you encounter problems, please read the section 'Problems' at the end of
203 this file.
205 The following options allow to tweak more precisely the generated code:
207   o --enable-profiling instruments the code for use with the gprof
208     profiler. The result are only meaningful in conjunction with
209     --enable-build-type=release.
211   o --enable-optimization=VALUE enables you to set optimization to a
212     higher level as the default (-O), for example --enable-optimization=-O3.
214   o --disable-optimization - you can use this to disable compiler
215     optimization of LyX. The compile may be much quicker with some
216     compilers, but LyX will run more slowly.
218   o --enable-debug will add debug information to your binary. This
219     requires a lot more disk space, but is a must if you want to try to
220     debug problems in LyX. The default is to have debug information
221     for development versions and prereleases only.
223   o --enable-warnings that make the compiler output more warnings during
224     the compilation of LyX.  Opposite is --disable-warnings.  By default,
225     this flag is on for development versions only.
227   o --enable-assertions that make the compiler generate run-time
228     code which checks that some variables have sane values. Opposite
229     is --disable-assertions.  By default, this flag is on for
230     development versions only.
232   o --enable-stdlib-debug adds some debug code in the standard
233     library; this slows down the code, but has been helpful in the
234     past to find bugs. By default, this flag is on for development
235     versions only.
237   o --enable-concept-checks adds some compile-time checks. There is no
238     run-time penalty. By default, this flag is on for development
239     versions only.
241   o --without-latex-config that disables the automatic detection of your
242     latex configuration.  This detection is automatically disabled if
243     latex cannot be found.  If you find that you have to use this
244     flag, please report it as a bug.
246   o --with-frontend=FRONTEND that allows to specify which frontend you
247     want to use. The default value is qt4, which is the only available
248     frontend for now.
251 Compiling and installing LyX
252 ----------------------------
254 Once you've got the Makefile created, you just have to type:
256   make all
257   make install
259 All should be OK ;)
261 Since the binaries with debug information tend to be huge (although
262 this does not affect the run-time memory footprint), you might want
263 to strip the lyx binary. In this case replace "make install" with
265   make install-strip
267 BTW: in the images subdirectory there is also a small icon "lyx.xpm",
268 that can be used to display lyx-documents in filemanagers.
270 If configure fails for some strange reason
271 ------------------------------------------
273 Even when configure fails, it creates a Makefile.  You always can check
274 the contents of this file, modify it and run 'make'.
276 Compiling For Multiple Architectures
277 ------------------------------------
279 You can compile LyX for more than one kind of computer at the same
280 time, by placing the object files for each architecture in their own
281 directory.  To do this, you must use a version of `make' that supports
282 the `VPATH' variable, such as GNU `make'.  `cd' to the directory where
283 you want the object files and executables to go and run the
284 `configure' script.  `configure' automatically checks for the source
285 code in the directory that `configure' is in and in `..'.
287 If you have to use a `make' that does not supports the `VPATH'
288 variable, you have to compile LyX for one architecture at a time in
289 the source code directory.  After you have installed LyX for one
290 architecture, use `make distclean' before reconfiguring for another
291 architecture.
294 Preparing a binary distribution for the use of others
295 ------------------------------------------------------
297   o Compile LyX with the right compiler switches for your
298     architecture. Make sure you use the --without-latex-config switch
299     of configure, since others might not be interested by your
300     configuration :-)
302   o Create a file README.bin describing your distribution and
303     referring to *you* if problems arise. As a model, you can use the
304     file development/tools/README.bin.example, which can be a good
305     starting point.
307   o Type `make bindist'. This will create a file
308     lyx-1.xx.yy-bin.tar.gz. Rename it to reflect you architecture
309     and the peculiarities of your build (e.g. static vs. dynamic).
311   o Check that everything is correct by unpacking the distribution
312     in some private place and running it. In particular, check the
313     output of `ldd lyx' to know which libraries are really needed.
315   o Upload your binary file to ftp.devel.lyx.org:/pub/incoming, and
316     notify lyx-devel@lists.lyx.org.
319 Problems
320 --------
322 This section provides several hints that have been submitted by LyX
323 team member or users to help compiling on some particular
324 architectures. If you find that some of this hints are wrong, please
325 notify us.
327   o On SUN Sparc Solaris, you need gnumake. The LyX makefiles do not
328     work with Solaris make.
330     The Solaris 8 ar seg-faults trying to build the insets library. You
331     will need to use the ar from the GNU binutils for this subdirectory.
332     There is no problem with the Solaris 9 and 10 ar.
334     Qt4 uses the Xrender X11 extension for antialiased fonts. This
335     extension was added to Xsun starting from the Solaris 10 8/07
336     release, but it is not activated by default. To activate it, you
337     must issue (as root) the following command:
338     svccfg -s svc:/application/x11/x11-server setprop options/server_args=+xrender
339     and then restart the X server.
341     There is a problem with the fontconfig library shipped with
342     Solaris 10 8/07 causing a seg-fault when it is used by Qt4.
343     Until this is fixed, a workaround is replacing the shared library
344     /usr/lib/libfontconfig.so.1 with a copy from a previous release or
345     installing a new version of fontconfig from http://www.sunfreeware.com/
347     On Solaris, the default fontconfig configuration gives preference
348     to bitmap fonts at (not so small) sizes. As bitmapped fonts are not
349     antialiased, you may prefer changing this configuration. This may be
350     done by adding the following stanza
352           <match target="pattern">
353               <edit name="prefer_bitmap">
354                   <bool>false</bool>
355               </edit>
356           </match>
358     to either ~/.fonts.conf (for a per-user change) or /etc/fonts/local.conf
359     (for a global system change). The stanza should be added between the
360     <fontconfig> and </fontconfig> tags. If neither ~/.fonts.conf nor
361     /etc/fonts/local.conf exist, you can create them with the following
362     content:
364       <?xml version="1.0"?>
365       <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
366       <fontconfig>
367           <match target="pattern">
368               <edit name="prefer_bitmap">
369                   <bool>false</bool>
370               </edit>
371           </match>
372       </fontconfig>