In short, ./configure; make
will build GNU Go; optionally (running
as root) make install
will put it into `/usr/local/bin' and also
install the man page. You also will probably want to install CGoban.
Get the most recent tar file from ftp.gnu.org or a mirror. A list of mirrors may be found at:
Untar the sources, change to the directory `gnugo-2.6/'. Now do:
./configure make
This makes a binary called `interface/gnugo'. Now (running as root) type
make install
This will install gnugo in `/usr/local/bin/', and also install the man page `gnugo.6' into `/usr/man/man6/'.
There are two methods of using GNU Go. You may run it from the
command line by just typing gnugo
, but it is nicer to run it under
X-Windows using CGoban.
Obtain the most recent version of CGoban from Bill Shubert's web site:
The CGoban version number MUST be 1.9.1 at least or it won't work. Instructions for using CGoban are elsewhere in this document see section Running GNU Go via CGoban.
On one GNU/Linux machine an incompatible `/usr/include/curses.h' (from BSD) had declarations inconsistent with those in `/usr/include/term.h'. The symptom of this problem is compilation errors in `engine/moyo.c' and `engine/showbord.c'.
In this case, the correct `curses.h' was found in `/usr/include/ncurses' and a correct compilation was obtained after changing
#include <curses.h>
to
#include <ncurses/curses.h>
in `engine/moyo.c' and `engine/showbord.c'. If you have a problem
with errors in `engine/moyo.c' and `engine/showbord.c' caused by
curses you should try such a remedy first. If this doesn't work, you shouldn't
curse. Run configure --disable-color
to turn off the color option and
compile again. Another alternative if you want color is
configure --without-curses --enable-color
. This will substitute
ansi escape sequences for curses.
Documentation in `doc/' consists of a man page `gnugo.6', the info files `gnugo.info', `gnugo.info-1', ... and the Texinfo files from which the info files are built. The Texinfo documentation contains this User's Guide and extensive information about the algorithms of GNU Go, for developers.
If you want a typeset copy of the Texinfo documentation, you can
make gnugo.dvi
or make gnugo.ps
in the `doc/'
directory.
You can make an HTML version with the command makeinfo --html
gnugo.texi
. Better HTML documentation may be obtained using
texi2html -split_chapter gnugo.html
. You can obtain the
texi2html
utility from
http://www.mathematik.uni-kl.de/~obachman/Texi2html/. (See also
http://texinfo.org/texi2html/.) Unfortunately Version 1.58 of
texi2html
does not support the @option
and @command
tags. These are supported in Version 1.60-Beta. However our current
recommendation is to use Version 1.58, and to add the lines
'command', 'CODE', 'option', 'SAMP',
to the style_map
around line 178 of the perl script.
User documentation can be obtained by running gnugo --help
or man gnugo
from any terminal, or from the Texinfo
documentation.
Documentation for developers is in the Texinfo documentation, and in comments throughout the source. Contact us at gnugo@gnu.org if you are interested in helping to develop this program.
This is an extremely nice way to run GNU Go. CGoban provides a beautiful graphic user interface under X-Windows.
Start CGoban. When the CGoban Control panel comes up, select "Go Modem". You will get the Go Modem Protocol Setup. Choose one (or both) of the players to be "Program," and fill out the box with the path to gnugo. After clicking OK, you get the Game Setup window. Choose "Rules Set" to be Japanese (otherwise handicaps won't work). Set the board size and handicap if you want. Click OK and you are ready to go.
In the Go Modem Protocol Setup window, when you specify the path to GNU Go, you can give it command line options, such as --quiet to suppress most messages. Since the Go Modem Protocol preempts standard I/O other messages are sent to stderr, even if they are not error messages. These will appear in the terminal from which you started CGoban.
Other command line options can be listed by typing gnugo --help
-or- man gnugo
from any terminal.
Even if you do not have CGoban installed you can play with GNU Go
using its default Ascii interface. Simply type gnugo
at the command line, and GNU Go will draw a board. Typing
help
will give a list of options. At the end of the
game, pass twice, and GNU Go will prompt you through the
counting. You and GNU Go must agree on the dead groups--you
can toggle the status of groups to be removed, and when you
are done, GNU Go will report the score.
You can run GNU Go from Emacs. This has the advantage that you place the stones using the cursor arrow keys. This may require Emacs 20.4 or later--it has been tested with Emacs 20.4 but does not work with Emacs 19 or Emacs 20.2.
Load `interface/gnugo.el', either by M-x load-file
,
or by copying the file into your `site-lisp' directory and
adding a line
(autoload 'gnugo "gnugo" "GNU Go" t)
in your `.emacs' file.
Now you may start GNU Go by M-x gnugo
. You will be prompted for
command line options see section Invoking GNU Go: Command line options. Using these, you may set the
handicap, board size, color and komi.
You can enter commands from the GNU Go ASCII interface after typing `:'. For example, to take a move back, type `:back', or to list all commands, type `:help'.
Here are the default keybindings:
Select point as the next move. An error is signalled for invalid locations. Illegal locations, on the other hand, show up in the GNUGO Console buffer.
Quit. Both Board and Console buffers are deleted.
Resign.
Refresh. Includes restoring default window configuration.
Bury both Board and Console buffers (when the boss is near).
Pass; i.e., select no location for your move.
Extended command. Type in a string to be passed directly to the inferior GNUGO process."
Jago, like CGoban is a client capable of providing GNU Go with a graphical user interface. Unlike CGoban, it does not require X-Windows, so it is an attractive alternative under Windows. You will need a Java runtime environment. Obtain Jago at
http://mathsrv.ku-eichstaett.de/MGF/homes/grothmann/jago/Go.html
and follow the links there for the Java runtime environment.
The Go Modem Protocol (GMP) was developed by Bruce Wilcox with input from David Fotland, Anders Kierulf and others, according to the history in
ftp://www.joy.ne.jp/welcome/igs/Go/programs/protocol.Z
Any Go program should use this protocol since it is standard. Since CGoban supports this protocol, the user interface for any Go program can be done entirely through CGoban. The programmer can concentrate on the real issues without worrying about drawing stones, resizing the board and other distracting issues.
The Smart Go Format (SGF), is the standard format for storing Go games. GNU Go supports both reading and writing SGF files. The SGF specification (FF[4]) is at:
Don't print copyright and other messages
Load the named SGF file
Stop loading just before the indicated move is played. move can be either the move number or location.
Write sgf output to file
Force the playing mode ('ascii', 'test' or 'gmp'). The default is ASCII, but if no terminal is detected GMP (Go Modem Protocol) will be assumed. In practice this is usually what you want, so you may never need this option.
Select a style of opening play. The possibilities are:
- standard (default opening)
- no_fuseki (fuseki module turned off)
- tenuki (often plays elsewhere in the opening)
- fearless (risky style of play)
- aggressive (tenuki and fearless)
Deep reading cutoff. When reading beyond this depth (default 14) GNU Go assumes that any string which can obtain 3 liberties is alive. Thus GNU Go can read ladders to an arbitrary depth, but will miss other types of capturing moves.
Deep reading cutoff. Beyond this depth (default 9) GNU Go will no longer try backfilling moves in its reading.
Deep reading cutoff. When reading beyond this depth (default 5) GNU Go assumes that any string which can obtain 4 liberties is alive.
Deep reading cutoff. Beyond this depth (default 8) GNU Go no longer tries very hard to analyze kos.
Memory in megabytes used for hashing (default 8). GNU Go stores results of its reading calculations in a Hash table. If the Hash table gets full, the reading continues, but more slowly. The symptoms of this is that (1) there is an unusually complicated situation on the board and (2) GNU Go is playing slowly. Normally 8 megabytes is adequate to prevent this. However if you have ample memory, or if you have increased the reading depth using the -D, -B, -F or -K you may want to increase the size of the Hash cache using this option.
This option requires -l filename, implies test mode. The mode can be:
- move: test at move node only
- annotation: test at annotation node only
- both: test at move and annotation nodes
- game: test to see if gnugo considered each move made
See section Regression testing.
Test all patterns, even those smaller in value than the largest move found so far. This should never affect GNU Go's final move, and it will make it run slower. However this can be very useful when "tuning" GNU Go. It causes both the traces and the output file (-o) to be more informative.
Use RXVT or Linux Console. (see section Colored Display)
Use RXVT or Linux Console. (see section Colored Display)
Produce debugging output. The debug level is given in hexadecimal, using the bits defined in the following table from `engine/liberty.h'.
- DEBUG_GENERAL 0x0001
- DEBUG_COUNT 0x0002
- DEBUG_BOARD 0x0004
- DEBUG_CAPTURE 0x0008
- DEBUG_STACK 0x0010
- DEBUG_WIND 0x0020
- DEBUG_HELPER 0x0040
- DEBUG_LOADSGF 0x0080
- DEBUG_WORMS 0x0100
- DEBUG_LADDER 0x0200
- DEBUG_MATCHER 0x0400
- DEBUG_DEFENDER 0x0800
- DEBUG_ATTACKER 0x1000
- DEBUG_BORDER 0x2000
- DEBUG_DRAGONS 0x4000
- DEBUG_SAVESGF 0x8000
- DEBUG_HEY 0x10000
- DEBUG_SEMEAI 0x20000
- DEBUG_EYES 0x40000
hash (see liberty.h for bits).
Print more information about worm data.
moyo debugging, show moyo board. The level is fully documented elsewhere (see section Colored Display).
benchmarking mode - can be used with -l.
stack trace (for debugging purposes).
Print statistics (for debugging purposes).
Print debugging information. Use twice for more detail.
Set random number seed. This can be used to guarantee that GNU Go will make the same decisions on multiple runs through the same game. If
seed
is zero, GNU Go will play a different game each time.
Analyze whether the string at location can be captured, and if so, whether it can be defended. If used with -o, this will produce a variation tree in SGF.
Requires -l. until can be "end", "last" or a move.
- end - finish the game by selfplaying from the end of the file until two passes
- last - estimate territorial balance at the end of the of the file
- move - load file until move is reached and estimate territorial balance
load SGF file, output final position (requires -l).
The analyze options allow analysis of a game stored as sgf file by using --testmode. When using --testmode with --analyze move tree variations are ignored.
The --analyze option also works with --benchmark and --score. The analyze functions will be executed on every move in --benchmark and --testmode game.
If used with --analyzerfile filename, the results of the analysis are written to the file filename.
Analyzed board states on other modes:
--score end: gnugo analyzes every move it makes at the end of the file until the game is finished.
--score last: board state at the end of the file will be analyzed
--score move number: board state just before movenum will be analyzed
--score position: board state just before position is occupied will be analyzed
--testmode annotation: board state just before the annotated node is reached will be analyzed
You can give more than one --analyze option also by concatenating with "" or by using commas without space.
gnugo --score end --analyzerfile outputfile -l inputfile
will create outputfile and writes the inputfile to it plus the endgame moves for scoring and adds the result property. If you want to overwrite an already existing result property use --analyze overwrite. This also overwrites DT, AP and RU.
gnugo --score end --analyzerfile outputfile -l inputfile \ --analyze dragonstatus
same as above, but writes to outputfile the dragonstatus for every move gnugo made from the last move in inputfile to the end of the game.
gnugo --testmode game --analyzerfile outputfile -l inputfile \ --analyze wormliberties
loads inputfile and writes to outputfile the number of liberties for each worm on every move.
gnugo --testmode annotation --analyzerfile outputfile -l inputfile \ --analyze capture
loads inputfile and writes to outputfile the capturing move for each weak group on every move followed by a annotation (see section Regression testing)