Compiling cutechess-cli in Window XP

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Modern Times
Posts: 2421
Joined: Thu Jun 07, 2012 9:02 pm

Re: Compiling cutechess-cli in Window XP

Post by Modern Times » Sun Apr 14, 2013 1:27 pm

Is there not an exe that you can download ?

User avatar
Jim Ablett
Posts: 1327
Joined: Fri Jul 14, 2006 5:56 am
Location: London, England
Contact:

Re: Compiling cutechess-cli in Window XP

Post by Jim Ablett » Sun Apr 14, 2013 1:35 pm

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 5:45 pm
Location: Finland
Contact:

Re: Compiling cutechess-cli in Window XP

Post by ilari » Sun Apr 14, 2013 1:38 pm

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: 3201
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: Compiling cutechess-cli in Window XP

Post by Adam Hair » Sun Apr 14, 2013 1:41 pm

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: 3201
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: Compiling cutechess-cli in Window XP

Post by Adam Hair » Sun Apr 14, 2013 1:57 pm

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: 3201
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: Compiling cutechess-cli in Window XP

Post by Adam Hair » Sun Apr 14, 2013 2:08 pm

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 5:45 pm
Location: Finland
Contact:

Re: Compiling cutechess-cli in Window XP

Post by ilari » Sun Apr 14, 2013 2:14 pm

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: 3201
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: Compiling cutechess-cli in Window XP

Post by Adam Hair » Sun Apr 14, 2013 3:23 pm

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 5:45 pm
Location: Finland
Contact:

Re: Compiling cutechess-cli in Window XP

Post by ilari » Sun Apr 14, 2013 3:45 pm

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: 3201
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: Compiling cutechess-cli in Window XP

Post by Adam Hair » Sun Apr 14, 2013 4:24 pm

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.

Post Reply