]> git.lyx.org Git - lyx.git/blob - INSTALL
Typo
[lyx.git] / INSTALL
1 Compiling and installing LyX
2 ============================
3
4 Quick compilation guide
5 -----------------------
6
7 These four steps will compile, test and install LyX:
8
9         0) Linux users beware: You need qt4 and qt4-devel packages
10            of the same version to compile LyX.
11
12            In general, it is also recommended to have pkg-config
13            installed (the name might vary depending on your
14            distribution).
15
16         1) ./configure configures LyX according to your system. You
17            may have to set --with-qt-dir=<path-to-your-qt-installation>
18            (for example, "--with-qt-dir=/usr/share/qt4/") if the
19            environment variable QTDIR is not set and pkg-config is not
20            available.
21
22            See Note below if ./configure script is not present.
23
24         2) make
25            compiles the program.
26
27         3) src/lyx
28            runs the program so you can check it out.
29
30         4) make install
31            will install it. You can use "make install-strip" instead
32            if you want a smaller binary.
33
34
35 Note for Git checkouts
36 -----------------------------
37
38 If you have checked this out from Git, you need to have:
39 * automake (supported versions are 1.8--1.14)
40 * autoconf (supported versions are 2.60--2.69)
41 Then type "./autogen.sh" to build the needed configuration
42 files and proceed as stated above/below.
43
44 You will also probably need GNU m4 (perhaps installed as gm4).
45
46
47 Requirements
48 ------------
49
50 First of all, you will need a recent C++ compiler, where recent means
51 that the compilers are close to C++ standard conforming (gcc 4.x).
52
53 LyX makes great use of the C++ Standard Template Library (STL).
54 This means that gcc users will have to install the relevant libstdc++
55 library to be able to compile this version of LyX.
56
57 For full LyX usability we suggest to use Qt 4.x and at least Qt 4.8 which 
58 has been widely tested. For compilation you need to compile against at
59 least Qt 4.5.0 and at Windows we advise at highest Qt 4.8.4. The only
60 special point to make is that you must ensure that both LyX and the 
61 Qt libraries are compiled with the same C++ compiler.
62
63 To build LyX with spell checking capabilities included you have to
64 install at least one of the development packages of the spell checker
65 libraries. See the RELEASE-NOTES for details.
66
67
68 * Other things to note
69
70 If you make modifications to the source that affect any of the
71 translations or you change the translation files themselves (po/*.po)
72 files, you will need to have the GNU gettext package installed to 
73 compile LyX with up-to-date translations (at least gettext version
74 0.16.1 is needed). You can get the latest version from:
75         ftp://ftp.gnu.org/gnu/gettext/
76
77 The two following programs should be available at configuration time:
78
79   o LaTeX2e should be correctly setup for the user you are logged in
80     as. Otherwise, LyX will not be able to run a number of tests. Note
81     that users can run these tests manually with Tools>Reconfigure.
82
83   o Python 2.4 or newer must be installed. Python is used for many
84     simple tasks that are executed by external scripts, such as the
85     automatic configuration step and the import of older LyX documents
86     with the lyx2lyx script (this script is called automatically when
87     opening a file). Python 3.0 or later is not supported.
88
89
90 Creating the Makefile
91 ---------------------
92
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
97
98   ./configure
99
100 For more complicated cases, LyX configure honors the following specific
101 flags:
102
103   o --enable-build-type=[rel(ease), pre(release), dev(elopment), prof(iling), gprof]
104     allows to tweak the compiled code. The following table describes
105     the settings in terms of various options that are described later
106
107                       release   prerelease  development profiling gprof
108     optimization        -O2         -O2         -O         -O2     -O2
109     assertions                       X           X
110     stdlib-debug                                 X
111     concept-checks                   X           X
112     warnings                         X           X
113     debug                            X           X           X       X
114
115     The defaults 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 dev.
119
120     The `profiling' build type uses the -fno-omit-frame-pointer option with gcc
121
122     The `gprof' build type compiles and links with -pg option with gcc.
123
124   o --with-extra-lib=DIRECTORY that specifies the path where LyX will
125     find extra libraries (qt4) it needs. Defaults to NONE
126     (i.e. search in standard places). You can specify several
127     directories, separated by colons.
128
129   o --with-extra-inc=DIRECTORY that gives the place where LyX will find
130     extra headers.  Defaults to NONE (i.e.  search in standard places).
131     You can specify several directories, separated by colons.
132
133   o --with-extra-prefix[=DIRECTORY] that is equivalent to
134        --with-extra-lib=DIRECTORY/lib --with-extra-inc=DIRECTORY/include
135     If DIRECTORY is not specified, the current prefix is used.
136
137   o --with-version-suffix[=SUFFIX] will install LyX as lyxSUFFIX. The
138     LyX data directory will be something like <whatever>/lyxSUFFIX/.
139     Additionally your user configuration files will be found in e.g.
140     $HOME/.lyxSUFFIX. The default for SUFFIX is "-<currentversion>",
141     e.g. lyx-1.6.1.
142
143     You can use this feature to install more than one version of LyX
144     on the same system. You can optionally specify a "version" of your
145     own, by doing something like :
146        ./configure --with-version-suffix=-latestdev
147
148     Note that the standard configure options --program-prefix,
149     --program-suffix and the others will not affect the shared LyX
150     directory etc. so it is recommended that you use --with-version-suffix
151     (or --prefix) instead.
152
153 There are also flags to control the internationalization support in
154 LyX:
155
156   o --disable-nls suppresses all internationalization support,
157     yielding somewhat smaller code.
158
159   o You can also set the environment variable LINGUAS to a list of
160     languages in case you do not want to install all the translation
161     files. For example, if you are only interested in German and
162     Finnish, you can type (with sh or bash)
163         export LINGUAS='de fi'
164     before running configure.
165
166 Moreover, the following generic configure flags may be useful:
167
168   o --prefix=DIRECTORY specifies the root directory to use for
169     installation. [defaults to /usr/local]
170
171   o --datadir=DIRECTORY gives the directory where all extra LyX
172     files (documentation, templates and layout definitions)
173     will be installed.
174     [defaults to ${prefix}/share/lyx${program_suffix}]
175
176   o --bindir=DIRECTORY gives the directory where the lyx binary
177     will be installed. [defaults to ${prefix}/bin]
178
179   o --mandir=DIRECTORY gives the directory where the man pages will go.
180     [defaults to ${prefix}/man]
181
182   o --enable-maintainer-mode enables some code that automatically
183     rebuilds the configure script, makefiles templates and other useful
184     files when needed. This is off by default on releases, to avoid
185     surprises.
186
187 Note that the --with-extra-* commands are not really robust when it
188 comes to using relative paths.  If you really want to use a relative path
189 here, you can prepend it with "`pwd`/".
190
191 If you do not like the default compile flags used (-g -O2 on gcc), you can
192 set CXXFLAGS variable to other values as follows:
193
194   o CXXFLAGS='-O2' (sh, bash)
195   o setenv CXXFLAGS '-O2' (csh, tcsh)
196
197 Similarly, if you want to force the use of a specific compiler, you can
198 give a value to the CXX variable.
199
200 If you encounter problems, please read the section 'Problems' at the end of
201 this file.
202
203 The following options allow you to tweak the generated code more precisely (see the description of --enable-build-type for the default values):
204
205   o --enable-optimization=VALUE enables you to set optimization to a
206     higher level than the default, for example --enable-optimization=-O3.
207
208   o --disable-optimization - you can use this to disable compiler
209     optimization of LyX. The compile may be much quicker with some
210     compilers, but LyX will run more slowly.
211
212   o --enable-debug will add debug information to your binary. This
213     requires a lot more disk space, but is a must if you want to try
214     to debug problems in LyX. There is no run-time penalty.
215
216   o --enable-warnings that make the compiler output more warnings during
217     the compilation of LyX.  Opposite is --disable-warnings.
218
219   o --enable-assertions that make the compiler generate run-time
220     code which checks that some variables have sane values. Opposite
221     is --disable-assertions.
222
223   o --enable-stdlib-debug adds some debug code in the standard
224     library; this slows down the code, but has been helpful in the
225     past to find bugs.
226
227   o --enable-concept-checks adds some compile-time checks. There is no
228     run-time penalty.
229
230   o --without-latex-config that disables the automatic detection of your
231     latex configuration.  This detection is automatically disabled if
232     latex cannot be found.  If you find that you have to use this
233     flag, please report it as a bug.
234
235   o --enable-monolithic-build[=boost,client,insets,mathed,core,tex2lyx,frontend-qt4]
236     that enables monolithic build of the given parts of the source
237     code. This should reduce the compilation time provided you have
238     enough memory (>500MB).
239
240
241 Compiling and installing LyX
242 ----------------------------
243
244 Once you've got the Makefile created, you just have to type:
245
246   make all
247   make install
248
249 All should be OK ;)
250
251 Since the binaries with debug information tend to be huge (although
252 this does not affect the run-time memory footprint), you might want
253 to strip the lyx binary. In this case replace "make install" with
254
255   make install-strip
256
257 BTW: in the images subdirectory there is also a small icon "lyx.png",
258 that can be used to display lyx-documents in filemanagers.
259
260 If configure fails for some strange reason
261 ------------------------------------------
262
263 Even when configure fails, it creates a Makefile.  You can always check
264 the contents of this file, modify it and run 'make'.
265
266 Compiling For Multiple Architectures
267 ------------------------------------
268
269 You can compile LyX for more than one kind of computer at the same
270 time, by placing the object files for each architecture in their own
271 directory.  To do this, you must use a version of `make' that supports
272 the `VPATH' variable, such as GNU `make'.  `cd' to the directory where
273 you want the object files and executables to go and run the
274 `configure' script.  `configure' automatically checks for the source
275 code in the directory that `configure' is in and in `..'.
276
277 If you have to use a `make' that does not support the `VPATH'
278 variable, you have to compile LyX for one architecture at a time in
279 the source code directory.  After you have installed LyX for one
280 architecture, use `make distclean' before reconfiguring for another
281 architecture.
282
283 Problems
284 --------
285
286 This section provides several hints that have been submitted by LyX
287 team members or users to help compiling on some particular
288 architectures. If you find that some of these hints are wrong, please
289 notify us.
290
291   o On SUN Sparc Solaris, you need gnumake. The LyX makefiles do not
292     work with Solaris make.
293
294     The Solaris 8 ar seg-faults trying to build the insets library. You
295     will need to use the ar from the GNU binutils for this subdirectory.
296     There is no problem with the Solaris 9 and 10 ar.
297
298     Qt4 uses the Xrender X11 extension for antialiased fonts. This
299     extension was added to Xsun starting from the Solaris 10 8/07
300     release, but it is not activated by default. To activate it, you
301     must issue (as root) the following command:
302     svccfg -s svc:/application/x11/x11-server setprop options/server_args=+xrender
303     and then restart the X server.
304
305     There is a problem with the fontconfig library shipped with
306     Solaris 10 8/07 causing a seg-fault when it is used by Qt4.
307     Until this is fixed, a workaround is replacing the shared library
308     /usr/lib/libfontconfig.so.1 with a copy from a previous release or
309     installing a new version of fontconfig from http://www.sunfreeware.com/
310
311     On Solaris, the default fontconfig configuration gives preference
312     to bitmap fonts at (not so small) sizes. As bitmapped fonts are not
313     antialiased, you may prefer changing this configuration. This may be
314     done by adding the following stanza
315
316           <match target="pattern">
317               <edit name="prefer_bitmap">
318                   <bool>false</bool>
319               </edit>
320           </match>
321
322     to either ~/.fonts.conf (for a per-user change) or /etc/fonts/local.conf
323     (for a global system change). The stanza should be added between the
324     <fontconfig> and </fontconfig> tags. If neither ~/.fonts.conf nor
325     /etc/fonts/local.conf exists, you can create them with the following
326     content:
327
328       <?xml version="1.0"?>
329       <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
330       <fontconfig>
331           <match target="pattern">
332               <edit name="prefer_bitmap">
333                   <bool>false</bool>
334               </edit>
335           </match>
336       </fontconfig>