Stockfish PA GTB
https://github.com/jeremybernstein/Stockfish_PA_GTB
If someone can compile this version I would be grateful
I can not compile with MinGW GCC 540 and Visual Studio 2015 Enterprise
http://www44.zippyshare.com/v/nBtTkShp/file.html
Regards
Marco Zerbinati
Stockfish PA GTB Problem
Moderator: Ras
-
- Posts: 122
- Joined: Mon Aug 18, 2014 7:12 pm
- Location: Trento (Italy)
-
- Posts: 134
- Joined: Thu Jul 24, 2014 2:49 pm
Re: Stockfish PA GTB Problem
Hi
I made it compile with mingw710 and hope my solution works for you, too. First save the following diff into a file and apply it to your git repository https://stackoverflow.com/questions/123 ... s-a-copy-o
Then navigate into the egtb directory and execute make -f makefile.mingw
Now you can run make profile-build ARCH=x86-64-modern from the src directory
I made it compile with mingw710 and hope my solution works for you, too. First save the following diff into a file and apply it to your git repository https://stackoverflow.com/questions/123 ... s-a-copy-o
Then navigate into the egtb directory and execute make -f makefile.mingw
Now you can run make profile-build ARCH=x86-64-modern from the src directory
Code: Select all
diff --git a/src/Makefile b/src/Makefile
index fb254b8..3e9370c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -312,7 +312,7 @@ endif
### 3.10 popcnt
ifeq ($(popcnt),yes)
- CXXFLAGS += -DUSE_POPCNT
+ CXXFLAGS += -msse3 -DUSE_POPCNT
endif
### 3.11 egtb
diff --git a/src/bitcount.h b/src/bitcount.h
index 199fcf1..d877720 100644
--- a/src/bitcount.h
+++ b/src/bitcount.h
@@ -89,9 +89,7 @@ inline int count_1s<CNT_POPCNT>(Bitboard b) {
#elif defined(_MSC_VER)
return (int)__popcnt64(b);
#elif defined(__GNUC__)
- unsigned long ret;
- __asm__("popcnt %1, %0" : "=r" (ret) : "r" (b));
- return ret;
+ return int(__builtin_popcount(b));
#endif
}
diff --git a/src/egtb/compression/liblzf/lzf_c.c b/src/egtb/compression/liblzf/lzf_c.c
index cc22fe4..36a708e 100644
--- a/src/egtb/compression/liblzf/lzf_c.c
+++ b/src/egtb/compression/liblzf/lzf_c.c
@@ -124,8 +124,8 @@ lzf_compress (const void *const in_data, unsigned int in_len,
* special workaround for it.
*/
#if defined (WIN32) && defined (_M_X64)
- unsigned _int64 off; /* workaround for missing POSIX compliance */
-#else
+// unsigned _int64 off; /* workaround for missing POSIX compliance */
+//#else
unsigned long off;
#endif
unsigned int hval;
diff --git a/src/egtb/makefile.mingw b/src/egtb/makefile.mingw
index 80e4432..153c3e9 100644
--- a/src/egtb/makefile.mingw
+++ b/src/egtb/makefile.mingw
@@ -7,11 +7,11 @@ INCLUDE = -Isysport/ \
-Icompression/huffman/
MAKE = make -f makefile.mingw
-AR = i386-mingw32-ar
-RANLIB = i386-mingw32-ranlib
-DEFAULT_CC = i386-mingw32-gcc
+AR = ar
+RANLIB = ranlib
+DEFAULT_CC = gcc
DEFAULT_DEFINE = -DZ_PREFIX
-DEFAULT_ARCHFLAGS = -m32
+DEFAULT_ARCHFLAGS = -m64
DEFAULT_CFLAGS = -Wall -Wextra $(INCLUDE) $(DEFAULT_DEFINE) \
$(DEFAULT_ARCHFLAGS) -DMINGW
OPTFLAGS = -O3 -msse -DNDEBUG
diff --git a/src/misc.h b/src/misc.h
index f3f9576..26dc0d9 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -21,6 +21,9 @@
#define MISC_H_INCLUDED
#include <string>
+#ifdef _WIN32
+#include "windows.h"
+#endif
#include "types.h"
extern const std::string engine_name();
-
- Posts: 122
- Joined: Mon Aug 18, 2014 7:12 pm
- Location: Trento (Italy)
Re: Stockfish PA GTB Problem
Hi Hermannpferd wrote:Hi
I made it compile with mingw710 and hope my solution works for you, too. First save the following diff into a file and apply it to your git repository https://stackoverflow.com/questions/123 ... s-a-copy-o
Then navigate into the egtb directory and execute make -f makefile.mingw
Now you can run make profile-build ARCH=x86-64-modern from the src directory
Thank you for your reply!
Code: Select all
-Amos/Documents/GitHub/start/
src'
Config:
debug: 'no'
optimize: 'yes'
arch: 'x86_64'
os: 'any'
bits: '64'
prefetch: 'yes'
bsfq: 'yes'
popcnt: 'yes'
sse: 'yes'
pext: 'no'
Flags:
CXX: g++
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -fno-rtti -DPA_GTB=1 -DUSE_EGTB -is
ystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow -DNDEBUG -O3
-DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto
LDFLAGS: -Legtb -lgtb -Lqdbm -lqdbm -Lkyotocabinet -lkyotocabinet -lpthread -W
all -Wcast-qual -fno-exceptions -fno-rtti -DPA_GTB=1 -DUSE_EGTB -isystem kyotoc
abinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT
-msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto
Testing config sanity. If this fails, try 'make help' ...
mingw32-make[1]: Leaving directory 'C:/Users/Marco-Amos/Documents/GitHub/start/s
rc'
Step 0/4. Preparing for profile build.
C:/MinGW/mingw64/bin/mingw32-make ARCH=x86-64-modern COMP=gcc gcc-profile-prepar
e
mingw32-make[1]: Entering directory 'C:/Users/Marco-Amos/Documents/GitHub/start/
src'
C:/MinGW/mingw64/bin/mingw32-make ARCH=x86-64-modern COMP=gcc gcc-profile-clean
mingw32-make[2]: Entering directory 'C:/Users/Marco-Amos/Documents/GitHub/start/
src'
mingw32-make[2]: Leaving directory 'C:/Users/Marco-Amos/Documents/GitHub/start/s
rc'
mingw32-make[1]: Leaving directory 'C:/Users/Marco-Amos/Documents/GitHub/start/s
rc'
Step 1/4. Building executable for benchmark ...
C:/MinGW/mingw64/bin/mingw32-make ARCH=x86-64-modern COMP=gcc gcc-profile-make
mingw32-make[1]: Entering directory 'C:/Users/Marco-Amos/Documents/GitHub/start/
src'
C:/MinGW/mingw64/bin/mingw32-make ARCH=x86-64-modern COMP=gcc \
EXTRACXXFLAGS='-fprofile-generate' \
EXTRALDFLAGS='-lgcov' \
all
mingw32-make[2]: Entering directory 'C:/Users/Marco-Amos/Documents/GitHub/start/
src'
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o bench
mark.o benchmark.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o bitba
se.o bitbase.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o bitbo
ard.o bitboard.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o bitco
unt.o bitcount.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o book.
o book.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o endga
me.o endgame.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o evalu
ate.o evaluate.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o main.
o main.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o mater
ial.o material.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o misc.
o misc.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o moveg
en.o movegen.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o movep
ick.o movepick.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o notat
ion.o notation.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o pawns
.o pawns.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o posit
ion.o position.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o searc
h.o search.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o threa
d.o thread.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o timem
an.o timeman.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o tt.o
tt.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o uci.o
uci.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o uciop
tion.o ucioption.cpp
ucioption.cpp:178:1: warning: embedding a directive within macro arguments is no
t portable
#if defined(PA_GTB) && defined (USE_EGTB)
^
ucioption.cpp:180:1: warning: embedding a directive within macro arguments is no
t portable
#endif
^
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o egtb.
o egtb.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o phash
.o phash.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o phash
_kyoto.o phash_kyoto.cpp
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA_GTB=1 -D
USE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra -Wshadow
-DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto -c -o phash
_qdbm.o phash_qdbm.cpp
g++ -o stockfish benchmark.o bitbase.o bitboard.o bitcount.o book.o endgame.o ev
aluate.o main.o material.o misc.o movegen.o movepick.o notation.o pawns.o positi
on.o search.o thread.o timeman.o tt.o uci.o ucioption.o egtb.o phash.o phash_kyo
to.o phash_qdbm.o -lgcov -Legtb -lgtb -Lqdbm -lqdbm -Lkyotocabinet -lkyotocabin
et -lpthread -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-generate -DPA
_GTB=1 -DUSE_EGTB -isystem kyotocabinet/ -ansi -pedantic -Wno-long-long -Wextra
-Wshadow -DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -msse3 -DUSE_POPCNT -flto
C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.1.0/../../../../x86_64-w64-
mingw32/bin/ld.exe: cannot find -lqdbm
C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.1.0/../../../../x86_64-w64-
mingw32/bin/ld.exe: cannot find -lkyotocabinet
collect2.exe: error: ld returned 1 exit status
Makefile:446: recipe for target 'stockfish' failed
mingw32-make[2]: *** [stockfish] Error 1
mingw32-make[2]: Leaving directory 'C:/Users/Marco-Amos/Documents/GitHub/start/s
rc'
Makefile:452: recipe for target 'gcc-profile-make' failed
mingw32-make[1]: *** [gcc-profile-make] Error 2
mingw32-make[1]: Leaving directory 'C:/Users/Marco-Amos/Documents/GitHub/start/s
rc'
Makefile:372: recipe for target 'profile-build' failed
mingw32-make: *** [profile-build] Error 2
~\Documents\GitHub\start\src [master ↑1 +29 ~4 -0 !]>
Error
Code: Select all
mingw32/bin/ld.exe: cannot find -lqdbm
Code: Select all
mingw32/bin/ld.exe: cannot find -lkyotocabinet
-
- Posts: 134
- Joined: Thu Jul 24, 2014 2:49 pm
Re: Stockfish PA GTB Problem
You are probably trying to compile a different version than the one originally posted on the message board. There are no files named phash_kyoto.cpp or phash_qdbm.cpp in the repository.
You have to compile the missing libs first and tell the linker where to find them.
Maybe this helps:
http://www.open-chess.org/viewtopic.php ... 1&start=80
You have to compile the missing libs first and tell the linker where to find them.
Maybe this helps:
http://www.open-chess.org/viewtopic.php ... 1&start=80
-
- Posts: 122
- Joined: Mon Aug 18, 2014 7:12 pm
- Location: Trento (Italy)
Re: Stockfish PA GTB Problem
Did you compile this version?pferd wrote:You are probably trying to compile a different version than the one originally posted on the message board. There are no files named phash_kyoto.cpp or phash_qdbm.cpp in the repository.
You have to compile the missing libs first and tell the linker where to find them.
Maybe this helps:
http://www.open-chess.org/viewtopic.php ... 1&start=80
stockfish-3-PA_GTB-008.7z
-
- Posts: 122
- Joined: Mon Aug 18, 2014 7:12 pm
- Location: Trento (Italy)
Re: Stockfish PA GTB Problem
stockfish-3-PA_GTB-008.7z
Same mistake
Same mistake
-
- Posts: 545
- Joined: Tue Jun 06, 2017 4:49 pm
- Location: Italy
Re: Stockfish PA GTB Problem
Did you try with Stockfish TCEC6 PA GTB? It's the link I mailed you...Zerbinati wrote:stockfish-3-PA_GTB-008.7z
Same mistake

F.S.I. Chess Teacher
-
- Posts: 122
- Joined: Mon Aug 18, 2014 7:12 pm
- Location: Trento (Italy)
Re: Stockfish PA GTB Problem
yesRodolfo Leoni wrote:Did you try with Stockfish TCEC6 PA GTB? It's the link I mailed you...Zerbinati wrote:stockfish-3-PA_GTB-008.7z
Same mistake

-
- Posts: 545
- Joined: Tue Jun 06, 2017 4:49 pm
- Location: Italy
Re: Stockfish PA GTB Problem
Compiler doesn't find files, but they're into their directories...Zerbinati wrote:yesRodolfo Leoni wrote:Did you try with Stockfish TCEC6 PA GTB? It's the link I mailed you...Zerbinati wrote:stockfish-3-PA_GTB-008.7z
Same mistake

F.S.I. Chess Teacher
-
- Posts: 122
- Joined: Mon Aug 18, 2014 7:12 pm
- Location: Trento (Italy)
Re: Stockfish PA GTB Problem
In fact and what amazes meRodolfo Leoni wrote:Compiler doesn't find files, but they're into their directories...Zerbinati wrote:yesRodolfo Leoni wrote:Did you try with Stockfish TCEC6 PA GTB? It's the link I mailed you...Zerbinati wrote:stockfish-3-PA_GTB-008.7z
Same mistake