1) INTRODUCTION ***********************

Logol program requires following structure:

-- install directory
      |
      -- LogolExec.sh : main execution program
      |
      |----- lib   : contains JAR libraries and log property file
      |
      |----- prolog : contains templates required for prolog generation as well as shells used during program execution
      |
      |----- Doc (optional) : Javadoc and prolog documentation
      |
      |----- tools : contains user defined specific cost function programs and logol scripts

Logol code is distributed under CeCILL v2 license. Libraries licenses are
included in Doc directory.

2) Build from source *********************

To build logol, one need:
 - Ruby and the gem cassiopee (gem install cassiopee)
 - Java JDK (Oracle or OpenJDK)
 - sicstus prolog or swi-prolog.
 - A compiler (gcc for linux, Visual Studio for Windows)
 
Run:
ant -f build.xml dist_sicstus  for sicstus support.
ant -f build.xml dist_swi for swi-prolog support.

On Windows, all tools must be in the user PATH.


3) INSTALLATION: **************************

Debian/RPM/MacOS/Windows packages are available on web site (http://logol.genouest.org).

WARNING: on Windows, installation and work directories MUST NOT contain whitespaces not accents.

The software requires Cassiopee Ruby gem or VMatch for suffix array searches. VMatch is an external software with its own license:
http://www.vmatch.de/ (S. Kurtz).


If software has been manually installed :
Uncompress the package in a directory.
- edit prolog/logol.properties and update dir.result and workingDir. workingDir is a temporary directory used for file creation and result storage.
- in LogolMultiExec.sh, update path for LD_LIBRARY_PATH to reflect path to DRM .so library (for sge only, not needed for local execution)
- if using vmatch and suffix search tool is not in path for user running queries, edit prolog/suffixSearch.rb and set path to tool (vmatch), and suffix.path in prolog.properties


Properties (prolog/logol.properties) can be modified depending on requirements. See documentation for further info or edit the file.

In case of cluster usage:
Edit prolog/mail.tpl to set up the mail template sent at the end of the jobs.

Nota Bene:
Compilation of prolog program if binary is not available: (requires Sicstus 4.2.x or swi-prolog)
Go in prolog directory, sicstus binary must be in PATH
>sicstus -i
>>compile(logol).
>>save_program('logol.sav').
>>halt.

>spld --main=user logolMain.c --static --resources=system,random -o logol.exe
>spld --main=user preanalyse.c --static --resources=system,random -o preanalyse.exe

For swi-prolog, read prolog/SWI-README

4) AUTOTEST ******************************

Go to install path and execute logolTest.sh without parameter. All tests should pass.

5) EXECUTION: *****************************

Execute LogolExec.sh (1 sequence) or LogolMultiexec.sh (for banks) with appropriate parameters (see shell file)


6) Documentation generation

Go in tools directory and run generate-doc.sh. SWI-Prolog and TexLive are required.
PDF docs will be generated in Doc.

For grammar documentation, go in Doc/grammar and run generate.sh. Programs needs antlr-works and tex4ht.
It will produce html document with each grammar rule.

6) Windows

Ruby is required and must be in the PATH of the user. Ruby for Windows is available at http://rubyinstaller.org/.

One should use LogolExec.rb and LogolMultiExec.rb instead of LogolExec.sh and LogolMultiExec.sh.

To install Cassiopee gem: gem install cassiopee

DRMAA (cluster) is not supported as well as custom external and cost functions.
VMatch is not (yet) supported (Cassiopee only)
