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