Contents Up Previous Next

Building on Windows

Prerequisites
Installing Cygwin and MinGW
Installing Boost C++ libraries
Installing wxWidgets
Installing GSL
Installing ATLAS
Installing OCaml and tools
Installing UPX
Installing MiKTeX
Building the whole package
Building the Alwis GUI
Building the command line tools (C++)
Building the command line tools (OCaml)
Building the help files
Building the installer


Prerequisites


Installing Cygwin and MinGW

Go to the Cygwin website and download the setup tool. This tool helps you to download the actual packages. The default package selection is almost fine. You will only need the following additional packages: For detailed information on how to install Cygwin please refer to the Cygwin website.

Then go to the MinGW website and download the packages to install MinGW. You will need the following packages:

You will not need MSYS since you have installed Cygwin. It is recommended to download the binary packages (.tar.gz or .exe instead of -src.tar.gz). Then installing MinGW is just unpacking to a new directory on you hard disk (while maintaining the directory structure contained in the archives). For more detailed information on how to install MinGW please refer to the MinGW website.


Installing Boost C++ libraries

Download Boost from the Boost website. You will need the actual Boost package (source) and the Boost Jam package (binary NTx86). Unpack the first package to any location on you harddisk and unpack the file "bjam.exe'' from the second package to a directory contained in your search path (e.g. "C:\MinGW\bin'').

Open a shell and change into the directory you have unpacked the Boost package to. Type the following command:

    bjam "-sTOOLS=mingw" --prefix=C:\Boost install
Change into the directory "C:\Boost\include\boost-version''. There is a directory "boost'' containing the Boost headers. Move this directory into the include directory of MinGW with following command:
    mv boost C:\MinGW\include
Now change into the directory "C:\Boost\lib''. Since gcc does not support #pragma comments we have to rename the compiled libraries when copying them to the MinGW lib directory. Just execute the following commands:
    mv libboost_date_time-mgw-s.lib C:\MinGW\lib\boost_date_time.lib
    mv libboost_filesystem-mgw-s.lib C:\MinGW\lib\boost_filesystem.lib
    mv libboost_iostreams-mgw-s.lib C:\MinGW\lib\boost_iostreams.lib
    mv libboost_prg_exec_monitor-mgw-s.lib C:\MinGW\lib\boost_prg_exec_monitor.lib
    mv libboost_program_options-mgw-s.lib C:\MinGW\lib\boost_program_options.lib
    mv libboost_regex-mgw-s.lib C:\MinGW\lib\boost_regex.lib
    mv libboost_serialization-mgw-s.lib C:\MinGW\lib\boost_serialization.lib
    mv libboost_signals-mgw-s.lib C:\MinGW\lib\boost_signals.lib
    mv libboost_test_exec_monitor-mgw-s.lib C:\MinGW\lib\boost_test_exec_monitor.lib
    mv libboost_unit_test_framework-mgw-s.lib C:\MinGW\lib\boost_unit_test_framework.lib
    mv libboost_wave-mgw-s.lib C:\MinGW\lib\boost_wave.lib
After that you can delete the directory you unpacked the boost sources to.


Installing wxWidgets

Assume you have installed Cygwin to "C:\Cygwin'' and MinGW to "C:\MinGW''. Ensure that the directories "C:\MinGW\bin'' and "C:\Cygwin\bin'' are contained in you search path, at best at the very beginning of you search path. "C:\MinGW\bin'' has to precede "C:\Cygwin\bin''.

You may change your search path on Windows 2000/XP with the following steps:

After changing environment variables you have to close shells (command line prompts) and reopen them in order to make the changes take effect.

Download wxWidgets from the wxWidgets website. Alwis has been developed with the version 2.6.2. It is incompatible with older versions (less than 2.6). It should work with newer versions but it may require changes to the source code. Unpack the downloaded file to "C:\'', a new directory called "wxWidgets-2.6.2'' will be created.

Open a shell and change into your wxWidgets directory. If you plan to compile a debug version of Alwis you will need the debug version of wxWidgets. Execute the following commands to build it:

    mkdir build-debug
    cd build-debug
    bash ../configure --with-msw --enable-html --enable-debug
                      --enable-debug_gdb --disable-shared
                      --prefix=C:/wxWidgets
    make
    make install
For building the release version of Alwis you will only need the release version of wxWidgets. Execute the following commands to build it:
    mkdir build-release
    cd build-release
    bash ../configure --with-msw --enable-html --disable-debug
                      --disable-shared --prefix=C:/wxWidgets
    make
    make install
You may execute both sequences of commands if you need both versions of wxWidgets. There are no file name clashes between the two versions.

Now change to directory "utils/tex2rtf'' within your wxWidgets directory and execute the following commands:

    make
    cd src
    strip -s -v tex2rtf.exe
    upx --best -v tex2rtf.exe
Copy the resulting file "tex2rtf.exe'' to a directory contained in your search path, e.g. "C:\MinGW\bin''. It is needed to compile the help files.


