Installing apertium

System requirements

Installing program packages

To install the apertium machine translation system programs and libraries first you need to download (from http://sourceforge.net/projects/apertium), compile and install the latest version of the following packages, in the specified order:
  1. lttoolbox
  2. apertium
The simplest way to compile each package is:
  1. cd to the directory containing the package's source code and type ./configure to configure the package for your system.  If you're using csh on an old version of System V, you  might need to type sh ./configure instead to prevent `csh' (the default shell in old System V) from trying to execute configure itself. Running configure takes a while.  While running, it prints some messages telling which features it is checking for.
  2. Type make to compile the package.
  3. Type make install (possibly with root privileges) to install the programs and any data files and documentation.
  4. You can remove the program binaries and object files from the source code directory by typing make clean.  To remove also the files that configure created (so you can compile the package for a different kind of computer), type make distclean.  There is also a make maintainer-clean target, but that is intended mainly for the package's developers.  If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution.

If you don't have root privileges to install the programs in your system, you can use the --prefix flag with the configure script to install them at your user account, for example:
$ pwd
/home/me/lttoolbox-0.9.1
$ ./configure --prefix=/home/me/myinstall


Libraries will be installed in the LIBDIR=$prefix/lib directory. If no --prefix flag is specified with configure script, LIBDIR=/usr/local/lib directory.

If you find some error to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the -LIBDIR flag during linking and do at least one of the following:
 
See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages.  

Installing data packages

  1. Download a data package (apertium-LANG1-LANG2-VERSION.tar.gz) from apertium's sourceforge.net website.
  2. Unpack the tarball in any directory, go to this directory and execute the "make" command.  Wait while linguistic data is "compiled".
  3. To use the translator, refer to this new directory with the "apertium-translator" tool.  For example, if the directory is /home/me/apertium-es-ca (for spanish-catalan translator), then do:

$  apertium-translator /home/me/apertium-es-ca es-ca txt <inputfile >outputfile