Difference between revisions of "Apertium on openSUSE"

From Apertium
Jump to navigation Jump to search
(GitHub migration)
 
(38 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[[Installation sur openSUSE|En français]]
{{TOCD}}
=== Introduction ===
=== 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 9). 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]''.
This note explains how to install the latest svn version of Apertium on a stock openSUSE 12.3 Milestone 1. 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]''.

(For general installation help, see [[Installation]].)


=== Install required packages ===
=== 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:
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:
* git
* subversion
* libxml2 and libxml2-devel
* libxml2 and libxml2-devel
* libxslt
* libxslt1 and libxslt-devel
* libtool
* libtool
* pcre and pcre-devel
* libcpcre1 and pcre-devel
* flex
* flex
* make
* automake
* automake
* autoconf
* autoconf
Line 18: Line 23:
=== Download Apertium ===
=== Download Apertium ===


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


<pre>
<pre>
cd [homedir]
cd [homedir]
svn co http://apertium.svn.sourceforge.net/svnroot/apertium
git clone https://github.com/apertium/apertium.git
git clone https://github.com/apertium/lttoolbox.git
git clone https://github.com/apertium/apertium-cy-en.git
</pre>
</pre>


You can replace cy-en by different language pair. For the list of language pairs go [http://wiki.apertium.org/wiki/List_of_language_pairs#Trunk_.28released_pairs.29 here.]
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.


=== Set up your install dirs ===
=== Set up your install dirs ===
Line 33: Line 40:
<pre>
<pre>
mkdir local
mkdir local
cd local/
mkdir legacy unicode
</pre>
</pre>

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 9 below.


=== Install ''lttoolbox'' ===
=== Install ''lttoolbox'' ===
Line 44: Line 47:


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


Obviously, replace ''[homedir]'' here and in subsequent instances by your real path.
At the end, you will get a message about ''PKG_CONFIG_PATH'', so we will set it as part of the configure process.

Set the ''local'' dir as part of the configure process:


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


Your ''[homedir]/local'' dir should now contain four folders: ''bin'', ''include'', ''lib'', and ''share''.
Obviously, replace ''[homedir]'' here and in subsequent instances by your real path.

=== Install ''apertium'' ===


We will set ''PKG_CONFIG_PATH'' as part of the configure process. We will also set up a library path to ensure Apertium can find the ''lttoolbox'' libraries we just built.


From ''[homedir]'':


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


In case your architecture is x86_64, then you should check if there is directory lib or lib64, and if it is lib64, you have to do the follow instructions:
Your ''[homedir]/local/unicode'' dir should now contain four folders: ''bin'', ''include'', ''lib'', and ''share''.
<!-- Nyder (1th Dec, 2012): I am using openSUSE 12.3; x86_64; and I have lib instead of lib64, but for safety I didn`t remove it . -->

=== Install ''apertium'' ===


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


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


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

=== Install VISL CG3 ===

Apertium for Welsh now requires this constraint grammar package to help with disambiguation. For install instructions go [http://wiki.apertium.org/wiki/Apertium_and_Constraint_Grammar#Installing_VISL_CG3 here].

Tips:
<prefix> - it must be ''[homedir]/local/ ''

''tmalloc'' is required, so you have to install also the last package.

The packages can have different names than in that instructions, for example:
boost-devel instead of libboost-dev
gperftools-devel instead of libgoogle-perftools-dev


=== Install language-pair data ===
=== Install language-pair data ===
Line 82: Line 118:


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


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


From ''[homedir]'':
From ''[homedir]'' you go to directory with chosen language-pair.


Minimal installation:
<pre>
<pre>
cd apertium/apertium-cy-en
cd apertium-cy-en
</pre>
./autogen.sh

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

In this directory:
<pre>
export LD_LIBRARY_PATH=[homedir]/local/lib
export PKG_CONFIG_PATH=[homedir]/local/lib/pkgconfig
export PATH=[homedir]/local/bin:$PATH
./autogen.sh
./configure --prefix=[homedir]/local
make
make
make install
make install
</pre>
</pre>


In case your architecture is x86_64, then you should check if there is directory lib or lib64, and if it is lib64, you have to do the follow instructions in directory with choosen language-pair:
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.

=== Testing the new install ===


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


<pre>
<pre>
export LD_LIBRARY_PATH=[homedir]/local/lib64
echo "test" | apertium en-cy
export PKG_CONFIG_PATH=[homedir]/local/lib64/pkgconfig
export PATH=[homedir]/local/bin:$PATH
./autogen.sh
./configure --prefix=[homedir]/local
make
make install
</pre>
</pre>


Your ''[homedir]/local/share/apertium'' should now contain a new folder ''apertium-cy-en'', and the ''modes'' folder should contain a file for the Welsh-English language direction (''cy-en.mode'').
You should see ''prawf'' returned.


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.
<pre>
echo "prawf" | apertium cy-en
</pre>


=== Testing the new install ===
You should see ''test'' returned.

=== (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.


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


<pre>
<pre>
cd apertium/lttoolbox
echo "prawf" | apertium cy-en
./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>
</pre>

You should see ''test'' returned. Currently there is no English-Welsh direction.

[[Category:Documentation]]
[[Category:Installation|SVN]]
[[Category:Installation]]
[[Category:Documentation in English]]

Latest revision as of 02:48, 9 March 2018

En français

Introduction[edit]

This note explains how to install the latest svn version of Apertium on a stock openSUSE 12.3 Milestone 1. 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].

(For general installation help, see Installation.)

Install required packages[edit]

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:

  • git
  • libxml2 and libxml2-devel
  • libxslt1 and libxslt-devel
  • libtool
  • libcpcre1 and pcre-devel
  • flex
  • make
  • automake
  • autoconf
  • gcc-c++

Download Apertium[edit]

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

cd [homedir]
git clone https://github.com/apertium/apertium.git
git clone https://github.com/apertium/lttoolbox.git
git clone https://github.com/apertium/apertium-cy-en.git

You can replace cy-en by different language pair. For the list of language pairs go here.

Set up your install dirs[edit]

From [homedir]:

mkdir local

Install lttoolbox[edit]

From [homedir]:

cd lttoolbox/
./autogen.sh

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

Set the local dir as part of the configure process:

./configure --prefix=[homedir]/local
make
make install

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

Install apertium[edit]

We will set PKG_CONFIG_PATH as part of the configure process. We will also set up a library path to ensure Apertium can find the lttoolbox libraries we just built.


From [homedir]:

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

In case your architecture is x86_64, then you should check if there is directory lib or lib64, and if it is lib64, you have to do the follow instructions:

From [homedir]:

cd apertium
export LD_LIBRARY_PATH=[homedir]/local/lib64
export PKG_CONFIG_PATH=[homedir]/local/lib64/pkgconfig
export PATH=[homedir]/local/bin:$PATH
./autogen.sh 
./configure --prefix=[homedir]/local
make
make install

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

Install VISL CG3[edit]

Apertium for Welsh now requires this constraint grammar package to help with disambiguation. For install instructions go here.

Tips: <prefix> - it must be [homedir]/local/

tmalloc is required, so you have to install also the last package.

The packages can have different names than in that instructions, for example: boost-devel instead of libboost-dev gperftools-devel instead of libgoogle-perftools-dev

Install language-pair data[edit]

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/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] you go to directory with chosen language-pair.

Minimal installation:

cd apertium-cy-en


In this directory:

export LD_LIBRARY_PATH=[homedir]/local/lib
export PKG_CONFIG_PATH=[homedir]/local/lib/pkgconfig 
export PATH=[homedir]/local/bin:$PATH
./autogen.sh 
./configure --prefix=[homedir]/local
make
make install

In case your architecture is x86_64, then you should check if there is directory lib or lib64, and if it is lib64, you have to do the follow instructions in directory with choosen language-pair:

From [homedir]:

export LD_LIBRARY_PATH=[homedir]/local/lib64
export PKG_CONFIG_PATH=[homedir]/local/lib64/pkgconfig 
export PATH=[homedir]/local/bin:$PATH
./autogen.sh 
./configure --prefix=[homedir]/local
make
make install

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

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.

Testing the new install[edit]

From [homedir]:

echo "prawf" | apertium cy-en

You should see test returned. Currently there is no English-Welsh direction.