Difference between revisions of "Minimal installation from SVN"
Line 1: | Line 1: | ||
{{TOCD}} |
{{TOCD}} |
||
This guide shows you how to download, configure, compile and install core apertium packages and language data. It assumes you've already installed the '''prerequisites''' for your system – if you have not, see the system-specific guides under [[Installation]]. |
This guide shows you how to download, configure, compile and install core apertium packages and language data. It assumes you've already installed the '''prerequisites''' for your system – if you have not, see the system-specific guides under [[Installation]]. |
||
⚫ | |||
==Installing apertium and a language pair== |
==Installing apertium and a language pair== |
||
Line 22: | Line 24: | ||
⚫ | |||
===Set up environment=== |
===Set up environment=== |
||
Line 81: | Line 82: | ||
</pre> |
</pre> |
||
replacing from-to with the direction you want. |
replacing from-to with the direction you want. |
||
==For language pairs that use CG (vislcg3 / cg-proc / cg-comp) == |
==For language pairs that use CG (vislcg3 / cg-proc / cg-comp) == |
||
Line 86: | Line 88: | ||
Note that you have to have [http://site.icu-project.org/ ICU] installed beforehand (available through most GNU/Linux package managers, in Arch Linux as <code>icu</code>, in Debian/Ubuntu as <code>libicu-dev</code>, in Macports as <code>icu</code>). |
Note that you have to have [http://site.icu-project.org/ ICU] installed beforehand (available through most GNU/Linux package managers, in Arch Linux as <code>icu</code>, in Debian/Ubuntu as <code>libicu-dev</code>, in Macports as <code>icu</code>). |
||
==For language pairs that use HFST (hfst-proc / hfst-lexc / hfst-twolc)== |
==For language pairs that use HFST (hfst-proc / hfst-lexc / hfst-twolc)== |
||
Many language pairs now use HFST (e.g. the Turkic and Saami ones). For these, you need <code>hfst</code> and <code>foma</code> beforehand. Follow the installation guides first for [[Foma]], then [[HFST]]. |
Many language pairs now use HFST (e.g. the Turkic and Saami ones). For these, you need <code>hfst</code> and <code>foma</code> beforehand. Follow the installation guides first for [[Foma]], then [[HFST]]. |
||
==See also== |
==See also== |
||
* [[Installation]] – specific info for many different operating systems |
* [[Installation]] – prerequisites and specific info for many different operating systems |
||
* [[Installation Troubleshooting]] |
* [[Installation Troubleshooting]] |
||
Revision as of 09:08, 21 November 2013
This guide shows you how to download, configure, compile and install core apertium packages and language data. It assumes you've already installed the prerequisites for your system – if you have not, see the system-specific guides under Installation.
Note: some pairs require more than the four packages describe here. See the bottom of this page if your language pair complains about lacking CG or HFST.
Installing apertium and a language pair
Download
For most language pairs, these are the packages you need:
- lttoolbox
- apertium
- apertium-lex-tools
- the language pair(s) your are interested in
Here are the commands if you would like the Esperanto-English pair:
svn checkout https://svn.code.sf.net/p/apertium/svn/trunk/lttoolbox svn checkout https://svn.code.sf.net/p/apertium/svn/trunk/apertium svn checkout https://svn.code.sf.net/p/apertium/svn/trunk/apertium-lex-tools svn checkout https://svn.code.sf.net/p/apertium/svn/trunk/apertium-eo-en
If you want another pair than eo-en, only the last line needs changing. To see the available 'released' language pairs, go to https://svn.code.sf.net/p/apertium/svn/trunk/ (pairs which are in development are in the incubator/nursery/staging subdirectories of https://svn.code.sf.net/p/apertium/svn/).
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, paste these lines into your terminal:
LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH} export PKG_CONFIG_PATH
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 it installed somewhere else or don't want to install it as root, instead use these lines:
PREFIX=$HOME/local # or wherever you want apertium stuff installed LD_LIBRARY_PATH=$PREFIX/lib:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:${PKG_CONFIG_PATH} export PKG_CONFIG_PATH
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:
lttoolbox
apertium
apertium-lex-tools
- the language pair (e.g.
apertium-eo-en
)
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:
./autogen.sh make sudo make install sudo ldconfig
If you specified a $PREFIX
(e.g. to avoid installing as root), then do this in each directory:
./autogen.sh --prefix=$PREFIX make make install ldconfig
(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.
Test
Now test that it works. The command apertium -l
should show a list of translation directions, of the form "from-to". Pick one, and do
echo 'This is a test sentence.' | apertium from-to
replacing from-to with the direction you want.
For language pairs that use CG (vislcg3 / cg-proc / cg-comp)
Many language pairs now use Constraint Grammar (e.g. Macedonian→English, Breton→French, Nynorsk-Bokmål, …). For these, you need vislcg3
beforehand. See Vislcg3#Installing_VISL_CG3 for installation (use ./cmake.sh -DCMAKE_INSTALL_PREFIX=<prefix>
if you're installing to a prefix).
Note that you have to have ICU installed beforehand (available through most GNU/Linux package managers, in Arch Linux as icu
, in Debian/Ubuntu as libicu-dev
, in Macports as icu
).
For language pairs that use HFST (hfst-proc / hfst-lexc / hfst-twolc)
Many language pairs now use HFST (e.g. the Turkic and Saami ones). For these, you need hfst
and foma
beforehand. Follow the installation guides first for Foma, then HFST.
See also
- Installation – prerequisites and specific info for many different operating systems
- Installation Troubleshooting