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