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