Compiling cutechess-cli in Window XP

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Modern Times
Posts: 3546
Joined: Thu Jun 07, 2012 11:02 pm

Re: Compiling cutechess-cli in Window XP

Post by Modern Times »

Is there not an exe that you can download ?
User avatar
Jim Ablett
Posts: 1383
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Compiling cutechess-cli in Window XP

Post by Jim Ablett »

Adam Hair wrote:According to the tutorial, I needed to add two environment variables, so I did as it directed, then I rebooted. In 'sysport.h', I replaced all 5 instances of 'MINGW' with '_MINGW32_'. I ran 'mingw32-make clean', then ran 'mingw32-make'. Then, I pulled my hair out :lol: because 'sys/resource.h' was not found.

I am using Qt 4.8.4 and MinGW 4.40. Since I am confident that Qt is installed properly, I am going to redownload with MinGW and try again.
You old compiler doesn't recognize the __MINGW32__ macro.

Add >

#define __MINGW32__

to the top of 'sysport.h'

Jim.
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Compiling cutechess-cli in Window XP

Post by ilari »

Adam Hair wrote:According to the tutorial, I needed to add two environment variables, so I did as it directed, then I rebooted. In 'sysport.h', I replaced all 5 instances of 'MINGW' with '_MINGW32_'. I ran 'mingw32-make clean', then ran 'mingw32-make'. Then, I pulled my hair out :lol: because 'sys/resource.h' was not found.

I am using Qt 4.8.4 and MinGW 4.40. Since I am confident that Qt is installed properly, I am going to redownload with MinGW and try again.
'sys/resource.h' is not part of MinGW, it's a Linux header. The problem is exactly what Jim suggested - the MinGW flag is not detected. Did you use _MINGW32_ (incorrect) instead of __MINGW32__ (correct)?
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: Compiling cutechess-cli in Window XP

Post by Adam Hair »

ilari wrote:
Adam Hair wrote:According to the tutorial, I needed to add two environment variables, so I did as it directed, then I rebooted. In 'sysport.h', I replaced all 5 instances of 'MINGW' with '_MINGW32_'. I ran 'mingw32-make clean', then ran 'mingw32-make'. Then, I pulled my hair out :lol: because 'sys/resource.h' was not found.

I am using Qt 4.8.4 and MinGW 4.40. Since I am confident that Qt is installed properly, I am going to redownload with MinGW and try again.
'sys/resource.h' is not part of MinGW, it's a Linux header. The problem is exactly what Jim suggested - the MinGW flag is not detected. Did you use _MINGW32_ (incorrect) instead of __MINGW32__ (correct)?
You are right, Ilari. I was using single underscores instead of double underscores. I will try again.
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: Compiling cutechess-cli in Window XP

Post by Adam Hair »

I am beginning to think that I am not meant to compile cutechess.

After changing 'MINGW' to '__MINGW32__', the compilation process does proceed beyond the former stopping point. However, when the process reaches the gui sources, there are a large number of lines about undefined references. Here is a small sample:

Code: Select all

