Difference between revisions of "Apertium on Mac OS X (Local)"
Line 5: | Line 5: | ||
==Preparation== |
==Preparation== |
||
First you need a '''full installation of XCode (http://developer.apple.com/tools/xcode/)''' and '''Macports (http://www.macports.org/install.php)'''. |
|||
At the very minimum we assume that you have subversion (<code>svn</code>) installed. If you don't, you can install it with: |
|||
The following packages from MacPorts are required: |
|||
<pre> |
<pre> |
||
$ sudo port install |
$ sudo port install autoconf automake expat flex \ |
||
gettext gperf help2man libiconv libtool \ |
|||
libxml2 libxslt m4 ncurses ncursesw p5-locale-gettext \ |
|||
pcre perl5.8 pkgconfig zlib gawk svn |
|||
</pre> |
</pre> |
||
(Some of these are necessary just because Macports wants them.) |
|||
Of course, if you don't have root access you'll have to install them manually. |
|||
Then continue... |
Then continue... |
Revision as of 14:15, 3 June 2010
This page gives instructions on compiling Apertium on Mac OS/X, it will presume you are installing into a directory called Local
inside your home directory (your home directory will be in /Users/<your user name>
). This is slightly more complicated, but more contained. Please replace spectie
with the name of your user. You can find the name of your user by typing whoami
.
Preparation
First you need a full installation of XCode (http://developer.apple.com/tools/xcode/) and Macports (http://www.macports.org/install.php).
The following packages from MacPorts are required:
$ sudo port install autoconf automake expat flex \ gettext gperf help2man libiconv libtool \ libxml2 libxslt m4 ncurses ncursesw p5-locale-gettext \ pcre perl5.8 pkgconfig zlib gawk svn
(Some of these are necessary just because Macports wants them.)
Of course, if you don't have root access you'll have to install them manually.
Then continue...
$ pwd $ mkdir Local $ mkdir Source
Downloading
$ svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/lttoolbox $ svn co http://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium $ curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.00.tar.gz $ curl -O http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz $ curl -O ftp://xmlsoft.org/libxml2/libxml2-2.7.7.tar.gz
Compiling
First export these environment variables so that binaries and libraries from your local installation are taken before those from the system installation.
$ export PATH=/Users/spectie/Local/bin/:$PATH $ export PKG_CONFIG_PATH=/Users/spectie/Local/lib/pkgconfig $ export LD_LIBRARY_PATH=/Users/spectie/Local/lib $ cd Source
libxml
$ cd libxml2-2.7.7 $ ./configure --prefix=/Users/spectie/Local/ $ make $ make install
pkg-config
$ cd pkg-config-0.23 $ ./configure --enable-utf8 --prefix=/Users/spectie/Local/ $ make $ make install
lttoolbox
- Note: This is likely to fail in more than one place, check the troubleshooting info below!
$ cd lttoolbox $ sh autogen.sh --prefix=/Users/spectie/Local/ $ make $ make install
libpcre
$ cd pcre-8.00 $ ./configure --enable-utf8 --prefix=/Users/spectie/Local/ $ make $ make install
apertium
- Note: This is likely to fail in more than one place, check the troubleshooting info below!
$ cd apertium $ sh autogen.sh --prefix=/Users/spectie/Local/ $ make $ make install
Troubleshooting
Undefined macro #1
- Problem
The autogen.sh
script complains about an undefined macro when encountering the dnl
(comment) string.
configure.ac:112: error: possibly undefined macro: dnl If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation.
- Solution
Run automake -a
then autoconf
, then autoheader
, then ./configure --prefix=/Users/spectie/Local/
.
Undefined macro #2
- Problem
$ sh autogen.sh --prefix=/Users/spectie/Local/ - libtoolize. You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'. - aclocal. - autoconf. configure.ac:109: error: possibly undefined macro: dnl If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation.
- Solution
Re-run the autogen.sh
command until it works.
syntax error near unexpected token
- Problem
The configure
script cannot find the PKG_CHECK_MODULES
macro
checking for pkg-config... /Users/spectie/Local/bin//pkg-config ./configure: line 19355: syntax error near unexpected token `LTTOOLBOX,' ./configure: line 19355: `PKG_CHECK_MODULES(LTTOOLBOX, dnl'
or
checking for gawk... (cached) awk ./configure: line 2183: syntax error near unexpected token `APERTIUM,' ./configure: line 2183: ` PKG_CHECK_MODULES(APERTIUM, apertium-1.0 >= 1.0.0,'
- Solution
Run:
$ aclocal -I /Users/spectie/Local/share/aclocal $ automake -a $ autoconf $ autoheader $ automake -a $ ./configure --prefix=/Users/spectie/Local/
You don't have cg-proc installed
Apertium for Welsh now requires this constraint grammar package to help with disambiguation. For install instructions go here.
See also
- Apertium on Mac OS X (System) — for installation in the main system.