[Pachi] Compiling on Windows, notes and a few gcc warnings

Neil Mclean mclean.neil at gmail.com
Thu Apr 16 10:58:50 CEST 2015

Hi Petr

I am compiling the pachi retsugen 11.0 tarball from the git repository.
I get the following warnings below. Is it safe to ignore these warnings?



[CC]   selfatari.c
In file included from ../probdist.h:54:0,
                 from ../board.h:3,
                 from selfatari.c:6:
selfatari.c: In function 'selfatari_cousin':
selfatari.c:547:26: warning: array subscript is above array bounds
    if (board_at(b, groups[gn]) == stone_other(color))
../board.h:294:34: note: in definition of macro 'board_at'
 #define board_at(b_, c) ((b_)->b[c])


[CC]   network.c
network.c: In function 'port_listen':
network.c:56:49: warning: passing argument 4 of 'setsockopt' from
incompatible p
ointer type
  if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)))
In file included from network.c:15:0:
C:/TDM-GCC-32/include/winsock2.h:551:32: note: expected 'const char *' but
ent is of type 'const int *'
 WINSOCK_API_LINKAGE int PASCAL setsockopt(SOCKET,int,int,const char*,int);

Notes for others who wish to compile pachi for windows:

I compiled it using a windows xp sp3 machine 32bit.
I used TDM-Mingw32 instead of the Mingw or Mingw-w64 versions.
It may be possible to compile a 64bit version of pachi using TDM-Mingw64
but since
I dont have a 64bit win setup I have not tried.

The original mingw-get and pthreads-w32 is currently broken, there is a
naming redefination conflicting with one in pthreads.h. This was why I used

There is a patch I found on the internet for the issue above.
I found it easier to use the TDM version as it works out
of the box and the pthreads dll is statically linked.

I choose the SJLJ version of TDM-Mingw32 not the DW2 version as it was the
DW2 would make pachi faster but I guess its not too important.

Use msys (or msys2) for the unix like environment, e.g. to get make.

Use regex 2.7 - http://gnuwin32.sourceforge.net/packages/regex.htm
Copy all the libs and include files from there and put them in relevant
(lib and include) msys locations.

All that needs to be done is run make and use regex2.dll with the pachi.exe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rover.ms.mff.cuni.cz/pipermail/pachi/attachments/20150416/b7390a7b/attachment.html>

More information about the Pachi mailing list