Difference between revisions of "Apertium on Ubuntu or Debian"
(Redirect ti installation) |
|||
(57 intermediate revisions by 16 users not shown) | |||
Line 1: | Line 1: | ||
#REDIRECT [[Installation]] |
|||
There a various releases of Ubunutu : |
|||
*Dapper Drake |
|||
*Edgy Eft |
|||
*Feisty Fawn |
|||
*Gutsy Gibbon |
|||
{{TOCD}} |
|||
== Dapper Drake == |
|||
Old installation instructions for Ubuntu/Debian and similar. |
|||
Several programs that are needed cannot be installed easily on Dapper Drake, because the version available with apt-get are too old. We suggest to install a newer version of Ubuntu as for example Edgy Eft or Feisty Fawn |
|||
== Edgy Eft == |
|||
This is guide to install Apertium under Ubuntu Edgy Eft, aka Ubuntu 6.10 |
|||
=== Installing by SVN === |
|||
<pre> |
|||
sudo -s |
|||
</pre> |
|||
''enter your root password'' |
|||
<pre> |
|||
apt-get install subversion build-essential g++ pkg-config libxml2 libxml2-dev libxml2-utils xsltproc flex automake autoconf libtool libpcre3-dev |
|||
</pre> |
|||
''' ''This page is out-of-date, you should probably be reading [[Installation]] instead.'' ''' |
|||
''Then click yes.'' |
|||
''Wait till the packages are downloaded and installed.'' |
|||
<pre> |
|||
exit |
|||
</pre> |
|||
Go to the root of your home directory |
|||
<pre> |
|||
cd |
|||
</pre> |
|||
<pre> |
|||
mkdir local |
|||
mkdir source |
|||
cd source |
|||
</pre> |
|||
<pre> |
|||
svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk apertium |
|||
</pre> |
|||
Go to lttoolbox directory with |
|||
''' ''This page is out-of-date, you should probably be reading [[Installation]] instead.'' ''' |
|||
<pre> |
|||
cd apertium/lttoolbox |
|||
</pre> |
|||
Then launch autogen.sh |
|||
<pre> |
|||
./autogen.sh |
|||
</pre> |
|||
Launch configure (Replace $USER by your user name) |
|||
<pre> |
|||
./configure --prefix=/home/$USER/local/ |
|||
</pre> |
|||
Launch make |
|||
<pre>make</pre> |
|||
That last command may takes some minutes. |
|||
<pre>make install</pre> |
|||
<pre> cd .. </pre> |
|||
<pre> cd apertium </pre> |
|||
<pre>PKG_CONFIG_PATH=/home/$USER/local/lib/pkgconfig ./autogen.sh |
|||
PKG_CONFIG_PATH=/home/$USER/local/lib/pkgconfig ./configure --prefix=/home/$USER/local/ |
|||
</pre> |
|||
Do not forget to replace (twice) $USER by your Ubuntu user name. |
|||
<pre> |
|||
make |
|||
make install |
|||
cd .. |
|||
</pre> |
|||
You have then to compile the language pairs that you want to use. It is the same procedure for every pair, we would give an example with apertium-fr-es |
|||
<pre> |
|||
cd apertium-fr-es/ |
|||
PKG_CONFIG_PATH=/home/$USER/local/lib/pkgconfig ./autogen.sh |
|||
PKG_CONFIG_PATH=/home/$USER/local/lib/pkgconfig ./configure --prefix=/home/$USER/local/ |
|||
make |
|||
make install |
|||
</pre> |
|||
If compilation does not work, you might need to add the directory with Apertium binaries to your path: |
|||
<pre> |
|||
export PATH=$PATH:/home/$USER/local/bin |
|||
</pre> |
|||
Make a test |
|||
<pre> |
|||
echo "J'ai deux frères" | apertium fr-es |
|||
</pre> |
|||
Replace $USER with your Ubuntu user name. |
|||
If you edit the linguistics data, do not forget to type "make" to update. |
|||
To compile all the pairs without typing each directory once you can use the following script : |
|||
<pre> |
|||
list=`ls -d apertium-??-??` # list of folders with a name like apertium-xx-xx |
|||
for folder in $list |
|||
do |
|||
cd $folder >> ../compile.txt |
|||
sh autogen.sh >> ../compile.txt |
|||
PKG_CONFIG_PATH=/home/$USER/local/lib/pkgconfig ./configure --prefix=/home/$USER/local/ >> ../compile.txt |
|||
make >> ../compile.txt |
|||
make install >> ../compile.txt |
|||
cd .. |
|||
done |
|||
</pre> |
|||
Inside compile.txt you can see some of the results of the compilation. |
|||
== Installing the not-quite-recent package (simple) == |
|||
The tarball howto is not finnished yet. |
|||
If you just want to '''use Apertium''' for translation, and don't want to develop anything, you can probably just search for, tick off and install Apertium and your favorite language pairs in Synaptic. There's a friendly [https://help.ubuntu.com/community/SynapticHowto Synaptic HOWTO here]. This should install the required dependencies too. |
|||
Go to http://sourceforge.net/project/showfiles.php?group_id=143781&package_id=159345 and download the latest version |
|||
If you want to '''contribute''' to Apertium or change how it runs in any way, you'll want to install from SVN. Read on below. |
|||
tar xzvf lttoolbox-2.0.3.tar.gz (or put the name of a newer version) |
|||
cd lttoolbox-2.0.3/ |
|||
./configure |
|||
sudo su |
|||
(enter your password) |
|||
make |
|||
== Installing the newest version from SVN (more complicated) == |
|||
Go to http://sourceforge.net/project/showfiles.php?group_id=143781&package_id=157932 and download the latest version (2.0.3 as of June 2007) |
|||
tar xzvf apertium-2.0.3.tar.gz (or put the name of a newer version) |
|||
cd apertium-2.0.3.tar.gz |
|||
./configure |
|||
Step 1: '''install the prerequisites.''' |
|||
== Feisty == |
|||
Open a terminal window and type |
|||
<pre> |
|||
sudo apt-get install subversion build-essential pkg-config gawk libxml2 \ |
|||
libxml2-dev libxml2-utils xsltproc flex automake libtool libpcre3-dev zlib1g |
|||
</pre> |
|||
''enter your password and Wait till the packages are downloaded and installed.'' |
|||
=== From Ubuntu's repository === |
|||
Step 2: '''Download apertium, lttoolbox and language pairs from SVN.''' |
|||
An old version of Apertium is available for Feisty (http://packages.ubuntu.com/feisty/libs/apertium) |
|||
<pre> |
|||
svn co http://svn.code.sf.net/p/apertium/svn/trunk/ apertium |
|||
</pre> |
|||
''Note'': The above checkout will download '''lots of files (over 8Gb)''' with all the released language pairs. If you have limited bandwidth or disk space (or time), please follow the [[Minimal installation from SVN]] instead. |
|||
Step 3: '''Compile and install lttoolbox.''' |
|||
Example: installing apertium and apertium-es-ca |
|||
<pre> |
|||
<code>sudo apt-get install apertium apertium-es-ca</code> |
|||
cd apertium |
|||
or |
|||
cd lttoolbox/ |
|||
System -> Administration -> Synaptic -> Search apertium-es-ca -> Install |
|||
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh |
|||
make |
|||
sudo make install |
|||
sudo ldconfig |
|||
</pre> |
|||
Step 4: '''Compile and install apertium.''' |
|||
=== From SVN === |
|||
<pre> |
|||
cd .. |
|||
cd apertium/ |
|||
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh |
|||
make |
|||
sudo make install |
|||
sudo ldconfig |
|||
</pre> |
|||
Same as for Edgy |
|||
Step 5: '''You can now compile the language pairs that you want to use.''' It's the same procedure for every pair. |
|||
== Gutsy Gibbon == |
|||
There is an apertium version in ubuntu repository and you can do the same like Feisty. |
|||
''Note: we give an example with apertium-fr-es'' |
|||
== Next releases == |
|||
<pre> |
|||
Try with Synaptic |
|||
cd .. |
|||
cd apertium-fr-es/ |
|||
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh |
|||
make |
|||
sudo make install |
|||
</pre> |
|||
==Troubleshooting== |
|||
;‘rpl_malloc’ was not declared in this scope |
|||
If you get: |
|||
Step 6: '''Try it out''' |
|||
<pre> |
<pre> |
||
echo "J'ai deux frères" | apertium fr-es |
|||
make check output |
|||
apertium_destxt.o apertium_destxt.cc |
|||
apertium_destxt.cc: In function ‘void* yyalloc(yy_size_t)’: |
|||
apertium_destxt.cc:2017: error: ‘rpl_malloc’ was not declared in this scope |
|||
apertium_destxt.cc: In function ‘void* yyrealloc(void*, yy_size_t)’: |
|||
apertium_destxt.cc:2029: error: ‘rpl_realloc’ was not declared in this scope |
|||
make[1]: *** [apertium_destxt.o] Error 1 |
|||
make[1]: Leaving directory `/home/surge/Resources/apertium/apertium-3.1.0/apertium' |
|||
</pre> |
</pre> |
||
==Updating== |
|||
Then the best thing to do is comment out the lines: |
|||
If you edit the linguistic data, do not forget to type "make" to update, and "sudo make install" to install the updated data. |
|||
===Compiling all the linguistic data=== |
|||
To compile all the pairs without typing each directory once you can use the following script: |
|||
<pre> |
<pre> |
||
list=`ls -d apertium-??-??` # list of folders with a name like apertium-xx-xx |
|||
AC_FUNC_MALLOC |
|||
for folder in $list |
|||
AC_FUNC_REALLOC |
|||
do |
|||
cd $folder >> ../compile.txt |
|||
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh >> ../compile.txt |
|||
make >> ../compile.txt |
|||
sudo make install >> ../compile.txt |
|||
cd .. |
|||
done |
|||
</pre> |
</pre> |
||
Run the script, and go and make a cup of coffee… this could take a while. |
|||
Inside compile.txt you can see some of the results of the compilation. |
|||
From the <code>configure.ac</code> and then re-run <code>autogen.sh</code>. |
|||
== |
==Troubleshooting== |
||
See [[Installation troubleshooting]]. |
|||
This documentation is partly based on the following resources: |
|||
*http://apertium.sourceforge.net/install.html |
|||
*[[Using SVN]] |
|||
[[Category:Installation]] |
[[Category:Installation]] |
||
[[Category:Documentation in English]] |
Latest revision as of 16:28, 27 April 2017
Redirect to:
Old installation instructions for Ubuntu/Debian and similar.
This page is out-of-date, you should probably be reading Installation instead.
This page is out-of-date, you should probably be reading Installation instead.
Installing the not-quite-recent package (simple)[edit]
If you just want to use Apertium for translation, and don't want to develop anything, you can probably just search for, tick off and install Apertium and your favorite language pairs in Synaptic. There's a friendly Synaptic HOWTO here. This should install the required dependencies too.
If you want to contribute to Apertium or change how it runs in any way, you'll want to install from SVN. Read on below.
Installing the newest version from SVN (more complicated)[edit]
Step 1: install the prerequisites. Open a terminal window and type
sudo apt-get install subversion build-essential pkg-config gawk libxml2 \ libxml2-dev libxml2-utils xsltproc flex automake libtool libpcre3-dev zlib1g
enter your password and Wait till the packages are downloaded and installed.
Step 2: Download apertium, lttoolbox and language pairs from SVN.
svn co http://svn.code.sf.net/p/apertium/svn/trunk/ apertium
Note: The above checkout will download lots of files (over 8Gb) with all the released language pairs. If you have limited bandwidth or disk space (or time), please follow the Minimal installation from SVN instead.
Step 3: Compile and install lttoolbox.
cd apertium cd lttoolbox/ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh make sudo make install sudo ldconfig
Step 4: Compile and install apertium.
cd .. cd apertium/ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh make sudo make install sudo ldconfig
Step 5: You can now compile the language pairs that you want to use. It's the same procedure for every pair.
Note: we give an example with apertium-fr-es
cd .. cd apertium-fr-es/ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh make sudo make install
Step 6: Try it out
echo "J'ai deux frères" | apertium fr-es
Updating[edit]
If you edit the linguistic data, do not forget to type "make" to update, and "sudo make install" to install the updated data.
Compiling all the linguistic data[edit]
To compile all the pairs without typing each directory once you can use the following script:
list=`ls -d apertium-??-??` # list of folders with a name like apertium-xx-xx for folder in $list do cd $folder >> ../compile.txt PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh >> ../compile.txt make >> ../compile.txt sudo make install >> ../compile.txt cd .. done
Run the script, and go and make a cup of coffee… this could take a while.
Inside compile.txt you can see some of the results of the compilation.