Difference between revisions of "Apertium on Ubuntu or Debian"

From Apertium
Jump to navigation Jump to search
(Simplified to basic installation to /usr/local. Lots of people have had lots of problems with the PATH part. If anyone revert, then pls put the more complicated instructions with PATHs separate)
Line 17: Line 17:


<pre>
<pre>
sudo apt-get install subversion build-essential g++ pkg-config libxml2 libxml2-dev libxml2-utils xsltproc flex automake autoconf libtool libpcre3-dev
sudo -s
</pre>
</pre>

''enter your root password''
''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>

''Then click yes.''

''Wait till the packages are downloaded and installed.''
''Wait till the packages are downloaded and installed.''


<pre>
exit
</pre>


Go to the root of your home directory


<pre>
<pre>
svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk apertium
cd
</pre>
</pre>
''Note'': If you have limited bandwidth or disk space, please follow [[Minimal installation from SVN]] instead.


<pre>
mkdir local
mkdir source
cd source
</pre>

If you have limited bandwidth or disk space, please see [[Minimal installation from SVN]].
<pre>
svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk apertium
</pre>


Go to lttoolbox directory with
Go to lttoolbox directory with
Line 60: Line 36:


Then launch autogen.sh
Then launch autogen.sh
<pre>./autogen.sh</pre>

<pre>

./autogen.sh

</pre>

Launch configure (Replace $USER by your user name)

<pre>
./configure --prefix=/home/$USER/local/
</pre>


Launch make
Launch make

<pre>make</pre>
<pre>make</pre>


That last command may takes some minutes.
That last command may takes some minutes.


<pre>make install</pre>
<pre>sudo make install</pre>


<pre> cd .. </pre>
<pre> cd .. </pre>
<pre> cd apertium </pre>
<pre> cd apertium </pre>


<pre>PKG_CONFIG_PATH=/home/$USER/local/lib/pkgconfig ./autogen.sh
<pre>PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh
PKG_CONFIG_PATH=/home/$USER/local/lib/pkgconfig ./configure --prefix=/home/$USER/local/
</pre>
</pre>

Do not forget to replace (twice) $USER by your Ubuntu user name.


<pre>
<pre>
make
make
make install
sudo make install
cd ..
</pre>
</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
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>
<pre>
cd ..
cd apertium-fr-es/
cd apertium-fr-es/
PKG_CONFIG_PATH=/home/$USER/local/lib/pkgconfig ./autogen.sh
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh
PKG_CONFIG_PATH=/home/$USER/local/lib/pkgconfig ./configure --prefix=/home/$USER/local/
make
make
make install
sudo 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>
</pre>


Line 127: Line 81:
do
do
cd $folder >> ../compile.txt
cd $folder >> ../compile.txt
sh autogen.sh >> ../compile.txt
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh >> ../compile.txt
PKG_CONFIG_PATH=/home/$USER/local/lib/pkgconfig ./configure --prefix=/home/$USER/local/ >> ../compile.txt
make >> ../compile.txt
make >> ../compile.txt
make install >> ../compile.txt
sudo make install >> ../compile.txt
cd ..
cd ..
done
done

Revision as of 20:00, 6 May 2009

There a various releases of Ubunutu :

  • Dapper Drake
  • Edgy Eft
  • Feisty Fawn
  • Gutsy Gibbon

Dapper Drake (6.06 LTS)

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 (6.10)

This is guide to install Apertium under Ubuntu Edgy Eft, aka Ubuntu 6.10

Installing by SVN

sudo apt-get install subversion build-essential g++ pkg-config libxml2 libxml2-dev libxml2-utils xsltproc flex automake autoconf libtool libpcre3-dev  

enter your root password Wait till the packages are downloaded and installed.


svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk apertium

Note: If you have limited bandwidth or disk space, please follow Minimal installation from SVN instead.


Go to lttoolbox directory with

cd apertium/lttoolbox

Then launch autogen.sh

./autogen.sh

Launch make

make

That last command may takes some minutes.

sudo make install
 cd .. 
 cd apertium 
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh
make
sudo make install

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

cd ..
cd apertium-fr-es/
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh
make
sudo make install

Make a test

echo "J'ai deux frères" | apertium fr-es

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 :

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

Inside compile.txt you can see some of the results of the compilation.

Installing tarball (tar.gz)

The tarball howto is not finnished yet.


Go to http://sourceforge.net/project/showfiles.php?group_id=143781&package_id=159345 and download the latest version

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

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

Feisty (7.04)

From Ubuntu's repository

An old version of Apertium is available for Feisty (http://packages.ubuntu.com/feisty/libs/apertium)


Example: installing apertium and apertium-es-ca sudo apt-get install apertium apertium-es-ca or System -> Administration -> Synaptic -> Search apertium-es-ca -> Install


From SVN

Same as for Edgy

Gutsy Gibbon (7.10)

There is an apertium version in ubuntu repository and you can do the same like Feisty.

Hardy Heron (8.04 LTS)

There is an apertium version in ubuntu repository. Try with Synaptic There are backports of the Apertium 3.1 packages for Hardy at pgquiles' PPA

Next releases

Try with Synaptic


Troubleshooting

‘rpl_malloc’ was not declared in this scope

If you get:

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'

Then the best thing to do is comment out the lines:

AC_FUNC_MALLOC
AC_FUNC_REALLOC

From the configure.ac and then re-run autogen.sh.

Source

This documentation is partly based on the following resources: