INSTALL file for Freecell Solver
================================

Quick and Dirty Compilation
---------------------------

Freecell Solver was converted to use CMake ( http://www.cmake.org/ ) 
starting from version 2.12.0. You'll need to install CMake version 2.6.0
from your distribution's repository or from its source distribution.

Next, run 
    
    cmake-gui .         # For the GUI configuration applet

Or:
    ccmake .            # For the Curses-based configuration applet

With a fallback to:

    cmake .             # Non-interactive application.

This will build and install the "freecell-solver" shared library,
and "fc-solve" which is the Freecell Solver executable for you.

It will also build and install the board generation program. More 
information about them can be found in the "board_gen" sub-directory of
this distribution.

Changing the Maximal number of Freecells or Stacks or Cards per Stack
---------------------------------------------------------------------

The following parameters to the cmake" script which accept an argument
control the hard-coded parameters of the Freecell Solver executables:

"-DMAX_NUM_FREECELLS:STRING=$NUM" - The maximal number of freecells

"-DMAX_NUM_STACKS:STRING=$NUM" - The maximal number of stacks (columns)

"-DMAX_NUM_INITIAL_CARDS_IN_A_STACK:STRING=$NUM" - The maximal number of 
initial cards per stack.

Notice that it's very important to set the maximal number of initial cards
per stack, or else it's possible that a stack will eventually overflow.

"Compact" States
---------------------

In Compact States, the contents of the card stacks are stored inside the 
states, rather than in a central collection (where the states contain only
pointers). Despite their name, they actually consume more memory than Indirect
Stack States which are the default.

Compact states used to be faster than Indirect Stack States, but now it
seems indirect stack states are at least slightly faster even for games
whose stacks are not very long. If you still would wish to enable it,
TODO : FILL IN.

Installing under Win32
----------------------

Freecell Solver is distributed with a makefile suitable for use with 
Microsoft Visual C++. To build it using it follow the following steps:

1. Copy "config.h.win32" to "config.h" and "prefix.h.win32" to "prefix.h";
In the directory Presets/ copy presetrc.win32 to presetrc.

2. Optionally, edit it to set its preferences

3. Type "nmake /f Makefile.win32".

If you have an IDE of some sort you can take the following steps to compile
Freecell Solver:

1. Open a project for Freecell Solver.

2. Add all the C files except "test_multi_parallel.c" to the project.

3. Copy the file config.h.win32 to config.h and prefix.h.win32 to prefix.h.

4. Build.

If you are using gcc or some other command-line compiler, you should
write the makefile based on the files "Makefile" or "Makefile.lite",
and then compile according to it.

Testing:
--------

* To test Freecell Solver, you need to:

1. Configure it.

2. Run "make install".

3. Type "ctest -V" (or "make test" just for the verdict).

Please report any errors to me ( http://www.shlomifish.org/me/contact-me/ ).
