1. Introduction
---------------

Glaurung is a free UCI chess engine.  It is not a complete chess
program, but requires some UCI compatible GUI (like XBoard with
PolyGlot, eboard, Jos, Arena, Sigma Chess, Shredder, Chess Partner,
or Fritz) in order to be used comfortably.  Read the documentation for
your GUI of choice for information about how to use Glaurung with your
GUI.

Glaurung 2-epsilon/3 ("two minus epsilon thirds") is a development
version of Glaurung 2, a complete rewrite of Glaurung.  It is still
far from complete, and lacks many important features.  It is also
likely to not be entirely stable, especially when running in Microsoft
Windows.  For most users, it is probably advisable to keep using the
old Glaurung 1.2.1 until the rewritten program grows more mature.

Beginning with version 2-epsilon/3, Glaurung has support for up to 
four CPUs.  Because the program currently cannot automatically detect
the number of CPUs on your computer, it uses only a single search thread
by default.  If your computer has two or more CPUs (this includes
dual-core CPUs like the Intel Core Duo or the AMD Athlon 64 X2), you
should set the "Threads" UCI parameter to the number of CPUs to obtain 
optimal performance.


2. Files
--------

This distribution of Glaurung consists of the following files:

  * README, the file you are currently reading.

  * COPYING, a text file containing the GNU General Public License.

  * src/, a subdirectory containing the full source code, including a
    Makefile that can be used to compile Glaurung on Unix-like
    systems.  For further information about how to compile Glaurung
    yourself, read section 4 below.

  * MacOSX/, a subdirectory containing excutables for Apple Macintosh
    computers running Mac OS X.  There are three different
    executables, for use on Intel Macs, G4 Macs and G5 Macs.  The G5
    executable is untested and may not work, please report to
    tord@glaurungchess.com if you experience problems.

  * LinuxX86/, a subdirectory containing x86 Linux executables.

  * Windows/, a subdirectory containing 32-bit and 64-bit Windows
    executables.

  * polyglot.ini, for using Glaurung with Fabien Letouzey's PolyGlot
    adapter.


3. Opening books
----------------

This version of Glaurung has experimental support for PolyGlot opening
books.  For information about how to create such books, consult the
PolyGlot documentation.  Currently, Glaurung requires that the book
file is named book.bin and is placed in Glaurung's working directory.


4. Compiling it yourself
------------------------

On Unix-like systems, it should usually be possible to compile
Glaurung directly from the source code with the included Makefile.
The exception is computer with big-endian CPUs, like PowerPC
Macintoshes.  Some of the bitboard routines in the current version of
Glaurung are endianness-sensitive, and won't work on a big-endian CPU.
Commenting out the line with "#define USE_32BIT_ATTACKS" near the
beginning of bitboard.h should solve this problem.

There is also a problem with compiling Glaurung on certain 64-bit 
systems, regardless of the endianness.  If Glaurung segfaults 
immediately after startup, try to comment out the line with 
"#define USE_FOLDED_BITSCAN" near the beginning of bitboard.h and
recompile.

Finally, even if Glaurung does work without any changes on your 64-bit
system, undefining USE_32BIT_ATTACKS and/or USE_FOLDED_BITSCAN may be
worth trying.  It is possible that this will give a slightly faster
executable.  On 32-bit systems, the default settings are probably
best.


5. History
----------

2007-05-06: Glaurung 2 - epsilon
--------------------------------

The first public release, and the first version of my new program
which is able to match the old Glaurung 1.2.1 on a single CPU.  Lots
of features and chess knowledge is still missing.

2007-05-10: Glaurung 2 - epsilon/2
----------------------------------

This version is very close to 2 - epsilon.  The major changes are:

  * A number of compatibility problems which appeared when trying to
    compile Glaurung 2 - epsilon on various operating systems and CPUs
    have been solved.

  * Fixed a major bug in the detection of rooks trapped inside a
    friendly king.

  * Added knowledge about several types of drawn endgames.

  * Fixed a few FRC related bugs.  FRC now works, but because of
    serious holes in the evaluation function the program plays very
    badly.

  * A slightly more sophisticated king safety evaluation.

2007-06-07: Glaurung 2 - epsilon/3
----------------------------------

The first public version with support for multiple CPUs.  Unless you
have a dual-core (or better) computer, use Glaurung with a PolyGlot
book, or runs games with ponder on, you may want to skip this version,
which is almost certainly no stronger than 2 - epsilon/2 when running
on a single CPU.  The main changes compared to the previous version
are:

  * Parallel search, with support for 1-4 CPUs.  The program currently
    always allocates a separate pawn hash table and material hash
    table for four threads, which is a pure waste of RAM if your
    computer has just a single CPU.  This will be fixed in a future
    version.

  * Fixed a bug in book randomization.  When using Polyglot books, the
    previous version would always select exactly the same move in the
    same position after a restart of the program.  Thanks to Pavel
    Hse for pointing this out.

  * Fixed a UCI pondering bug: Glaurung no longer instantly prints its
    best move when the maximum depth is reached during a ponder
    search, as the previous version did.  According to the UCI
    protocol, it is not allowed to print the best move before the
    engine has received the "stop" or "quit" command.

  * Additional search information:  The new version displays hash
    saturation and the current line(s) of search.

  * Several minor bug fixes and optimizations in the search and
    evaluation. 


6. Terms of use
---------------

Glaurung is free, and distributed under the GNU General Public License
(GPL).  Essentially, this means that you are free to do almost exactly
what you want with the program, including distributing it among your
friends, making it available for download from your web site, selling
it (either by itself or as part of some bigger software package), or
using it as the starting point for a software project of your own.

The only real limitation is that whenever you distribute Glaurung in
some way, you must always include the full source code, or a pointer
to where the source code can be found.  If you make any changes to the
source code, these changes must also be made available under the GPL.

For full details, read the copy of the GPL found in the file named
COPYING.


7. Feedback
-----------

The author's e-mail address is tord@glaurungchess.com
