Difference between revisions of "Apertium on Windows"
(New Windows page) |
|||
Line 1: | Line 1: | ||
{{TOCD}} |
{{TOCD}} |
||
==Using Cygwin== |
|||
We are in the process of porting Apetium to Windows. Lttoolbox has already been compiled successfully, but has not been tested extensively. We are now working on porting Apertium. |
|||
It is possible to compile Apertium for use on windows using [http://cygwin.com/ Cygwin], which provides a UNIX-like environment in windows. |
|||
==Getting the code== |
|||
Before you begin you should install the cygwin with the following additional packages, if you find this list incomplete please update it. |
|||
* autoconf (Devel) |
|||
* automake (Devel) |
|||
* flex (Devel) |
|||
* libgcrypt (Libs) |
|||
* libtool (Devel) |
|||
* libxml2 (Devel) |
|||
* libxml2-devel (Devel) |
|||
* libxslt (Libs) |
|||
* pkg-config (Devel) |
|||
* subversion (Devel) |
|||
The Windows branch is currently in the [[Using the Apertium GIT repository|unofficial GIT repository]] under the "windows" branch. To contribute, first follow the steps on [[Using the Apertium GIT repository]]. Now, we'll create a branch called "windows", which will track the "windows" branch in the remote repository: |
|||
===Steps=== |
|||
<pre> |
|||
git branch --track windows origin/windows |
|||
</pre> |
|||
To switch to the "windows" branch, issue: |
|||
# Check out the repository as normal using svn. |
|||
<pre> |
|||
# Patch the apertium source [[Apertium on Windows/No Unlocked Patch|this patch]] (save it as <code>no_unlocked.diff</code>) |
|||
git checkout windows |
|||
#: <code>$ patch -p1 < no_unlocked.diff</code> |
|||
</pre> |
|||
# and [[Apertium on Windows/No ANSI Patch|this one]] too (save as <code>no_ansi.diff</code>) |
|||
#: <code>$ patch -p1 < no_ansi.diff</code> |
|||
# Make and install lttoolbox |
|||
## ./autogen.sh |
|||
## make |
|||
## make install |
|||
# Make and install apertium (required the patches from above) |
|||
## export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ |
|||
## ./autogen.sh |
|||
## make |
|||
== |
==Dependencies== |
||
You will need to get Windows versions of the following tools and libraries to compile the code under Windows: |
|||
=== From Windows === |
|||
* [http://www.microsoft.com/express/vc/ Microsoft's C++ compiler] - the compiler is part of Visual Studio 2008 Express, which is available free of charge. |
|||
* [http://www.cmake.org CMake] - a cross platform build tool |
|||
* [http://xmlsoft.org libxml] - the Windows binaries are at [http://xmlsoft.org/sources/win32/ http://xmlsoft.org/sources/win32/]; you will need: |
|||
** libxml2 |
|||
** zlib |
|||
** libiconv |
|||
** libxslt |
|||
* [http://www.pcre.org/ libpcre] - there are no Windows binaries available and you will have to build this from the source code. |
|||
* [http://gnuwin32.sourceforge.net/packages/flex.htm flex for Windows] - it's probably easiest if you just download the Windows installer version. |
|||
==Setting up the required tools and libraries== |
|||
'''PLEASE NOTE THAT WE DO NOT HAVE THIS WORKING YET. IF YOU CAN HELP US FILL IN THE REMAINING STEPS, WE WOULD BE GRATEFUL''' |
|||
Be sure to start downloading Visual Studio 2008 first, since it is a fairly big download. |
|||
==== Getting the packages ==== |
|||
Next, download and install the Windows version of CMake. Let the installer place CMake in your path, since it will be much easier to run CMake from the command line if you do this. |
|||
The easiest way to get the core packages, is to use the [http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780&release_id=529741 Automated MinGW Installer]. |
|||
The zip files of libxml2, zlib, libiconv and libxslt all have the familiar UNIX layout: |
|||
<!-- |
|||
<pre> |
|||
First, you need to download all the necessary MinGW components. According to the [http://www.mingw.org/download.shtml#Contents MinGW Download page], you need "mingw-runtime, w32api, binutils and gcc tarball packages" for a minimal installation. For our installation, we used (all of which come from the [http://sourceforge.net/project/showfiles.php?group_id=2435 MinGW Sourceforge download page]): |
|||
|- bin |
|||
# mingw-runtime-3.13.tar.gz |
|||
|- include |
|||
# w32api-3.10.tar.gz |
|||
|- lib |
|||
# binutils-2.18.50-20071123.tar.gz |
|||
|- share |
|||
# gcc-core-3.4.5-20060117-1.tar.gz |
|||
</pre> |
|||
# gcc-g++-3.4.5-20060117-1.tar.gz |
|||
You should also install MSYS, coreutils, gawk |
|||
# MSYS-1.0.11-20071204.tar.bz2 |
|||
# coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2 |
|||
Unzip each of these archives and copy the bin, include, lib and share directories in each package into a common directory (for example C:\Program Files\libxml2). |
|||
# bash-3.1-MSYS-1.0.11-1.tar.bz2 |
|||
--> |
|||
Now, unzip the libpcre archive to a temporary folder. To compile libpcre, you will need have Visual Studio AND CMake already installed on your system. Now, open the Visual Studio 8.0 Command Prompt (Start -> Visual C++ 9.0 Express Edition -> Visual Studio Tools -> Visual Studio 8.0 Command Prompt). In this command prompt, go to the directory where you unpacked libpcre. Execute: |
|||
==== Installing the packages ==== |
|||
You will need a way to unpack the downloaded files. [http://www.7-zip.org/ 7Zip] is an excellent open source utility that can unpack tar.gz and tar.bz2 files. |
|||
Create a directory to hold your MinGW installation. We will assume that it is <code>c:\msys\1.0</code>. |
|||
Unpack each of the downloaded files, except for the GCC packages, into <code>c:\msys\1.0</code>. This directory should look as follows after unpacking: |
|||
<pre> |
<pre> |
||
cmakesetup . |
|||
c: |
|||
`-msys |
|||
`-1.0 |
|||
|-bin |
|||
|-doc |
|||
|-include |
|||
|-lib |
|||
`-man |
|||
</pre> |
</pre> |
||
Click the button labelled "Configure". After CMake has gone through its motions, click OK. To compile libpcre, run: |
|||
Each of <code>bin</code>, <code>doc</code>, <code>include</code>, <code>lib</code> and <code>man</code> should contain some files. |
|||
<pre> |
|||
nmake |
|||
Now create a directory called <code>mingw</code> under your installation directory. In our case, we will create <code>c:\msys\1.0\mingw</code>. Unpack the GCC packages into <code>c:\msys\1.0\mingw</code>. |
|||
</pre> |
|||
After the compilation has succeeded, run: |
|||
=== From Linux (cross-compiling) (Debian/Ubuntu) === |
|||
<pre> |
|||
nmake install |
|||
Because some of the packages required to compile Apertium are not ported to MinGW, we can make a cross-compiling in order to use Linux-based programs (e.g FLEX). |
|||
</pre> |
|||
Provided that you haven't changed any setting when you ran the ''cmakesetup'' program, libpcre should install to C:\Program Files\PCRE. |
|||
These instructions have been tested using Ubuntu 7.04 Feisty Fawn. |
|||
==== Setting up the environment ==== |
|||
Packages required |
|||
* mingw32 3.4.5 ('''Ubuntu package''') |
|||
* mingw32-binutils 2.16.91 ('''Ubuntu package''') |
|||
* mingw32-runtime 3.12 ('''You need to install last Debian package from [http://packages.debian.org/unstable/devel/mingw32-runtime here]''') |
|||
* mingw32-libxml ^ |
|||
* mingw32-libxml-dev ^ |
|||
* mingw32-glib ^ |
|||
* mingw32-glib-dev ^ |
|||
* mingw32-libiconv ^ |
|||
* mingw32-libiconv-dev ^ |
|||
* mingw32-libz ^ |
|||
* mingw32-libz-dev ^ |
|||
* mingw32-pkgconfig ^ |
|||
It is possible that some packages are not really required. |
|||
^ You can get them from [http://tadu.dyndns.org/debs/ this repository] |
|||
==== Steps ==== |
|||
# Check out the repository as normal using svn. |
|||
# Patch the apertium source [[Apertium on Windows/No Unlocked Patch|this patch]] (save it as <code>no_unlocked.diff</code>) |
|||
#: <code>$ patch -p1 < no_unlocked.diff</code> |
|||
# [[Apertium on Windows/No ANSI Patch|this one]], (save as <code>no_ansi.diff</code>) |
|||
#: <code>$ patch -p1 < no_ansi.diff</code> |
|||
# also [[Apertium on Windows/Autogen|this one]] (save as <code>autogen.diff</code>) |
|||
#: <code>$ patch -p1 < autogen.diff</code> |
|||
# and [[Apertium on Windows/Ushort patch|this one]] (save as <code>ushort.diff</code>) |
|||
#: <code>$ patch -p1 < ushort.diff</code> |
|||
# Make and install lttoolbox |
|||
## ./autogen.sh |
|||
## make |
|||
## make install |
|||
==Bugs== |
|||
* [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=236489 Cross compiling with wstring] |
|||
Finally, install flex. |
|||
[[Category:Installation]] |
[[Category:Installation]] |
Revision as of 15:21, 8 January 2008
We are in the process of porting Apetium to Windows. Lttoolbox has already been compiled successfully, but has not been tested extensively. We are now working on porting Apertium.
Getting the code
The Windows branch is currently in the unofficial GIT repository under the "windows" branch. To contribute, first follow the steps on Using the Apertium GIT repository. Now, we'll create a branch called "windows", which will track the "windows" branch in the remote repository:
git branch --track windows origin/windows
To switch to the "windows" branch, issue:
git checkout windows
Dependencies
You will need to get Windows versions of the following tools and libraries to compile the code under Windows:
- Microsoft's C++ compiler - the compiler is part of Visual Studio 2008 Express, which is available free of charge.
- CMake - a cross platform build tool
- libxml - the Windows binaries are at http://xmlsoft.org/sources/win32/; you will need:
- libxml2
- zlib
- libiconv
- libxslt
- libpcre - there are no Windows binaries available and you will have to build this from the source code.
- flex for Windows - it's probably easiest if you just download the Windows installer version.
Setting up the required tools and libraries
Be sure to start downloading Visual Studio 2008 first, since it is a fairly big download.
Next, download and install the Windows version of CMake. Let the installer place CMake in your path, since it will be much easier to run CMake from the command line if you do this.
The zip files of libxml2, zlib, libiconv and libxslt all have the familiar UNIX layout:
|- bin |- include |- lib |- share
Unzip each of these archives and copy the bin, include, lib and share directories in each package into a common directory (for example C:\Program Files\libxml2).
Now, unzip the libpcre archive to a temporary folder. To compile libpcre, you will need have Visual Studio AND CMake already installed on your system. Now, open the Visual Studio 8.0 Command Prompt (Start -> Visual C++ 9.0 Express Edition -> Visual Studio Tools -> Visual Studio 8.0 Command Prompt). In this command prompt, go to the directory where you unpacked libpcre. Execute:
cmakesetup .
Click the button labelled "Configure". After CMake has gone through its motions, click OK. To compile libpcre, run:
nmake
After the compilation has succeeded, run:
nmake install
Provided that you haven't changed any setting when you ran the cmakesetup program, libpcre should install to C:\Program Files\PCRE.
Finally, install flex.