Compling Stockfish on Windows 10-64bit using cygwin

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

Moderators: hgm, Rebel, chrisw

JohnS
Posts: 215
Joined: Sun Feb 24, 2008 2:08 am

Compling Stockfish on Windows 10-64bit using cygwin

Post by JohnS »

Does anyone know how to compile Stockfish on Windows 10-64bit using Cygwin? Are there instructions anywhere?

Thanks.
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Compling Stockfish on Windows 10-64bit using cygwin

Post by Dann Corbit »

I guess it is just like MSYS2, another Posix layer for Windows.
Just go to the source folder and type:
make
and you will get instructions on what to do.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
JohnS
Posts: 215
Joined: Sun Feb 24, 2008 2:08 am

Re: Compiling Stockfish on Windows 10-64bit using cygwin

Post by JohnS »

Dann Corbit wrote: Tue Jan 01, 2019 4:29 am I guess it is just like MSYS2, another Posix layer for Windows.
Just go to the source folder and type:
make
and you will get instructions on what to do.
Hi Dann

I tried

make profile-build ARCH=x86-64-modern COMP=mingw

but got errors:

In file included from thread.h:35:0,
from evaluate.cpp:31:
thread_win32.h:61:14: error: 'condition_variable_any' in namespace 'std' does not name a type
typedef std::condition_variable_any ConditionVariable;
^
In file included from evaluate.cpp:31:0:
thread.h:46:3: error: 'ConditionVariable' does not name a type
ConditionVariable cv;
^
thread.h:49:8: error: 'thread' in namespace 'std' does not name a type
std::thread stdThread;
^
make[2]: *** [<builtin>: evaluate.o] Error 1

Do you know what the problem is?

Thanks.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Compling Stockfish on Windows 10-64bit using cygwin

Post by Sven »

Did you try it with "COMP=gcc" (which is the default and can also be omitted)?
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)
JohnS
Posts: 215
Joined: Sun Feb 24, 2008 2:08 am

Re: Compling Stockfish on Windows 10-64bit using cygwin

Post by JohnS »

Sven wrote: Tue Jan 01, 2019 1:58 pm Did you try it with "COMP=gcc" (which is the default and can also be omitted)?
Hi Sven

It still gives the same errors with gcc.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Compling Stockfish on Windows 10-64bit using cygwin

Post by Sven »

JohnS wrote: Wed Jan 02, 2019 1:42 am
Sven wrote: Tue Jan 01, 2019 1:58 pm Did you try it with "COMP=gcc" (which is the default and can also be omitted)?
Hi Sven

It still gives the same errors with gcc.
Which Stockfish version are you trying to compile? I had no problems to compile under CygWin with a recent dev version from 26-dec-2018.

EDIT: for some reason the _WIN32 macro is defined for you in your setup, that should not be the case when using CygWin.
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Compling Stockfish on Windows 10-64bit using cygwin

Post by Dann Corbit »

It looks like he is using an old version of gcc.

See this:
thread.h:49:8: error: 'thread' in namespace 'std' does not name a type
std::thread stdThread;

That's an old compiler.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
JohnS
Posts: 215
Joined: Sun Feb 24, 2008 2:08 am

Re: Compling Stockfish on Windows 10-64bit using cygwin

Post by JohnS »

Dann Corbit wrote: Wed Jan 02, 2019 11:07 pm It looks like he is using an old version of gcc.

See this:
thread.h:49:8: error: 'thread' in namespace 'std' does not name a type
std::thread stdThread;

That's an old compiler.
Thanks Dann and Sven. I had not set the path to Cygwin and that was causing the problem. It compiles now but I can't run it outside Cygwin without it needing to find cygwin1.dll. Is there a switch to make a standalone binary that can be used without the dll, like the abrok ones?

Thanks.
tpoppins
Posts: 919
Joined: Tue Nov 24, 2015 9:11 pm
Location: upstate

Re: Compling Stockfish on Windows 10-64bit using cygwin

Post by tpoppins »

This question is answered in the Cygwin FAQ.

That's not the whole story, though. There in fact used to be such a compiler flag ( -mno-cygwin) but it was removed a few years ago. Just another reason the recommended way to build SF on Windoze is with MSYS2 and MinGW and that explicitly allows for static builds, with no additional DLLs required. I never had any problems building SF with this combo, although it's been a while since I did my own SF builds; and earlier I had no issues using MinGW on its own, which is about just as easy and painless.
Tirsa Poppins
CCRL
JohnS
Posts: 215
Joined: Sun Feb 24, 2008 2:08 am

Re: Compling Stockfish on Windows 10-64bit using cygwin

Post by JohnS »

Thanks for the link Tirsa. It works well.

Off topic for Unix gurus (not me :(): How does the line

unzip -v &> /dev/null || pacman -S --noconfirm unzip

work in checking if unzip is installed and installing it if it is not?