]> git.lyx.org Git - lyx.git/blob - INSTALL
Add some info about Solaris to the INSTALL file
[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: if compiling the Qt frontend, you need
10            qt4 and qt4-devel packages of the same version to compile LyX.
11
12         1) ./configure
13            configures LyX according to your system. 
14            When compiling for Qt, you may have to set
15              --with-qt4-dir=<path-to-your-qt4-installation>
16            if the environment variable QTDIR is not set. 
17
18         2) make
19            compiles the program.
20
21         3) src/lyx
22            runs the program so you can check it out.
23
24         4) make install
25            will install it. You can use "make install-strip" instead
26            if you want a smaller binary.
27
28
29 Note for Subversion checkouts
30 -----------------------------
31
32 If you have checked this out from Subversion, you need to have:
33 * automake >= 1.5
34 * autoconf >= 2.52
35 * gettext >= 0.12
36 Then type "./autogen.sh" to build the needed configuration
37 files and proceed as stated below.
38
39 You will also probably need GNU m4 (perhaps installed as gm4).
40
41 Requirements
42 ------------
43
44 First of all, you will also need a recent C++ compiler, where recent
45 means that the compilers are close to C++ standard conforming (gcc 3.x).
46
47 LyX 1.6.x makes great use of C++ Standard Template Library (STL).
48 This means that gcc users will have to install the relevant libstdc++
49 library to be able to compile this version of LyX. 
50
51 LyX has been tested with Qt 4.2.x and Qt 4.3.x. The only special point
52 to make is that you must ensure that both LyX and the Qt libraries are
53 compiled with the same C++ compiler.
54
55 Note that if Qt is using Xft2/fontconfig, you may need to install the
56 latex-xft-fonts package (at ftp://ftp.lyx.org/pub/lyx/contrib/) to get
57 maths symbols displayed properly. To find out, type:
58
59         ldd `which lyx` | grep fontconfig
60
61 at the console. Most recent distributions are known to use fontconfig.
62
63 If, however, your version of Qt does not use fontconfig, then TeX
64 fonts should be added to the font path. 'man xset' is your friend.
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 To use the thesaurus, you will need to install libAikSaurus, available
75 from:
76         http://aiksaurus.sourceforge.net/
77
78 The two following programs should be available at configuration time:
79
80   o LaTeX2e should be correctly setup for the user you are logged in
81     as. Otherwise, LyX will not be able to run a number of tests. Note
82     that users can run these tests manually with Tools>Reconfigure.
83
84   o Python 2.3 or newer installed to be able to import older LyX files
85     with the lyx2lyx script (this script is called automatically when
86     opening a file).
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 takes the following specific
100 flags:
101
102   o --enable-build-type=[rel(ease), dev(elopment), pre(release)]
103     allows to tweak the compiled code. The options are equivalent to:
104
105     release: --enable-optimization=-O2 --disable-assertions 
106              --disable-stdlib-debug --disable-concept-checks
107              --disable-warnings --disable-debug
108
109     prerelease: --enable-optimization=-O2 --enable-assertions 
110              --disable-stdlib-debug --enable-concept-checks
111              --enable-warnings --enable-debug
112
113     prerelease: --enable-optimization=-O --enable-assertions 
114              --enable-stdlib-debug --enable-concept-checks
115              --enable-warnings --enable-debug
116
117   o --with-extra-lib=DIRECTORY that specifies the path where LyX will
118     find extra libraries (qt4) it needs. Defaults to NONE
119     (i.e. search in standard places). You can specify several
120     directories, separated by colons.
121
122   o --with-extra-inc=DIRECTORY that gives the place where LyX will find
123     extra headers.  Defaults to NONE (i.e.  search in standard places).
124     You can specify several directories, separated by colons.
125
126   o --with-extra-prefix[=DIRECTORY] that is equivalent to
127        --with-extra-lib=DIRECTORY/lib --with-extra-inc=DIRECTORY/include
128     If DIRECTORY is not specified, the current prefix is used.
129
130   o --with-version-suffix will install LyX as lyx-<version>, e.g. lyx-1.6.1
131     The LyX data directory will be something like <whatever>/lyx-1.6.1/.
132     Additionally your user configuration files will be found in e.g.
133     $HOME/.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 In particular, the following options could be useful in some desperate
203 cases:
204
205   o --enable-optimization=VALUE enables you to set optimization to a
206     higher level as the default (-O), 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 to
214     debug problems in LyX. The default is to have debug information
215     for development versions and prereleases only.
216
217   o --enable-warnings that make the compiler output more warnings during
218     the compilation of LyX.  Opposite is --disable-warnings.  By default,
219     this flag is on for development versions only.
220
221   o --enable-assertions that make the compiler generate run-time
222     code which checks that some variables have sane values. Opposite
223     is --disable-assertions.  By default, this flag is on for
224     development versions only.
225
226   o --enable-stdlib-debug adds some debug code in the standard
227     library; this slows down the code, but has been helpful in the
228     past to find bugs. By default, this flag is on for development
229     versions only.
230
231   o --enable-concept-checks adds some compile-time checks. There is no
232     run-time penalty. By default, this flag is on for development
233     versions only.
234
235   o --without-latex-config that disables the automatic detection of your
236     latex configuration.  This detection is automatically disabled if
237     latex cannot be found.  If you find that you have to use this
238     flag, please report it as a bug.
239
240   o --with-frontend=FRONTEND that allows to specify which frontend you
241     want to use. The default value is qt4, which is the only available
242     frontend for now.
243
244
245 Compiling and installing LyX
246 ----------------------------
247
248 Once you've got the Makefile created, you just have to type:
249
250   make all
251   make install
252
253 All should be OK ;)
254
255 Since the binaries with debug information tend to be huge (although
256 this does not affect the run-time memory footprint), you might want
257 to strip the lyx binary. In this case replace "make install" with
258
259   make install-strip
260
261 BTW: in the images subdirectory there is also a small icon "lyx.png",
262 that can be used to display lyx-documents in filemanagers.
263
264 If configure fails for some strange reason
265 ------------------------------------------
266
267 Even when configure fails, it creates a Makefile.  You always can check
268 the contents of this file, modify it and run 'make'.
269
270 Compiling For Multiple Architectures
271 ------------------------------------
272
273 You can compile LyX for more than one kind of computer at the same
274 time, by placing the object files for each architecture in their own
275 directory.  To do this, you must use a version of `make' that supports
276 the `VPATH' variable, such as GNU `make'.  `cd' to the directory where
277 you want the object files and executables to go and run the
278 `configure' script.  `configure' automatically checks for the source
279 code in the directory that `configure' is in and in `..'.
280
281 If you have to use a `make' that does not supports the `VPATH'
282 variable, you have to compile LyX for one architecture at a time in
283 the source code directory.  After you have installed LyX for one
284 architecture, use `make distclean' before reconfiguring for another
285 architecture.
286
287 Preparing a binary distribution for the use of others
288 ------------------------------------------------------
289
290   o Compile LyX with the right compiler switches for your
291     architecture. Make sure you use the --without-latex-config switch
292     of configure, since others might not be interested by your
293     configuration :-)
294
295   o Create a file README.bin describing your distribution and
296     referring to *you* if problems arise. As a model, you can use the
297     file development/tools/README.bin.example, which can be a good
298     starting point.
299
300   o Type `make bindist'. This will create a file
301     lyx-1.xx.yy-bin.tar.gz. Rename it to reflect you architecture
302     and the peculiarities of your build (e.g. static vs. dynamic).
303
304   o Check that everything is correct by unpacking the distribution
305     in some private place and running it. In particular, check the
306     output of `ldd lyx' to know which libraries are really needed.
307
308   o Upload your binary file to ftp.devel.lyx.org:/pub/incoming, and
309     notify larsbj@lyx.org.
310
311
312 Problems
313 --------
314
315 This section provides several hints that have been submitted by LyX
316 team member or users to help compiling on some particular
317 architectures. If you find that some of this hints are wrong, please
318 notify us.
319
320   o On SUN Sparc Solaris, you need gnumake. The LyX makefiles do not
321     work with Solaris make.
322
323     The Solaris 8 ar seg-faults trying to build the insets library. You
324     will need to use the ar from the GNU binutils for this subdirectory.
325     There is no problem with the Solaris 9 and 10 ar.
326
327     Qt4 uses the Xrender X11 extension for antialiased fonts. This
328     extension was added to Xsun starting from the Solaris 10 8/07
329     release, but it is not activated by default. To activate it, you
330     must issue (as root) the following command:
331     svccfg -s svc:/application/x11/x11-server setprop options/server_args=+xrender
332     and then restart the X server.
333
334     There is a problem with the fontconfig library shipped with
335     Solaris 10 8/07 causing a seg-fault when it is used by Qt4.
336     Until this is fixed, a workaround is replacing the shared library
337     /usr/lib/libfontconfig.so.1 with a copy from a previous release or
338     installing a new version of fontconfig from http://www.sunfreeware.com/
339
340     On Solaris, the default fontconfig configuration gives preference
341     to bitmap fonts at (not so small) sizes. As bitmapped fonts are not
342     antialiased, you may prefer changing this configuration. This may be
343     done by adding the following stanza
344
345           <match target="pattern">
346               <edit name="prefer_bitmap">
347                   <bool>false</bool>
348               </edit>
349           </match>
350
351     to either ~/.fonts.conf (for a per-user change) or /etc/fonts/local.conf
352     (for a global system change). The stanza should be added between the
353     <fontconfig> and </fontconfig> tags. If neither ~/.fonts.conf nor
354     /etc/fonts/local.conf exist, you can create them with the following
355     content:
356
357       <?xml version="1.0"?>
358       <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
359       <fontconfig>
360           <match target="pattern">
361               <edit name="prefer_bitmap">
362                   <bool>false</bool>
363               </edit>
364           </match>
365       </fontconfig>
366