Difference between revisions of "Apertium on openSUSE"

From Apertium
Jump to navigation Jump to search
Line 1: Line 1:
=== 0. Introduction ===
=== 0. Introduction ===


This note explains how to install the latest 3.0.4 svn version of Apertium on a stock openSUSE 10.2 install. If you choose the development pattern at or after install, you will get most of the packages required for development, and may not have to add those listed in section 1 below. The Apertium install is done into a directory in the user's homedir - in my case it was ''/home/kevin/downloads/linguistics'', but it can be anything you choose. In this note, this choice will be referred to as ''[homedir]''.
This note explains how to install the latest 3.0.4 svn version of Apertium on a stock openSUSE 10.2. The instructions below walk through the installation of the Unicode version of Apertium, since this will handle all of the world's languages. For legacy work, the non-Unicode version can also be installed using a similar process (see Section 8). Apertium is installed here into a directory in the user's homedir - in my case it was ''/home/kevin/downloads/linguistics'', but it can be anything you choose. In this note, this choice will be referred to as ''[homedir]''.


=== 1. Install required packages ===
=== 1. Install required packages ===
Line 29: Line 29:
=== 3. Set up your install dirs ===
=== 3. Set up your install dirs ===


From [homedir]:
From ''[homedir]'':


<pre>
<pre>
mkdir local
mkdir local
cd local/
cd local/
mkdir standard unicode
mkdir legacy unicode
</pre>
</pre>


This creates [homedir]/local/standard and [homedir]/local/unicode. this
This creates ''[homedir]/local/legacy'' (for non-Unicode Apertium) and ''[homedir]/local/unicode'' (for Unicode Apertium). Only the latter of these is used here, but see Section 8 below.

=== 4. Install ''lttoolbox'' ===

From ''[homedir]'':

<pre>
cd apertium/lttoolbox-unicode
./autogen.sh
</pre>

At the end, you will get a message about ''PKG_CONFIG_PATH'', so we will set it as part of the configure process.

<pre>
PKG_CONFIG_PATH=[homedir]/local/unicode/lib/pkgconfig ./configure --prefix=[homedir]/local/unicode
</pre>

Obviously, replace ''[homedir]'' here and in subsequent instances by your real path.

<pre>
make
make install
</pre>

Your ''[homedir]/local/unicode'' dir should now contain four folders: ''bin'', ''include'', ''lib'', and ''share''.

=== 5. Install apertium ===

From ''[homedir]'':

<pre>
cd apertium/apertium-unicode
./autogen.sh
PKG_CONFIG_PATH=[homedir]/local/unicode/lib/pkgconfig ./configure --prefix=[homedir]/local/unicode
make
make install
</pre>

Your ''[homedir]/local/unicode/bin'' dir should now contain a number of apertium binaries.

=== 6. Install language-pair data ===

In this instance we will install the ''cy-en'' (Welsh-English) pair. First, we need to ensure that the system can find the new Apertium binaries:

<pre>
export PATH=/[homedir]/local/unicode/bin:$PATH
</pre>

(This can be made permanent later, by adding the path to ~/.bash_profile, or whatever is your preferred method for doing this.)

From ''[homedir]'':

<pre>
cd apertium/apertium-cy-en
./autogen.sh
PKG_CONFIG_PATH=[homedir]/local/unicode/lib/pkgconfig ./configure --prefix=[homedir]/local/unicode
make
make install
</pre>

Your ''[homedir]/local/unicode/share/apertium'' should now contain a new folder ''apertium-cy-en'', and the ''modes'' folder should contain a file for each language direction (''cy-en'' and ''en-cy'').

Note that if you are using an AMD64 processor, you must use version 3.0.4 or above of Apertium. Versions below this have a bug which will mean the make fails.

=== 7. Testing the new install ===

From ''[homedir]'':

<pre>
echo "test" | apertium en-cy
</pre>

You should see ''prawf'' returned.

<pre>
echo "prawf" | apertium cy-en
</pre>

You should see ''test'' returned.

=== 8. (Optional) Installing the non-Unicode version of Apertium ===

This may be useful for language pairs which are not yet available in a Unicode version. All new languages, however, should use the Unicode version as above.

<pre>
cd apertium/lttoolbox
./autogen.sh
PKG_CONFIG_PATH=[homedir]/local/legacy/lib/pkgconfig ./configure --prefix=[homedir]/local/legacy
make
make install
cd ..
cd apertium/apertium
./autogen.sh
PKG_CONFIG_PATH=[homedir]/local/legacy/lib/pkgconfig ./configure --prefix=[homedir]/local/legacy
make
make install
cd ..
export PATH=/[homedir]/local/legacy/bin:$PATH
cd apertium/apertium-xx-xx
./autogen.sh
PKG_CONFIG_PATH=[homedir]/local/legacy/lib/pkgconfig ./configure --prefix=[homedir]/local/legacy
make
make install
</pre>

