official-stockfish / Stockfish

A free and strong UCI chess engine
https://stockfishchess.org/
GNU General Public License v3.0
11.33k stars 2.25k forks source link

Is there workaround to build it successfully on Cygwin? #1969

Closed abdulbadii closed 5 years ago

abdulbadii commented 5 years ago

Is there workaround way to build native Windows SF binary successfully on Cygwin with mingw-x86_64 packages completely installed?

$ make profile-build ARCH=x86-64-modern COMP=gcc extra=yes lto=yes
Config:
debug: 'no'
sanitize: 'no'
optimize: 'yes'
arch: 'x86_64'
bits: '64'
kernel: 'CYGWIN_NT-10.0'
os: 'Windows_NT'
prefetch: 'yes'
popcnt: 'yes'
sse: 'yes'
pext: 'no'

Flags:
CXX: g++
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -std=c++11  -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -flto
...
...
...
g++ -o stockfish benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o search.o thread.o timeman.o tt.o uci.o ucioption.o syzygy/tbprobe.o -lgcov -m64 -Wl,--no-as-needed -lpthread -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-use -fno-peel-loops -fno-tracer -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -flto
make[2]: Leaving directory '/usr/src/Stockfish-master/src'
make[1]: Leaving directory '/usr/src/Stockfish-master/src'

Step 4/4. Deleting profile data ...
make ARCH=x86-64-modern COMP=gcc profileclean
make[1]: Entering directory '/usr/src/Stockfish-master/src'
make[1]: Leaving directory '/usr/src/Stockfish-master/src'

$
$ objdump stockfish.exe |grep -i '^\s*dll'
DllCharacteristics      00008000
        DLL Name: cygwin1.dll
        DLL Name: cygstdc++-6.dll
        DLL Name: KERNEL32.dll

Resulted in an executable engine file with cygwin1.dll linking, even though mingw64-x86_64xxxxx installations are all set.. Any idea?

CoffeeOne commented 5 years ago

This is the stockfish repository and you are trying to compile cfish. Please close this issue.

abdulbadii commented 5 years ago

The same issue and result after updating correct source above

$ objdump stockfish.exe |grep -i '^\s*dll'
DllCharacteristics      00008000
        DLL Name: cygwin1.dll
        DLL Name: cygstdc++-6.dll
        DLL Name: KERNEL32.dll
CoffeeOne commented 5 years ago

I recommend to use MSYS2 instead of Cygwin, you can follow the guide below. https://github.com/glinscott/fishtest/wiki/Building-stockfish-on-Windows

d3vv commented 5 years ago

Cygwin always used own dll's... You should to use MINGW from MSYS2 or MINGW32/64-gcc with COMP=mingw (static build).