Installing apertium
System requirements
- libxml2 version 2.6.17 or
later (on Ubuntu you may need to install
libxml2-dev too
)
- xmllint tool (usually comes with
libxml2, but may be an independent
package on your system, i.e. Debian GNU-Linux)
- xsltproc tool (non-PowerPC users),
also comes with libxml2 but may also be
an independent package in your system, as happens with the
xmllint tool
- sabcmd tool (PowerPC users),
provided by package sablotron
flex
- GNU make, gcc (g++), bash shell
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:
- lttoolbox
- apertium
The simplest way to compile each package is:
- 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.
- Type make to compile the
package.
- Type make install (possibly with
root privileges) to install the programs and any data files and
documentation.
- 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:
- add LIBDIR to the LD_LIBRARY_PATH environment variable during
execution
- add LIBDIR to the LD_RUN_PATH environment variable during
linking
- use the -Wl,--rpath -Wl,LIBDIR
linker flag
- have your system administrator add LIBDIR to /etc/ld.so.conf
and run ldconfig
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
- Download a data package
(apertium-LANG1-LANG2-VERSION.tar.gz) from apertium's
sourceforge.net website.
- Unpack the tarball in any directory, go to this directory
and execute the "make" command. Wait while linguistic
data is "compiled".
- 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