Revision as of 09:58, 19 October 2007

0. Introduction

This note explains how to install the latest 3.0.4 svn version of Apertium on a stock openSUSE 10.2. The instructions below walk through the installation of the Unicode version of Apertium, since this will handle all of the world's languages. For legacy work, the non-Unicode version can also be installed using a similar process (see Section 8). Apertium is installed here into a directory in the user's homedir - in my case it was /home/kevin/downloads/linguistics, but it can be anything you choose. In this note, this choice will be referred to as [homedir].

1. Install required packages

If you choose the development pattern at or after your openSUSE install (using YaST, Smart, zypper or whatever), you will get most of the packages required for development, and may not have to add all of those listed below. Ensure that the following packages are present:

  • subversion
  • libxml2 and libxml2-devel
  • libxslt
  • libtool
  • pcre and pcre-devel
  • flex
  • automake
  • autoconf
  • gcc-c++

2. Download Apertium

Open a terminal, go to your [homedir] and checkout the latest version:

cd [homedir]
svn co http://apertium.svn.sourceforge.net/svnroot/apertium

This will take some time to fully download, and at the end you should have a directory [homedir]/apertium with 43 folders in it, some containing tools and some containing language-pair data.

3. Set up your install dirs

From [homedir]:

mkdir local
cd local/
mkdir legacy unicode

This creates [homedir]/local/legacy (for non-Unicode Apertium) and [homedir]/local/unicode (for Unicode Apertium). Only the latter of these is used here, but see Section 8 below.

4. Install lttoolbox

From [homedir]:

cd apertium/lttoolbox-unicode
./autogen.sh

At the end, you will get a message about PKG_CONFIG_PATH, so we will set it as part of the configure process.

PKG_CONFIG_PATH=[homedir]/local/unicode/lib/pkgconfig ./configure --prefix=[homedir]/local/unicode             

Obviously, replace [homedir] here and in subsequent instances by your real path.

make
make install

Your [homedir]/local/unicode dir should now contain four folders: bin, include, lib, and share.

5. Install apertium

From [homedir]:

cd apertium/apertium-unicode
./autogen.sh
PKG_CONFIG_PATH=[homedir]/local/unicode/lib/pkgconfig ./configure --prefix=[homedir]/local/unicode
make
make install

Your [homedir]/local/unicode/bin dir should now contain a number of apertium binaries.

6. Install language-pair data

In this instance we will install the cy-en (Welsh-English) pair. First, we need to ensure that the system can find the new Apertium binaries:

export PATH=/[homedir]/local/unicode/bin:$PATH

(This can be made permanent later, by adding the path to ~/.bash_profile, or whatever is your preferred method for doing this.)

From [homedir]:

cd apertium/apertium-cy-en
./autogen.sh
PKG_CONFIG_PATH=[homedir]/local/unicode/lib/pkgconfig ./configure --prefix=[homedir]/local/unicode
make
make install

Your [homedir]/local/unicode/share/apertium should now contain a new folder apertium-cy-en, and the modes folder should contain a file for each language direction (cy-en and en-cy).

Note that if you are using an AMD64 processor, you must use version 3.0.4 or above of Apertium. Versions below this have a bug which will mean the make fails.

7. Testing the new install

From [homedir]:

echo "test" | apertium en-cy

You should see prawf returned.

echo "prawf" | apertium cy-en

You should see test returned.

8. (Optional) Installing the non-Unicode version of Apertium

This may be useful for language pairs which are not yet available in a Unicode version. All new languages, however, should use the Unicode version as above.

cd apertium/lttoolbox
./autogen.sh
PKG_CONFIG_PATH=[homedir]/local/legacy/lib/pkgconfig ./configure --prefix=[homedir]/local/legacy
make
make install
cd ..
cd apertium/apertium
./autogen.sh
PKG_CONFIG_PATH=[homedir]/local/legacy/lib/pkgconfig ./configure --prefix=[homedir]/local/legacy
make
make install
cd ..
export PATH=/[homedir]/local/legacy/bin:$PATH
cd apertium/apertium-xx-xx
./autogen.sh
PKG_CONFIG_PATH=[homedir]/local/legacy/lib/pkgconfig ./configure --prefix=[homedir]/local/legacy
make
make install