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