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