C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:43: undefined reference to `_imp___ZN5Chess15BoardTransitionC1Ev'
C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:43: undefined reference to `_imp___ZN5Chess11GenericMoveC1Ev'
C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:43: undefined reference to `_imp___ZN5Chess15BoardTransitionC1Ev'
C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:43: undefined reference to `_imp___ZN5Chess11GenericMoveC1Ev'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:60: undefined reference to `_imp___ZN5Chess15BoardTransition5clearEv'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:76: undefined reference to `_imp___ZN5Chess15BoardTransition5clearEv'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:98: undefined reference to `_imp___ZNK5Chess5Board12reserveCountENS_5PieceE'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:110: undefined reference to `_imp___ZN5Chess6SquareC1Eii'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:111: undefined reference to `_imp___ZNK5Chess5Board7pieceAtERKNS_6SquareE'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:125: undefined reference to `_imp___ZN5Chess5Board12setFenStringERK7QString'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:138: undefined reference to `_imp___ZN5Chess5Board11isLegalMoveERKNS_4MoveE'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:140: undefined reference to `_imp___ZN5Chess15BoardTransitionC1Ev'
The same sort of thing happens when I try to compile cutechess-cli.
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: Compiling cutechess-cli in Window XP

Post by Adam Hair »

Modern Times wrote:Is there not an exe that you can download ?
Yes. In fact, I have downloaded it. However, there is a value used by cutechess-cli that I need to change (drawelo). There is a new function (SPRT) in cutechess-cli that I want to use when doing tests with Gaviota, but I need to be able to change the drawelo value to reflect the draw rate that occurs when self-testing Gaviota.

I prefer learning how to compile cutechess-cli myself so that I do not have to bother anybody else to do it. Unfortunately, I am not having an easy go at it :lol:
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Compiling cutechess-cli in Window XP

Post by ilari »

Adam Hair wrote:I am beginning to think that I am not meant to compile cutechess.

After changing 'MINGW' to '__MINGW32__', the compilation process does proceed beyond the former stopping point. However, when the process reaches the gui sources, there are a large number of lines about undefined references. Here is a small sample:

Code: Select all

C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:43: undefined reference to `_imp___ZN5Chess15BoardTransitionC1Ev'
C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:43: undefined reference to `_imp___ZN5Chess11GenericMoveC1Ev'
C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:43: undefined reference to `_imp___ZN5Chess15BoardTransitionC1Ev'
C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:43: undefined reference to `_imp___ZN5Chess11GenericMoveC1Ev'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:60: undefined reference to `_imp___ZN5Chess15BoardTransition5clearEv'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:76: undefined reference to `_imp___ZN5Chess15BoardTransition5clearEv'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:98: undefined reference to `_imp___ZNK5Chess5Board12reserveCountENS_5PieceE'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:110: undefined reference to `_imp___ZN5Chess6SquareC1Eii'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:111: undefined reference to `_imp___ZNK5Chess5Board7pieceAtERKNS_6SquareE'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:125: undefined reference to `_imp___ZN5Chess5Board12setFenStringERK7QString'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:138: undefined reference to `_imp___ZN5Chess5Board11isLegalMoveERKNS_4MoveE'
./.obj\boardscene.o:C:\cutechess-master\projects\gui/src/boardview/boardscene.cpp:140: undefined reference to `_imp___ZN5Chess15BoardTransitionC1Ev'
The same sort of thing happens when I try to compile cutechess-cli.
The compiler is not linking to the cutechess library properly. Are you trying to create a static build (with the "-config static" parameter)? What happens if you try a clean compile, ie. run "mingw32-make distclean && qmake && mingw32-make"?
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: Compiling cutechess-cli in Window XP

Post by Adam Hair »

ilari wrote: The compiler is not linking to the cutechess library properly. Are you trying to create a static build (with the "-config static" parameter)? What happens if you try a clean compile, ie. run "mingw32-make distclean && qmake && mingw32-make"?
Each attempt was a clean compile. I had been doing it the hard way by deleting the 'cutechess-master' folder and replacing it with a newly unzipped folder.

I have finally compiled it. First, I realized that cutechess.dll needed to be placed in the Qt bin folder. Then, I attempted a static build and was successful.

Thank you Ilari and Jim for your help.
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Compiling cutechess-cli in Window XP

Post by ilari »

Adam Hair wrote:
ilari wrote: The compiler is not linking to the cutechess library properly. Are you trying to create a static build (with the "-config static" parameter)? What happens if you try a clean compile, ie. run "mingw32-make distclean && qmake && mingw32-make"?
Each attempt was a clean compile. I had been doing it the hard way by deleting the 'cutechess-master' folder and replacing it with a newly unzipped folder.

I have finally compiled it. First, I realized that cutechess.dll needed to be placed in the Qt bin folder. Then, I attempted a static build and was successful.

Thank you Ilari and Jim for your help.
Good to hear. I would add that cutechess.dll doesn't need to be in the Qt bin folder, it can also be placed in the same folder with cutechess-cli.exe.
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: Compiling cutechess-cli in Window XP

Post by Adam Hair »

ilari wrote: Good to hear. I would add that cutechess.dll doesn't need to be in the Qt bin folder, it can also be placed in the same folder with cutechess-cli.exe.
That is true when cutechess-cli.exe exists. But it is not clear where it should reside when the sources are being compiled. The compiler was not linking to the library on my first attempts because I did not place the .dll file in the correct location.