PDA

View Full Version : Can't install poker-eval on cygwin.


stigmata
11-23-2005, 12:21 PM
Hi,

poker-eval (http://sourceforge.net/project/showfiles.php?group_id=13546) is the backend to twodimes.net. You should be able to install it on cygwin but it's not working for me. When I do make I get the following errors:

Any ideas?

if ccache gcc -DHAVE_CONFIG_H -I. -I. -I../include -I../include -I../include
-pipe -O3 -Wall -Wpointer-arith -Wstrict-prototypes -MT five_card_hands.o -MD -M
P -MF ".deps/five_card_hands.Tpo" -c -o five_card_hands.o five_card_hands.c; \
then mv -f ".deps/five_card_hands.Tpo" ".deps/five_card_hands.Po"; else rm -f ".
deps/five_card_hands.Tpo"; exit 1; fi
five_card_hands.c:29:24: getopt_w32.h: No such file or directory
five_card_hands.c: In function `parse_args':
five_card_hands.c:69: warning: implicit declaration of function `getopt'
five_card_hands.c:72: error: `optarg' undeclared (first use in this function)
five_card_hands.c:72: error: (Each undeclared identifier is reported only once
five_card_hands.c:72: error: for each function it appears in.)
make[1]: *** [five_card_hands.o] Error 1
make[1]: Leaving directory `/home/jclose/pkrsrc/poker-eval-128.0/examples'
make: *** [all-recursive] Error 1

CORed
11-23-2005, 12:34 PM
Are you running "make" from the cygwin shell? Did you run the configure script from the cygwin shell first? It looks like five_card_hands.c is trying to include getopt_w32.h, which is not a cygwin include file (at least it's not on my cygwin installation). This make me think maybe it's configured for visual c or something.

If you haven't already done this, open your cywin shell, change to the parent directory of you source tree for poker_eval, run ./configure, then run make.

stigmata
11-23-2005, 12:40 PM
That's exactly how i did it;

cd poker-eval-128.0
./configure
make

CORed
11-23-2005, 12:56 PM
Strange. I don't find getopt_w32.h in either my cywin directory or my mingw directory. I suspect that the configure script is not working proerly with cygwin. You might want to file a bug report with the maintainers. You could try changing the the #include <getopt_w32.h> in five_card_hands.c to #include<getopt.h>. However, if the configure script isn't working right, this will probably just generate an error elsewhere. Alos, I don't know if the funtion prototypes, etc. in the missing getop_w32.h are compatible with those in getopt.h.

stigmata
11-23-2005, 12:57 PM
Hmmmmn.... I was just trying something along the same lines.

examples/five_card_hands.c contains the following:


#include "poker_defs.h"
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(
__BCPLUSPLUS__) || defined( __MWERKS__)
#include "getopt_w32.h"
#else
#include <getopt.h>
#endif
#include "inlines/eval.h"



I backed up the original, and deleted the possibly offending lines so it looks like this:


#include "poker_defs.h"
#include <getopt.h>
#include "inlines/eval.h"


I'm now trying to rebuild, will tell you how it goes.

stigmata
11-23-2005, 01:02 PM
It just built without errors!

make check.... Passed all tests!

$ ./pokenum.exe Ah Kh - Ac Ad
Holdem Hi: 1712304 enumerated boards
cards win %win lose %lose tie %tie EV
Ah Kh 197131 11.51 1493670 87.23 21503 1.26 0.121
Ac Ad 1493670 87.23 197131 11.51 21503 1.26 0.879


Yipeee!!!!
/images/graemlins/grin.gif /images/graemlins/grin.gif /images/graemlins/grin.gif
Thanks

CORed
11-23-2005, 01:11 PM
Actually, it looks like that #if defined statement is incorrect. It appears that it's including getopt_w32.h for all windows compilers, and it probably should only do it for microsoft and (maybe) borland.