Install Apertium core by compiling

From Apertium
Revision as of 13:24, 24 April 2017 by Rcrowther (talk | contribs)
Jump to navigation Jump to search

Either you are planning to work on Apertium core, or have an operating system not covered by packaging, or virtual environments (check the Install overview).

Unix (GNU/Linux, Apple, BSD)

The below instructions are built from GNU/Linux material, but should be much the same on Apple, BSD, and other Unix-like systems.

If you are on an Apple system, you may want to look at Prerequisites for Mac OS X then Apertium on Mac OS X before returning here.

Install the prerequisites

Install prerequisites,

Notes for different systems

These notes have been made at different times. Some may be out-of-date. However, if you are having difficulties, they may contain some tips,

Use Subversion to download the code

The main code,

svn checkout
svn checkout
svn checkout

  • Note 1: Please make sure that the directory where you put these files (i.e. where you run the svn command) doesn't contain spaces and other special characters. That may cause errors while compiling/linking.
  • Note 2: Sourceforge ( naturally provides a full tarball download. Do not use this. The links above have a different address to the main Sourceforge address. They poke nto the SVN repository. The tarball compiles using './configure' instead of './'. Only packagers would be interested in using this.

Set up environment

By default, Apertium is installed under the directory /usr/local, which requires root (sudo) access when installing. If that's fine with you, begin by pasting these lines into your terminal:


You should also put those lines in your ~/.bashrc so you don't have to paste them into every terminal you open.

However, if you want Apertium installed somewhere else or don't want to install it as root, instead paste these lines into your terminal:

PREFIX=$HOME/local # or wherever you want apertium stuff installed

You should also put those lines in your ~/.bashrc so you don't have to paste them into every terminal you open.

Configure, build and install

The next step is to configure, build and install each of the modules you checked out, in this order:

  1. lttoolbox
  2. apertium
  3. apertium-lex-tools

cd to each of the directories before you run the the commands shown below.

If you didn't specify $PREFIX above, or don't know what this means, then do this in each directory,

sudo make install
sudo ldconfig

If you specified a $PREFIX (e.g. to avoid installing as root), then you need to reset the prefix on 'autogen', so do this in each directory,

./ --prefix=$PREFIX
make install
ldconfig -n $PREFIX/lib

(If you're on a Mac, you don't need to do ldconfig, don't worry that it fails.)

If you had any trouble, see Installation troubleshooting.


If you do not want to use the Apertium VirtualBox, you can compile Apertium for Windows using Cygwin; documentation for how to compile on Windows manually is at Apertium on Windows.

There is also a script at Apertium guide for Windows users, but it is currently out-of-date and in need of updating.


Compiles go wrong. Of course they do,


One way to test you have something, immediately, it to try invoke a tool. Without language data you can't see a translation, but you can see the help. Try,


You may want to write a new language pair, but you could download a language pair to test the install. Follow the instructions for Install language data by compiling. Or, if your system has packaging, download a language package (but beware, a package manager may pull in a old package of Apertium core, too).