Recompiling Colchess

Archive of the old Parsimony forum. Some messages couldn't be restored. Limitations: Search for authors does not work, Parsimony specific formats do not work, threaded view does not work properly. Posting is disabled.

Recompiling Colchess

Postby Volker Pittlik » 24 May 2000, 17:42

Geschrieben von: / Posted by: Volker Pittlik at 24 May 2000 18:42:27:
The only way I can get Colchess running is recompiling it (as Colin recommends in the readme). I'm using gcc included in cygwin and the VIDE-GUI. The executable I got is pretty small (122 instead of 361 KB). I'm not experienced with this compiler so I'm in doubt if the Colchess is running on maximum speed.
Anyway eventually it's playing chess for me :-):
[Event "Computer chess game"]
[Site "SCHACH"]
[Date "2000.05.24"]
[Round "-"]
[White "Colchess_623"]
[Black "Fortress162"]
[Result "1/2-1/2"]
[TimeControl "300"]
1. e4 d6 2. Nf3 Nf6 3. Nc3 e5 4. d4 Bd7 5. dxe5 dxe5 6. Nxe5 Bd6 7. Nc4 Bb4
8. e5 Bxc3+ 9. bxc3 Ne4 10. Qd4 f5 11. exf6 Nxf6 12. Ba3 Be6 13. O-O-O Qxd4
14. cxd4 Nc6 15. Re1 Kf7 16. Ne5+ Nxe5 17. dxe5 Nd7 18. c4 Rad8 19. Re3 Nb6
20. Rf3+ Kg8 21. Rf4 Na4 22. Kc2 c5 23. Be2 Rd4 24. Rxd4 cxd4 25. Kd3 Kf7
26. Kxd4 Rc8 27. f4 Nb6 28. Rc1 Rd8+ 29. Bd6 Nc8 30. c5 Bxa2 31. Bd3 b6 32.
Ke3 Bd5 33. Bxh7 Bxg2 34. cxb6 Nxd6 35. exd6 axb6 36. Rc7+ Kf6 37. Rc2 Bb7
38. Rc7 Bd5 39. d7 g6 40. h4 Kg7 41. Kd4 Be6 42. Ke5 Rxd7 43. Rc6 Bf5 44.
Bxg6 Bxg6 45. f5 Bf7 46. Rxb6 Rd5+ 47. Kf4 Rd1 48. Rc6 Rf1+ 49. Kg5 Rg1+
50. Kf4 Bh5 51. Rc7+ Kf6 52. Rc6+ Ke7 53. Re6+ Kd7 54. Re4 Kd6 55. Rd4+ Kc5
56. Ke5 Re1+ 57. Re4 Rh1 58. f6 Bf7 59. Rd4 Bc4 60. Rf4 Re1+ 61. Re4 Rd1
62. Rxc4+ Kxc4 63. f7 Rf1 64. Ke6 Re1+ 65. Kf6 Rf1+ 66. Ke7 Re1+ 67. Kf6
Rf1+ 68. Ke7 Re1+ 69. Kd7 Rf1 70. Ke6 Kd4 71. h5 Re1+ 72. Kf6 Rf1+ 73. Kg7
Rg1+ 74. Kf8 Kd5 75. h6 Ke6 76. h7 Rb1 77. Kg8 Rg1+ 78. Kf8 Rc1 79. Kg8
Rg1+ 80. Kf8
{Draw by repetition} 1/2-1/2
This is my makefile generated by VIDE. Any suggestions for optimizations for speed?
#=======================================================================
#@V@:Note: File automatically generated by VIDE: (18:16:54 24 May 2000) (gcc).
# This file regenerated each time you run VIDE, so save under a
# new name if you hand edit, or it will be overwritten.
#=======================================================================
# Standard defines:
CC = gcc
WRES = windres
HOMEV = f:\cygnus\cygwin-b20\H-i586-cygwin32\bin
VPATH = $(HOMEV)/include
oDir = .
Bin = .
Src = .
libDirs =
incDirs =
LIBS = -s
C_FLAGS = -O
SRCS =\
$(Src)/chess.c\
$(Src)/comp.c\
$(Src)/tactics.c\
$(Src)/moves.c\
$(Src)/checks.c\
$(Src)/misc.c\
$(Src)/mprocs.c\
$(Src)/eval.c
EXOBJS =\
$(oDir)/chess.o\
$(oDir)/comp.o\
$(oDir)/tactics.o\
$(oDir)/moves.o\
$(oDir)/checks.o\
$(oDir)/misc.o\
$(oDir)/mprocs.o\
$(oDir)/eval.o
ALLOBJS = $(EXOBJS)
ALLBIN = $(Bin)/Colchess_623
ALLTGT = $(Bin)/Colchess_623
# User defines:
#@# Targets follow ---------------------------------
all: $(ALLTGT)
objs: $(ALLOBJS)
cleanobjs:
rm -f $(ALLOBJS)
cleanbin:
rm -f $(ALLBIN)
clean: cleanobjs cleanbin
cleanall: cleanobjs cleanbin
#@# User Targets follow ---------------------------------

#@# Dependency rules follow -----------------------------
$(Bin)/Colchess_623: $(EXOBJS)
$(CC) -o $(Bin)/Colchess_623 $(EXOBJS) $(incDirs) $(libDirs) $(LIBS)
$(oDir)/chess.o: chess.c chess.h misc.h checks.h comp.h moves.h mprocs.h \
eval.h
$(CC) $(C_FLAGS) $(incDirs) -c -o $@ $
Volker Pittlik
 

Re: Recompiling Colchess

Postby Dann Corbit » 24 May 2000, 19:29

Geschrieben von: / Posted by: Dann Corbit at 24 May 2000 20:29:09:
Als Antwort auf: / As an answer to: Recompiling Colchess geschrieben von: / posted by: Volker Pittlik at 24 May 2000 18:42:27:
I get a bazillion errors when I compile ColChess with GCC because of the C++ style comments that Colin uses. Did you change each line of source, or how did you fix it?


My FTP site
Dann Corbit
 

Re: Recompiling Colchess

Postby Volker Pittlik » 24 May 2000, 21:22

Geschrieben von: / Posted by: Volker Pittlik at 24 May 2000 22:22:48:
Als Antwort auf: / As an answer to: Re: Recompiling Colchess geschrieben von: / posted by: Dann Corbit at 24 May 2000 20:29:09:
I get a bazillion errors when I compile ColChess with GCC because of the C++ style comments that Colin uses. Did you change each line of source, or how did you fix it?
I changed nearly nothing except (in chess.c):
#ifdef _WIN32 /* WINDOWS MODE **** */
char path[FILENAME_MAX] = "c:\\games\\colchess"; /*
Volker Pittlik
 

Re: Recompiling Colchess

Postby Colin Frayn » 25 May 2000, 09:54

Geschrieben von: / Posted by: Colin Frayn at 25 May 2000 10:54:34:
Als Antwort auf: / As an answer to: Re: Recompiling Colchess geschrieben von: / posted by: Volker Pittlik at 24 May 2000 22:22:48:
I get a bazillion errors when I compile ColChess with GCC because of the C++ style comments that Colin uses. Did you change each line of source, or how did you fix it?
I thought I changed all of those? Well I just cheked and there were 3 or 4 left so I've altered them to c-style comments.
I'm not sure why my version doesn't work. To get optimum performance, you should compile colchess.c, which is the source code file. It includes all the separate .c files, and then compiles them all together so that the compiler can do more optimisations.
When I compile I use the following syntax;
gcc -o colchess -O3 colchess.c
If it is something to do with the optimisations that is making ColChess fail to work then that woud be interesting.
I use gcc too, so if you find anything then I would be intrigued to know what it is. Dann also says that his executable size is much smaller than the one I get. Perhaps I have a faulty release of gcc?
Thanks for trying.
Cheers,
Colin

ColChess Homepage
Colin Frayn
 

Re: Recompiling ColChess

Postby Volker Pittlik » 25 May 2000, 23:03

Geschrieben von: / Posted by: Volker Pittlik at 26 May 2000 00:03:46:
Als Antwort auf: / As an answer to: Re: Recompiling Colchess geschrieben von: / posted by: Colin Frayn at 25 May 2000 10:54:34:
[...]
I'm not sure why my version doesn't work. To get optimum performance, you should compile colchess.c, which is the source code file. It includes all the separate .c files, and then compiles them all together so that the compiler can do more optimisations.
When I compile I use the following syntax;
gcc -o colchess -O3 colchess.c
If it is something to do with the optimisations that is making ColChess fail to work then that woud be interesting.
I use gcc too, so if you find anything then I would be intrigued to know what it is. Dann also says that his executable size is much smaller than the one I get. Perhaps I have a faulty release of gcc?
Thanks for trying.
Cheers,
Colin
Done. The executable I got now is slightly bigger (132K) than before. It works without problems.
I'm using -O3 now also. I don't think the optimisation is the reason for the problem. Maybe (I only guess) a TARGET_SWITCH has to be set to run your program? I tried -mpentiumpro ("Synonyms for -mcpu=i386, -mcpu=i486, -mcpu=pentium, and -mcpu=pentiumpro respectively", taken from VIDE help files) it works fine. By default "GNU CC compiles code for the same type of machine that you are using" (taken from VIDE help files).
Hm, my gcc.exe is dated December 1, 1998, 65.5 KB.
--
Now a little bit off-topic: I visited the non-chess parts of your website today. Great stuff for me. I like music very much although I'm absolutely unable to play an instrument. Unfortunately it's to cloudy to use my telescope today and if you would like the website of my badminton club visit BC Eintracht Südring (three times German champion, winner of European Cup 1999, unfortunately in German only).
--
Best wishes
Volker
Volker Pittlik
 

Re: Recompiling ColChess (runtime error)

Postby Volker Pittlik » 26 May 2000, 00:15

Geschrieben von: / Posted by: Volker Pittlik at 26 May 2000 01:15:24:
Als Antwort auf: / As an answer to: Re: Recompiling ColChess geschrieben von: / posted by: Volker Pittlik at 26 May 2000 00:03:46:
I also get a runtime error (core dump) when running ColChess in a dos box and typing "d" (shortcut for "danger"):
[main] ColChess_623 1003 (0) exception: trapped!
[main] ColChess_623 1003 (0) exception: code 0xC0000005 at 0x4144F6
[main] ColChess_623 1003 (0) exception: ax 0xAD452C88 bx 0xA031670 cx 0xA0317F8 dx 0x6B514B20
[main] ColChess_623 1003 (0) exception: si 0xA0317F8 di 0x0 bp 0x27CF96C sp 0x27CF940
[main] ColChess_623 1003 (0) exception: exception is: STATUS_ACCESS_VIOLATION
[main] ColChess_623 1003 (0) stack: Stack trace:
[main] ColChess_623 1003 (0) stack: frame 0: sp = 0x27CF754, pc = 0x6100A2C3
[main] ColChess_623 1003 (0) stack: frame 1: sp = 0x27CF790, pc = 0x77FA6666
[main] ColChess_623 1003 (0) stack: frame 2: sp = 0x27CF7B4, pc = 0x77F9912B
[main] ColChess_623 1003 (0) stack: frame 3: sp = 0x27CF840, pc = 0x77F863BA
[main] ColChess_623 1003 (0) stack: frame 4: sp = 0x27CF96C, pc = 0x418E34
[main] ColChess_623 1003 (0) stack: frame 5: sp = 0x27CF9DC, pc = 0x403A5A
[main] ColChess_623 1003 (0) stack: frame 6: sp = 0x27CFE10, pc = 0x61004402
[main] ColChess_623 1003 (0) stack: frame 7: sp = 0x27CFF88, pc = 0x61004420
[main] ColChess_623 1003 (0) stack: frame 8: sp = 0x27CFF94, pc = 0x420AAE
[main] ColChess_623 1003 (0) stack: frame 9: sp = 0x27CFFA4, pc = 0x40103A
[main] ColChess_623 1003 (0) stack: frame 10: sp = 0x27CFFC0, pc = 0x77F1BA06
[main] ColChess_623 1003 (0) stack: frame 11: sp = 0x27CFFF0, pc = 0x0
[main] ColChess_623 1003 (0) stack: End of stack trace

Volker
Volker Pittlik
 

Re: Recompiling ColChess (runtime error)

Postby Colin Frayn » 26 May 2000, 10:22

Geschrieben von: / Posted by: Colin Frayn at 26 May 2000 11:22:05:
Als Antwort auf: / As an answer to: Re: Recompiling ColChess (runtime error) geschrieben von: / posted by: Volker Pittlik at 26 May 2000 01:15:24:
I also get a runtime error (core dump) when running ColChess in a dos box and typing "d" (shortcut for "danger"):
I used to have problems with that but I thought I'd fixed it. It works fine for me with the Linux executable. I'll have to run a malloc checker over it some time.
Cheers,
Col


ColChess Homepage
Colin Frayn
 

Re: Recompiling ColChess

Postby Colin Frayn » 26 May 2000, 10:24

Geschrieben von: / Posted by: Colin Frayn at 26 May 2000 11:24:38:
Als Antwort auf: / As an answer to: Re: Recompiling ColChess geschrieben von: / posted by: Volker Pittlik at 26 May 2000 00:03:46:
I'm not sure why my version doesn't work. To get optimum performance, you should compile colchess.c, which is the source code file. It includes all the separate .c files, and then compiles them all together so that the compiler can do more optimisations.
Done. The executable I got now is slightly bigger (132K) than before. It works without problems.
I'm using -O3 now also. I don't think the optimisation is the reason for the problem. Maybe (I only guess) a TARGET_SWITCH has to be set to run your program? I tried -mpentiumpro ("Synonyms for -mcpu=i386, -mcpu=i486, -mcpu=pentium, and -mcpu=pentiumpro respectively", taken from VIDE help files) it works fine. By default "GNU CC compiles code for the same type of machine that you are using" (taken from VIDE help files).
Now a little bit off-topic: I visited the non-chess parts of your website today. Great stuff for me.
OK excellent news.
Hmmm... that might be something to do with it. I'm currently fiddling around with getting compiling to windows exe whilst still in Linux so hopefully I'll be able to update the Win EXE more often. I'll see what I can find out.
Hehe ;) Off topic as you say, but I'll have a look at that link. Perhas you
should email me?
Cheers,
Col


ColChess Homepage
Colin Frayn
 


Return to Archive (Old Parsimony Forum)

Who is online

Users browsing this forum: No registered users and 29 guests