You can get the most recent version of GNU Go ftp.gnu.org or a mirror (see http://www.gnu.org/order/ftp.html for a list).  You can read about newer versions and get other information at http://www.gnu.org/software/gnugo/.

GNU/Linux and Unix
==================

Untar the sources, change to the directory gnugo-3.6. Now do:

        ./configure [OPTIONS]
        make

Several configure options will be explained in the next section. You do not need to set these unless you are dissatisfied with GNU Go's performance or wish to vary the experimental options.

As an example,

        ./configure --enable-level=9 --enable-cosmic-gnugo

will make a binary in which the default level is 9, and the experimental ``cosmic''' option is enabled. A list of all configure options can be obtained by running ./configure --help. Further information about the experimental options can be found in the next section (see Configure Options).

After running configure and make, you have now made a binary called interface/gnugo. Now (running as root) type

        make install

to install gnugo in /usr/local/bin.

There are different methods of using GNU Go. You may run it from the command line by just typing:

        gnugo

but it is nicer to run it using CGoban 1 (under X-Windows), Jago (on any platform with a Java runtime environment) or other client programs offering a GUI.

You can get the most recent version of CGoban 1 from http://sourceforge.net/projects/cgoban1/. The earlier version 1.12 is available from http://www.igoweb.org/~wms/comp/cgoban/index.html. The CGoban version number MUST be 1.9.1 at least or it won't work. CGoban 2 will not work.

See CGoban, for instructions on how to run GNU Go from Cgoban, or see Other Clients, for Jago or other clients.

Configure Options
=================

There are three options which you should consider configuring, particularly if you are dissatisfied with GNU Go's performance.

Ram Cache
---------

By default, GNU Go makes a cache of 8 Megabytes in RAM for its internal use. The cache is used to store intermediate results during its analysis of the position.

Increasing the cache size will often give a modest speed improvement. If your system has lots of RAM, consider increasing the cache size. But if the cache is too large, swapping will occur, causing hard drive accesses and degrading performance. If your hard drive seems to be running excessively your cache may be too large. On GNU/Linux systems, you may detect swapping using the program 'top'. Use the 'f' command to toggle SWAP display.

You may override the size of the default cache at compile time by running one of:

        ./configure --enable-cache-size=n

to set the cache size to n megabytes. For example

        ./configure --enable-cache-size=32

creates a cache of size 32 megabytes. If you omit this, your default cache size will be 8 MB. You must recompile and reinstall GNU Go after reconfiguring it by running make and make install.

You may override the compile-time defaults by running gnugo with the option --cache-size n, where n is the size in megabytes of the cache you want, and --level where n is the level desired.  We will discuss setting these parameters next in detail.

Default Level
-------------

GNU Go can play at different levels. Up to level 10 is supported. At level 10 GNU Go is much more accurate but takes an average of about 1.6 times longer to play than at level 8.

The level can be set at run time using the --level option. If you don't set this, the default level will be used. You can set the default level with the configure option --enable-level=n. For example

     ./configure --enable-level=9

sets the default level to 9. If you omit this parameter, the compiler sets the default level to 10. We recommend using level 10 unless you find it too slow. If you decide you want to change the default you may rerun configure and recompile the program.

DFA Configure Option
--------------------

There are two distinct implementations of the pattern matcher in GNU Go. The DFA (Discrete Finite-state Automata) option was considered experimental in GNU Go 3.0 but is now standard. You can disable it by with the configure option ./configure --disable-dfa.  The option is harder to debug than the old matcher but significantly faster (see DFA).

Other Options
-------------

Anything new in the engine is generally tested as an experimental option which can be turned on or off at compile time or run time. Some ``experimental'' options such as the break-in code and the semeai code are no longer experimental but are enabled by default.

This section can be skipped unless you are interested in the experimental options.

Moreover, some configure options were removed from the stable release. For example it is known that the owl extension code can cause crashes, so the configure option --enable-experimental-owl-ext was disabled for 3.6.

The term ``default'' must be clarified, since there are really two sets of defaults at hand, runtime defaults specified in config.h and compile time default values for the runtime defaults, contained in configure (which is created by editing configure.in then running autoconf. For example we find in config.h

     /* Center oriented influence. Disabled by default. */
     #define COSMIC_GNUGO 0

     /* Break-in module. Enabled by default. */
     #define USE_BREAK_IN 1

This means that the experimental cosmic option, which causes GNU Go to play a center-oriented game (and makes the engine weaker) is disabled by default, but that the break-in module is used. These are defaults which are used when GNU Go is run without command line options. They can be overridden with the run time options:

     gnugo --cosmic-gnugo --without-break-in

Alternatively you can configure GNU Go as follows:

     ./configure --enable-cosmic-gnugo --disable-experimental-break-in

then recompile GNU Go. This changes the defaults in config.h, so that you do not have to pass any command line options to GNU Go at run time to get the experimental owl extension turned on and the experimental break-in code turned off.

If you want to find out what experimental options were compiled into your GNU Go binary you can run gnugo --options to find out. Here is a list of experimental options in GNU Go.

  * experimental-break-in. Experimental break-in code (see Break Ins). You should not need to configure this because the break in code is enabled by default in level 10, and is turned off at level 9. If you don't want the breakin code just play at level 9.

  * cosmic-gnugo. An experimental style which plays a center oriented game and has a good winning rate against standard GNU Go, though it makes GNU Go weaker against other opponents.

  * large-scale. Attempt to make large-scale captures. See http://lists.gnu.org/archive/html/gnugo-devel/2003-07/msg00209.html for the philosophy of this option. This option makes the engine slower.

  * metamachine. Enables the metamachine, which allows you to run the engine in an experimental mode whereby it forks a new gnugo process which acts as an ``oracle.'' Has no effect unless combined with the --metamachine run-time option.

Other options are not experimental, and can be changed as configure or runtime options.

  * chinese-rules Use Chinese (area) counting.

  * resignation-allowed Allow GNU Go to resign games. This is on by default.

Compiling GNU Go on Microsoft platforms
=======================================

GNU Go is being developed on Unix variants. GNU Go is easy to build and install on those platforms. GNU Go 3.6 has support for building on MS-DOS, Windows 3.x, Windows NT/2000 and Windows 95/98.

There are two approaches to building GNU Go on Microsoft platforms.

 1. The first approach is to install a Unix-like environment based on ports of GCC to Microsoft platforms. This approach is fully supported by the GNU Go developers and works well. Several high quality free Unix-environments for Microsoft platforms are available.

     One benefit of this approach is that it is easier to participate in Gnu Go's development. These unix environments come for instance with the `diff' and `patch' programs necessary to generate and apply patches.

     Another benefit of the unix environments is that development versions (which may be stronger than the latest stable version) can be built too.  The supporting files for VC are not always actively worked on and consequently are often out of sync for development versions, so that VC will not build cleanly.

 2. The second approach is to use compilers such as Visual C developed specially for the Microsoft platform. GNU Go 2.6 and later support Visual C. Presently we support Visual C through the project files which are supplied with the distribution.

The rest of this section gives more details on the various ways to compile GNU Go for Microsoft platforms.

Windows 95/98, MS-DOS and Windows 3.x using DJGPP
-------------------------------------------------

On these platforms DJGPP can be used. GNU Go installation has been tested in a DOS-Box with long filenames on Windows 95/98. GNU Go compiles out-of-the box with the DJGPP port of GCC using the standard Unix build and install procedure.

Some URLs for DJGPP:

DJGPP home page: http://www.delorie.com/djgpp/

DJGPP ftp archive on simtel:

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/

Once you have a working DJGPP environment and you have downloaded the gnugo source available as gnugo-3.6.tar.gz you can build the executable as follows:

            tar zxvf gnugo-3.6.tar.gz
            cd gnugo-3.6
            ./configure
            make

Optionally you can download glib for DJGPP to get a working version of snprintf.

Windows NT, 2000, XP, 95/98/ME using Cygwin
-------------------------------------------

Cygwin is a full fledged and rapidly maturing unix environment on top of windows. Cygwin installs very easily with the interactive setup program available from the cygwin homepage at http://sources.redhat.com/cygwin/. In fact precompiled versions of stable GNU Go releases as well as of the cgoban X11 GUI can be downloaded through Cygwin's setup. Cygwin's setup also provides precompiled packages of most of the unix tools necessary to participate in development.

If you want to build GNU Go yourself make sure to download the ncurses packages prior to building GNU Go. GNU Go compiles out-of-the box using the standard Unix build procedure on the Cygwin environment. After installation of cygwin and fetching gnugo-3.6.tar.gz you can type:

       tar zxvf gnugo-3.6.tar.gz
       cd gnugo-3.6
       ./configure
       make

The generated executable is not a stand-alone executable: it needs cygwin1.dll that comes with the Cygwin environment. cygwin1.dll contains the emulation layer for Unix.

Windows NT, 2000, XP, 95/98/ME using MinGW32
--------------------------------------------

The Cygwin environment also comes with MinGW32. The mingw32 platform generates an executable that relies only on Microsoft DLLs. This executable is thus completely comparable to a Visual C executable and easier to distribute than the Cygwin executable. To build on cygwin an executable suitable for the win32 platform type the following at your cygwin prompt:

       tar zxvf gnugo-3.6.tar.gz
       cd gnugo-3.6
       env CC='gcc -mno-cygwin' ./configure
       make

The generated executable can be reduced in size significantly by using the upx compression program that is available through Cygwin's setup program.

Windows NT, Windows 95/98 using Visual C and project files
----------------------------------------------------------

We assume that you do not want to change any configure options. If you do, you should edit the file config.vc. Note that when configure is run, this file is overwritten with the contents of config.vcin, so you may also want to edit config.vcin, though the instructions below do not have you running configure.

 1. Open the VC++ 6 workspace file gnugo.dsw

 2. Set the gnugo project as the active project (right-click on it, and select "Set as Active Project".  Select 'Build' from the main menu, then select 'Build gnugo.exe', this will make all of the runtime subprojects.

Notes:

  * a) The build can also be done from the command line:

              msdev gnugo.dsw /make "gnugo - Win32 Release"

  * b) The default configuration is 'Debug', build the optimized version by selecting 'Build' from the main menu , then select 'Set active Configuration' and click on 'gnugo - Win32 Release'. See the Visual Studio help for more on project configurations.

  * c) A custom build step in the first dependent subproject (utils) copys config.vc to config.h in the root directory. If you want to modify config.h, copy any changes to config.vc. In particular if you want to change the default level or default cache size, whose significance is discussed in see GNU/Linux and Unix, you must edit this file.

  * d) This project was built and tested using VC version 6.0. It has not been tested, and will most likely not work with earlier versions of VC.

Running GNU Go on Windows NT and Windows 95/98
----------------------------------------------

GNU Go does not come with its own graphical user interface. The Java client jago can be used.

To run Jago you need a Java Runtime Environment (JRE). This can be obtained from http://www.javasoft.com/.  This is the runtime part of the Java Development Kit (JDK) and consists of the Java virtual machine, Java platform core classes, and supporting files. The Java virtual machine that comes with I.E. 5.0 works also.

Jago: http://www.rene-grothmann.de/jago/

 1. Invoke GNU Go with gnugo --quiet --mode gmp

 2. Run gnugo --help from a cygwin or DOS window for a list of options

 3. optionally specify --level <level> to make the game faster

Jago works well with both the Cygwin and MinGW32 executables. The DJGPP executable also works, but has some problems in the interaction with jago after the game has been finished and scored.

Macintosh
=========

If you have Mac OS X you can build GNU Go using Apple's compiler, which is derived from GCC.