Installing and Running Lemur (Version 1.0)


Contents

  1. Installation on Unix

  2. Installation on Windows NT

  3. Running Applications

  4. Testing the Toolkit on Sample Data

  5. Using the API

  6. Modifying the Toolkit



1. Installation on Unix

After downloading the Unix Lemur package (lemur-1.0.tar.gz), follow the following steps to install it:
  1. Unpack the source

  2. On the command line, type in the following commands to unpack the package. This should create a directory named lemur-1.0.

    > gunzip lemur-1.0.tar.gz 
    > tar -xvf lemur-1.0.tar
    
  3. Configure the makefiles
  4. Go to directory lemur-1.0 and type in "./configure". This will generate a file named "MakeDefns", which has some customized definitions to be used in makefiles.

    lemur-1.0>./configure
    
  5. Compile Lemur
  6. With directory lemur-1.0 as the current working directory, type in "gmake". This will compile the whole Lemur toolkit and link all the Lemur applications. (We have only tested Lemur using the GNU make.)

    lemur-1.0> gmake 
    
  7. Install Lemur library
  8. First, set the environment variable LEMUR_INSTALL_PATH to where you would like to install Lemur. The default directory for installation is the root "/".

    Then, with directory lemur-1.0 as the current working directory, type in "gmake install". This will install the Lemur library and include files according to the directory specified by the environment variable LEMUR_INSTALL_PATH. The library will be in LEMUR_INSTALL_PATH/lemur/lib/liblemur.a and all the include files will be in LEMUR_INSTALL_PATH/lemur/include.

    For example, with C-shell,

    lemur> setenv LEMUR_INSTALL_PATH /usr0/mydir-for-lemur
    lemur> make install
    
    will create /usr0/mydir-for-lemur/lemur/lib/liblemur.a and a bunch of ".hpp" (C++ header files) and ".h" (C header files) in /usr0/mydir-for-lemur/lemur/include/. The application executables will be all in /usr0/mydir-for-lemur/lemur/bin.

    For users who are only interested in using Lemur as a library and application suite, the original source tree (i.e., the lemur-1.0 directory) can be removed after this step.

  9. Known Problems with Some C++ Compilers and Operating Systems
  10. In our test, Lemur has been compiled and linked successfully with the following compilers on Unix operating systems.



2. Installation on Windows NT



3. Running Applications

The executables for Lemur applications are generated in the directory app/obj; they will be copied to LEMUR_INSTALL_PATH/lemur/bin after running "make install'. All Lemur applications assume a parameter file, which provides value definitions for all (or most of) the input variables of an application. The parameter file makes it easier to record the settings of parameters used when running an application. This is especially convenient for complicated experiments that usually involve many parameters. (It can be awkward, though, to have an extra file when the application is simple.)

The following is an example parameter file used for BuildBasicIndex application, which builds a basic index in /usr3/web/ (with a prefix index) from a source file named source in the same directory. (On Windows environment, you will need to specify the file path according to the convention of Windows, e.g., using back-slashes.) Note that the use of the semicolon is mandatory.

inputFile    = /usr3/web/source;
outputPrefix = /usr3/web/index;
maxDocuments = 600000;
maxMemory    = 0x10000000;
To run an application, simply use the parameter file as the only argument. For example, if the parameter file above is named buildparam in the directory /usr3/web, then just do:
/usr3/web> BuildBasicIndex buildparam


All applications will display a usage or a list of required input variables, if you run it with the "--help" option. For details about how to use each of the applications in the Lemur toolkit, see the Lemur Applications User's Guide .


4. Testing the Toolkit on Sample Data


