# Downloading and installation

Click here to download the code. This is a so-called gzipped tar file. To install the program on any Unix platform, do:

- gzip -dc dealer.tar.gz | tar xvf -
- cd dealer
- make

And you should end up with the dealer executable in your current working directory. Then test the program with

- cd Examples
- make test

This will process all examples in the Examples directory, store the output for visual inspection and compare the output against a reference copy of the output. The output from the test typically starts with:

    test_dealer.pl
    ------------------------------------------------------------------
    Now processing Descr.6c
    Done, output in Output.6c
    Comparing against reference output from Refer.6c
    6c6
    < Time needed  25.55 sec
    ---
    > Time needed  12.99 sec
    ...And so on for other examples...

The example that was run was "Descr.6c", output of this example can be found in "Output.6c". Comparing the output against the reference output showed 1 difference: the CPU time that was needed to process the input file. The example took 25.55s when it was just run, the machine where the reference copy was produced needed only 12.99 seconds.

This particular difference is, of course, harmless, as the CPU time needed to process an example varies from computer to computer. Other differences that can be safely ignored are the dates in the PBN example. However, if the program had crashed on this example, the output from the test had started with:

    test_dealer.pl
    ------------------------------------------------------------------
    Now processing Descr.6c
    Done, output in Output.6c
    Comparing against reference output from Refer.6c
    0a1,6
    > king drops: 0.573465
    > finesse: 0.749792
    > Generated 1000000 hands
    > Produced 110556 hands
    > Initial random seed 1
    > Time needed  12.99 sec

and it would be time to start debugging.

The exhaust mode is still under development. By default, it is switched off. To include the code, edit the Makefile and change the line:

- CFLAGS= (...) -DNDEBUG

into

- CFLAGS= (...) -DNDEBUG -DFRANCOIS

## Problems when compiling

- Not all versions of make support the -C flag. If this happens on your system, edit the Makefile and replace all lines:

  > ${MAKE} -C directory action

  by

  > cd directory ; make action

- Mike Zimmermann reported that on MAC OS X (aka Darwin), the line CFLAGS has to be:
  - CFLAGS= -g -DNDEBUG -DFRANCOIS -I.

# Portability

The program has been developed under SunOS on Sun hardware. I (Hans) am a reasonably competent programmer though, and I expect the program to be highly portable. The most suspect part is in the initialisation of the random number generator. The system call used here might need to be changed on other OSes.

There has been a DOS and OS/2 port by Pedl Rau. I tested the speed at about 9000 hands a second on my 486DX33. Note: this has been superseeded by the work from (a.o.) Paul Baxter, Alex Martelli and Danil Suits.

Henk Uijterwaal has compiled his version under Linux (2.0.x and 2.2.x) without any problem, except that one needed to do:

> ln -s /usr/bin/flex /usr/bin/lex

as flex has succeeded lex on Linux. On Ultrix, DEC Alpha(OSF), BSDI/3.x and SGI, the program compiled without any problem.

A. Martelli (alex@magenta.com) used to build and run Dealer on Win/NT and Win/98 with the free Cygwin GCC C/C++ compiler and Unix emulation environment. Main changes needed were byacc instead of yacc, as well as flex instead of lex, in the Makefile. A Makefile with all these changes is available in the MSDOS subdirectory.

Dealer's latest versions build and run fine using Microsoft Visual Studio 5 and 6 (still using byacc and flex if needed for syntax mods, but with no other known dependency on Cygwin); there is a current dependency on the Winsock2 DLL (for ntohs, ntohl functions) soon to be removed.