<< | Page list | >>
Notes about compiling LyX
Based on recommendation from Andre and John
mkdir -p /space
cd /space tar xzvf lyx-1.3.0.tar.gz
cd lyx-devel /autogen.sh ./configure
./configure --with-version-suffix=16 --enable-build-type=release
make make install
make DESTDIR=/tmp/lyx-inst install
Compiling and installing with GNU STOW
There are many reasons why you might want to keep your existing Linux installation but still update to a new version of LyX. Here you will learn how to do it without trashing your existing setup.
When finished, you will have both your existing LyX and the newest version. The trick is to install with GNU STOW.
These instructions are for Debian and Debian based distributions such as Ubuntu. On other distributions you will need to use some method other that Step 1 below to install the dependencies needed for compilation.
Getting the tools
First we need to get all the dependencies and tools to compile LyX:
This should get most or all of what you need. There may be a substantial download if you have no building tools already installed.
Making a working space ~/local
Your source files for the new version of LyX should be stored in a local directory. Why not name it "local"?
Get the latest stable version of LyX
Download the source tarball from http://www.lyx.org/Download. The downloaded file will be named lyx-1.6.5.tar.gz or something similar (depending on what is the current latest version).
Depending upon your setup, the tar.gz file will be downloaded to your home directory, the ~/Desktop directory, the ~/Download directory or somewhere else. You need to move it to the ~/local directory:
This assumes it has been downloaded to your home directory. If not adjust the command accordingly or use your file manager. However you do it, get the tar.gz file into the ~/local directory.
Compiling the new LyX
We are only going to compile at this stage, not install. Be sure you are in the ~/local directory.
1. you@yourmachine:~/local$ tar xovzf lyx-1.6.5.tar.gz
This will create a new sub-directory under ~/local and will unpack the source files for lyx.
2. you@yourmachine:~/local$ cd lyx-1.6.5
Check the output - if it says something is missing, then use apt-get to install it.
4. you@yourmachine:~/local/lyx-1.6.5$ ./configure --with-version-suffix=165
We give it a different suffix so that it doesn't conflict with your existing LyX installation. You can use both the new version and the previously installed version. You can use any suffix that you like, but I would suggest either 16 or 165 to reflect the version of LyX that you are using. Check the output - if it says something is missing, then install using apt-get. Repeat the first autogen and configure steps.
5. you@yourmachine:~/local/lyx-1.6.5$ make
Depending on your machine, this may take some time. If there is an error, then read the output. You probably need to use apt-get to install some new piece of software.
We are going to use GNU Stow to install the new LyX. Stow allows you to keep your new version of LyX in a part of the hard disk that your package manager does not use. That way it is safe from any actions that your package manager might take. It also allows you to keep your existing LyX version intact.
Running the new version
You can also make a "launcher" for the new version by right clicking on the panel. The command should be:
You can also run your old LyX version using the simple command:
In a launcher, the command /usr/bin/lyx will run the old version.
Why use stow?
All modern Linux distributions use a package manager to install software from a repository. In most cases, the packages installed are subject to security updates or to other changes not determined by the user of the system.
When you compile and install special software, it is outside the scope of the package manager. Stow ensures that the special software is put in a place that is outside the view of the package manager. This ensures that the package manager will not overwrite your compiled version of LyX or, even worse, that your compiled version will trash libraries or other parts of your system managed by the package manager.
Stow cleverly "integrates" your compiled package using symbolic links. The compiled software appears to be part of your normal system but is isolated from it.
To use Stow, the final step of the usual ./configure, ./make ./make install process is changed. The final step is replaced by:
sudo make install prefix=/usr/local/stow/pkgname
I also recommend using Stow when compiling the development version as described above.
Before you uninstall Lyx, you have to remove the symbolic links made by stow (if applicable). This is done with the command