The Lemur Toolkit comes with a sample data directory which includes a small public information retrieval testing collection (i.e., the CACM collection available from the Cornell ftp site ftp://ftp.cs.cornell.edu/pub/smart/). This sample data is to let you easily try the toolkit and will help you to understand the capabilities of the toolkit as well as how to use them.

The directory has three shell scripts test_basic_index.sh, test_pos_index.sh, and clean.sh. test_basic_index.sh is a script that uses the basic index and demonstrates most of the functionality of Lemur, i.e., from formatting a database, building an index, to running various kinds of retrieval experiments. test_pos_index.sh does the same thing, but using the position index. (See the API documentation for more information about these two indices.) clean.sh cleans up any files generated by any of the two testing scripts. test_basic_index.sh and test_pos_index.sh are both self-documented, so if you look at the scripts you will be able to understand what they do.

Your output should not be too different from the output contained in the sample output files listed here. Roundoff error should only lead to minor deviations from these results.

Basically, both test_basic_index.sh and test_pos_index.sh would start from a source database file and a query file with some simple SGML format, and build an index of the database and a support file that is necessary to make some retrieval algorithms fast, and then, they will run different retrieval experiments with different parameter files. The retrieval results are evaluated with a perl script ( ireval.pl ) in the app/src directory. A precision recall summary file is generated for each experiment.

You can try to change some of the settings in the parameter files and see how it will affect the retrieval performance.

Windows users might be able to run these scripts under cygwin. Even if they can not run the scripts directly, they should still be able to repeat the commands in these shell scripts manually or in some other automatic way.


5. Using the Lemur API

To use the Lemur API on Unix, you will need both the Lemur library file and all the header files. The installation script of Lemur generally puts the library file in LEMUR_INSTALL_PATH/lemur/lib/liblemur.a and all the header files in LEMUR_INSTALL_PATH/lemur/include/. Header files in C have the extension of .h, while a C++ header file has an extension of .hpp. You will use the Lemur library exactly in the same way as you would use any other C++ library. This means you generally do the following: To use the Lemur API on Windows, see Installation on Windows NT

6. Modifying the Toolkit

  1. The directory structure and makefiles

    The toolkit version 1.0 has the following directories:

    • utility: some common and basic utility classes, including document stream handlers.
    • index: indexing support
    • langmod: general language model support
    • retrieval: retrieval algorithms
    • app: applications
    • data: sample data

    The code exists in all the directories, except "data". Each "code directory" (i.e., a "module") has four subdirectories: include, src, depend, and obj. "include" has all the header files, while "src" has all the implementation files. "depend" is to store a depend file for each source file. "obj" is to hold the compiled object code. obj and depend are created automatically by the makefiles. There are two types of modules: library module and application module. A library module will be compiled and linked as a module library, whereas an application module has a bunch of application programs. Each of them has a main() function. Thus, all the applications must be linked individually. "utility", "index", "langmod", and "retrieval" are library modules; only "app" is an application directory. The makefiles are organized in the following way:

    • A main Makefile in the toolkit root directory. It is to descend to each subdirectory and make it.
    • MakeDefns and MakeRules in the toolkit root directory. MakeDefns has all the common definitions in the module Makefile and MakeRules specify the common rules for making several types of targets.
    • MakeMod and MakeApp in the toolkit root directory. MakeMod is some common definitions for making a library based on a module directory. MakeApp is some common definitions for making all the applications.
    • A Makefile in each of the src subdirectory of each module. It includes MakeDefns, MakeRules, and either MakeMod or MakeApp, depending on the type of the module directory.

    The dependency of an object code on the source code is managed by generating a dependency file (with an extension ".d") for each of the source implementation file.

    • To make (compile/link) the lemur toolkit, go to directory lemur-1.0, and type in "gmake all" or "gmake"
    • To cleanup the Lemur toolkit (remove everything but the source), go to directory lemur-1.0, type in "gmake clean".

    Note that before you can run gmake, you need to run "configure" first, i.e., go to "lemur-1.0", type in "./configure", which will probe your system environment and generate the right MakeDefns, needed by the makefiles in the subdirectories.

  2. To modify an existing file or add a file to an existing directory:

    1. Make the changes
    2. Go to the Lemur root directory
    3. Type in "gmake all"


  3. To add a new (library) module to the toolkit:

    1. Create the module subdirectory in the lemur root directory.
    2. Put all include files in a subdirectory named "include" under the new module directory
    3. Put all implementation files in a subdirectory named "src" under the new module directory.
    4. Add the module directory name to the main Makefile in the toolkit root directory.
    5. Copy a Makefile from an existing module directory (e.g, index/src/Makefile) to <new-module-dir>/src, and change the first two lines to define this module and its dependent modules.

  4. To add a new application directory to the toolkit:

    1. Create the application subdirectory in the lemur root directory
    2. Put all include files in a subdirectory named "include" under the new module directory
    3. Put all implementation files in a subdirectory named "src" under the new module directory
    4. Add the application directory name to the Makefile in the lemur root directory.
    5. Copy a Makefile from an existing application directory (e.g, app/src/Makefile) to <new-application-dir>/src, and change the line that defines the dependent modules.

    The Lemur Project
    Last modified: Fri Jan 4 19:36:28 EST 2002