Installing GSL

Download the GNU Scientific Library installer from the GSL website and install it into the same directory you have installed MinGW into, e.g. C:\MinGW. It copies some header files to the "include'' directory and some precompiled library files to the "lib'' directory. That's all.


Installing ATLAS

You can download the ATLAS precompiled library from two different locations: Any version greater or equal 3.0 should suffice. There are several packages optimized for different CPUs. You will have to trade off between performance and compatibility. The SSE2 package will probably be the fastest but will not work with older processors. The Alwis executables are build using the SSE1 optimized version and therefore work with all Pentium class processors.

In the downloaded archive (regardless of version and optimization level) contains some header files (*.h) and some precompiled libraries (*.a). Sometimes the archive contains a directory structure. The paths stored in the archive should not be used. Unpack the header files to your MinGW's include directory (e.g. "C:\MinGW\include'') and the library files to your MinGW's lib directory (e.g. "C:\MinGW\lib''). Remember not to use the paths stored in the archive. That's all.


Installing OCaml and tools

The easiest way to install OCaml on Windows is to download the Ocaml-MinGW-Maxi Distribution from this website. Just unpack the downloaded archive to "C:\'', a new directory "ocamlmgw'' is created. This package contains everything you need, especially the OCaml compiler itself and the tool ocamlfind.

You need to adapt your search path when compiling OCaml programs (at least temporarily). For more information see the OCaml build notes.


Installing UPX

Installing the Ultimate Executable Packer is as simple as possible. Just download the precompiled Windows version from the UPX website and unpack the contained executable "upx.exe'' to any directory contained in your search patch.


Installing MiKTeX

Download MiKTeX setup from the MiKTeX website. There are three different packages offered by the setup. The smallest one should suffice. After installing ensure that the MiKTeX bin directory is included in you search path. You can check this by typing "pdflatex --version'' in a shell.


Building the whole package

There is a global makefile in the directory "src''. There are five targets in this makefile: "gui'', "tools_gcc'', "tools_ocaml'', "help'' and "setup''. In order to build the whole package just type the following commands:
    make gui
    make tools_cpp
    make tools_ocaml
    make help
    make setup
Probably you will need to check you search path settings before invoking "make tools_ocaml''. For further details see the OCaml build instructions. For more details on how to build the single components of Alwis please refer to the following sections.


Building the Alwis GUI

The Alwis GUI consists of two components: the core (directory "src/core'') and the actual GUI (directory "src/gui''). You have to build the core first. Change into the core directory and type the following commands:
    make clean
    make FINAL=1
Now change into the gui directory and type the following commands:
    make clean
    make FINAL=1
Now there should be a file called "alwis.exe''. You may omit the parameter "FINAL=1'' when building the core and gui in order to get the debug version of Alwis. Note: The debug version of Alwis is quite huge - about 70 MB.

When having problems building the GUI you should check the settings in the GUI's makefile. Maybe you have to adapt some settings like the path to your wxWidgets directory.


Building the command line tools (C++)

The command line tools written in C++ are located in the directory "src/tools''. Just change into this directory and type the following commands:
    cd stemmer
    make clean
    make
    cd ..
    make clean
    make FINAL=1
Now there should be five executables called "cat2stream.exe'', "filterstream.exe'', "stemstream.exe'', "stream2matrix.exe'' and "stream2queries.exe''. Again you may omit the parameter "FINAL=1'' in order to get the debug versions of these tools.


Building the command line tools (OCaml)

Assume you have installed Cygwin to "C:\Cygwin'' and OCaml to "C:\ocamlmgw''. Ensure that the directories "C:\ocamlmgw\bin'' and "C:\Cygwin\bin'' are contained in you search path, at best at the very beginning of you search path.

Important: Now the directory "C:\Cygwin\bin'' has to precede the directory "C:\MinGW\bin'' in you search path. There is an incompatibility between the OCaml compiler and the non-Cygwin version of MinGW. If you get strange errors while compiling you should check your search path for this order.

Change into the directory "src/queryengine''. Just type following commands to build the query engine:

    make
    make pack
Now change into the directory "src/tools/compute-plsi''. Again just type the following commands to build the tool for calculating PLSI models:
    make
    make pack
And finally change into the directory "src/mdevices''. Once again just type the following commands to build the precision recall measurement device:
    make
    make pack

Building the help files

For building the help files just change into the directory "src/help'' and type "make''. Then there is a new folder "alwis_help'' containing plain HTML files (e.g. for the use as online manual), a new file "alwis_help.htb'' used by the built-in Alwis help browser and a new file "manual.pdf'' for viewing and printing with a PDF viewer.


Building the installer

You will need the Inno Setup Compiler from the Inno Setup website. Furthermore all components of Alwis should have been built (preferably in FINAL mode, stripped and compressed). Simply open the file "setup.iss'' from the directory "src/setup'' with the Inno Setup Compiler. Select "Compile'' from the menu "Build''. It will create file called "alwis-version.exe'' in the directory "src''.