Strange Stockfish behavior?

Code, algorithms, languages, construction...
royb
Posts: 44
Joined: Thu Jun 10, 2010 1:09 am

Re: Strange Stockfish behavior?

Post by royb » Thu Jun 30, 2011 2:09 pm

Jeremy Bernstein wrote:
royb wrote:Things are almost there now with the fixed Makefile. However there is an issue with EGTB. I added 'USE EGTB' to my command line for the make command and I get errors about egtb/gtb-probe.h no found. I created symlinks in egtb directory to ../gtb-probe.h (and a couple others if memory serves). However now I get this error:

... <snip> ...
g++ -o stockfish bitboard.o pawns.o material.o endgame.o egtb.o evaluate.o main.o misc.o move.o movegen.o movepick.o search.o position.o tt.o uci.o ucioption.o book.o bitbase.o thread.o benchmark.o timeman.o -L. -lpthread -static-libstdc++ -static-libgcc -lgcov -lgtb
/usr/bin/ld: cannot find -lgtb
collect2: ld returned 1 exit status
make[2]: *** [stockfish] Error 1
make[2]: Leaving directory `/home/roy/chess/SF-2.1.1-PA-GTB'
make[1]: *** [gcc-profile-make] Error 2
make[1]: Leaving directory `/home/roy/chess/SF-2.1.1-PA-GTB'
make: *** [profile-build] Error 2
roy@ubuntu-vm1:~/chess/SF-2.1.1-PA-GTB$

The unhappiness starts with: /usr/bin/ld: cannot find -lgtb

I'm not a Makefile guy and not a git person so pulling the source from the git repository is not something I'm knowledgeable about.

Thanks.
1. cd src/egtb
2. make (this will build the libgtb.a file that you need)
3. cd ..
4. make [ARCH]

that should be all you need to do. You don't need to add USE_EGTB to the command line, but you do have to build the static library libgtb first, and then just run the stockfish makefile. It Should Just Work©.

Jeremy

The src directory is empty, there is no egtb directory (or anything else!) in there.

Sorry I'm so clueless on this.

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Strange Stockfish behavior?

Post by Jeremy Bernstein » Thu Jun 30, 2011 2:14 pm

OK, step by step:

1. Un7z the Stockfish_211_PA_GTB_Gran2c.7z file. Verify that there are files in the src directory.
2. Open a console window and navigate to the "src" directory in the folder you unpacked.
3. Type 'cd egtb'
4. Type 'make'
5. Type 'cd ..' (you're now back in src)
6. Type 'make build ARCH=[archname]' where [archname] is one of the architectures specified in the makefile -- you probably want x86-64 or x86-64-modern, or x86-32 if you need 32-bit.

If that works, you can consider making an optimized build with 'make popcnt-profile-build ARCH=[archname]'.

Jeremy

royb
Posts: 44
Joined: Thu Jun 10, 2010 1:09 am

Re: Strange Stockfish behavior?

Post by royb » Thu Jun 30, 2011 2:21 pm

Jeremy Bernstein wrote:OK, step by step:

1. Un7z the Stockfish_211_PA_GTB_Gran2c.7z file. Verify that there are files in the src directory.
2. Open a console window and navigate to the "src" directory in the folder you unpacked.
3. Type 'cd egtb'
4. Type 'make'
5. Type 'cd ..' (you're now back in src)
6. Type 'make build ARCH=[archname]' where [archname] is one of the architectures specified in the makefile -- you probably want x86-64 or x86-64-modern, or x86-32 if you need 32-bit.

If that works, you can consider making an optimized build with 'make popcnt-profile-build ARCH=[archname]'.

Jeremy
Step 1. I ran this: 7z e Stockfish_211_PA_GTB_Gran2c.7z and expanded this into the directory /home/roy/chess/SF-2.1.1-PA-GTB (already existing and empty directory). There are NO source files in the src directory. They are all in the directory above src in /home/roy/chess/SF-2.1.1-PA-GTB and not in /home/roy/chess/SF-2.1.1-PA-GTB/src .

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Strange Stockfish behavior?

Post by Jeremy Bernstein » Thu Jun 30, 2011 2:26 pm

royb wrote:
Jeremy Bernstein wrote:OK, step by step:

1. Un7z the Stockfish_211_PA_GTB_Gran2c.7z file. Verify that there are files in the src directory.
2. Open a console window and navigate to the "src" directory in the folder you unpacked.
3. Type 'cd egtb'
4. Type 'make'
5. Type 'cd ..' (you're now back in src)
6. Type 'make build ARCH=[archname]' where [archname] is one of the architectures specified in the makefile -- you probably want x86-64 or x86-64-modern, or x86-32 if you need 32-bit.

If that works, you can consider making an optimized build with 'make popcnt-profile-build ARCH=[archname]'.

Jeremy
Step 1. I ran this: 7z e Stockfish_211_PA_GTB_Gran2c.7z and expanded this into the directory /home/roy/chess/SF-2.1.1-PA-GTB (already existing and empty directory). There are NO source files in the src directory. They are all in the directory above src in /home/roy/chess/SF-2.1.1-PA-GTB and not in /home/roy/chess/SF-2.1.1-PA-GTB/src .
Sounds like your 7z program isn't expanding the archive correctly. Try '7z ex' instead of just '7z e'.

jb

royb
Posts: 44
Joined: Thu Jun 10, 2010 1:09 am

Re: Strange Stockfish behavior?

Post by royb » Thu Jun 30, 2011 2:36 pm

Jeremy Bernstein wrote:
royb wrote:
Jeremy Bernstein wrote:OK, step by step:

1. Un7z the Stockfish_211_PA_GTB_Gran2c.7z file. Verify that there are files in the src directory.
2. Open a console window and navigate to the "src" directory in the folder you unpacked.
3. Type 'cd egtb'
4. Type 'make'
5. Type 'cd ..' (you're now back in src)
6. Type 'make build ARCH=[archname]' where [archname] is one of the architectures specified in the makefile -- you probably want x86-64 or x86-64-modern, or x86-32 if you need 32-bit.

If that works, you can consider making an optimized build with 'make popcnt-profile-build ARCH=[archname]'.

Jeremy
Step 1. I ran this: 7z e Stockfish_211_PA_GTB_Gran2c.7z and expanded this into the directory /home/roy/chess/SF-2.1.1-PA-GTB (already existing and empty directory). There are NO source files in the src directory. They are all in the directory above src in /home/roy/chess/SF-2.1.1-PA-GTB and not in /home/roy/chess/SF-2.1.1-PA-GTB/src .
Sounds like your 7z program isn't expanding the archive correctly. Try '7z ex' instead of just '7z e'.

jb
7z x Stockfish*.7z that worked and I moved the resulting directory into the SF-2.1.1-PA-GTB directory.

OK, now the last step of your process yields this:

g++ -o stockfish bitboard.o pawns.o material.o endgame.o egtb.o evaluate.o main.o misc.o move.o movegen.o movepick.o search.o position.o tt.o uci.o ucioption.o book.o bitbase.o thread.o benchmark.o timeman.o -L. -lpthread -static-libstdc++ -static-libgcc -lgcov -lgtb
/usr/bin/ld: cannot find -lgtb
collect2: ld returned 1 exit status
make[2]: *** [stockfish] Error 1
make[2]: Leaving directory `/home/roy/chess/SF-2.1.1-PA-GTB/Stockfish_211_PA_GTB_Gran2c/src'
make[1]: *** [gcc-profile-make] Error 2
make[1]: Leaving directory `/home/roy/chess/SF-2.1.1-PA-GTB/Stockfish_211_PA_GTB_Gran2c/src'
make: *** [profile-build] Error 2

<snip>

And we are back again to /usr/bin/ld cannot find -lgtb

Getting closer. I did not put USE_EGTB on the command line this time for the make though I would like to be able to use GTBs in the end.

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Strange Stockfish behavior?

Post by Jeremy Bernstein » Thu Jun 30, 2011 2:40 pm

royb wrote:
Jeremy Bernstein wrote:
royb wrote:
Jeremy Bernstein wrote:OK, step by step:

1. Un7z the Stockfish_211_PA_GTB_Gran2c.7z file. Verify that there are files in the src directory.
2. Open a console window and navigate to the "src" directory in the folder you unpacked.
3. Type 'cd egtb'
4. Type 'make'
5. Type 'cd ..' (you're now back in src)
6. Type 'make build ARCH=[archname]' where [archname] is one of the architectures specified in the makefile -- you probably want x86-64 or x86-64-modern, or x86-32 if you need 32-bit.

If that works, you can consider making an optimized build with 'make popcnt-profile-build ARCH=[archname]'.

Jeremy
Step 1. I ran this: 7z e Stockfish_211_PA_GTB_Gran2c.7z and expanded this into the directory /home/roy/chess/SF-2.1.1-PA-GTB (already existing and empty directory). There are NO source files in the src directory. They are all in the directory above src in /home/roy/chess/SF-2.1.1-PA-GTB and not in /home/roy/chess/SF-2.1.1-PA-GTB/src .
Sounds like your 7z program isn't expanding the archive correctly. Try '7z ex' instead of just '7z e'.

jb
7z x Stockfish*.7z that worked and I moved the resulting directory into the SF-2.1.1-PA-GTB directory.

OK, now the last step of your process yields this:

g++ -o stockfish bitboard.o pawns.o material.o endgame.o egtb.o evaluate.o main.o misc.o move.o movegen.o movepick.o search.o position.o tt.o uci.o ucioption.o book.o bitbase.o thread.o benchmark.o timeman.o -L. -lpthread -static-libstdc++ -static-libgcc -lgcov -lgtb
/usr/bin/ld: cannot find -lgtb
collect2: ld returned 1 exit status
make[2]: *** [stockfish] Error 1
make[2]: Leaving directory `/home/roy/chess/SF-2.1.1-PA-GTB/Stockfish_211_PA_GTB_Gran2c/src'
make[1]: *** [gcc-profile-make] Error 2
make[1]: Leaving directory `/home/roy/chess/SF-2.1.1-PA-GTB/Stockfish_211_PA_GTB_Gran2c/src'
make: *** [profile-build] Error 2

<snip>

And we are back again to /usr/bin/ld cannot find -lgtb

Getting closer. I did not put USE_EGTB on the command line this time for the make though I would like to be able to use GTBs in the end.
This output didn't come from the new Makefile I posted earlier. Replace the unzipped version with that version please.

jb

royb
Posts: 44
Joined: Thu Jun 10, 2010 1:09 am

Re: Strange Stockfish behavior?

Post by royb » Thu Jun 30, 2011 2:44 pm

Jeremy Bernstein wrote:
royb wrote:
Jeremy Bernstein wrote:
royb wrote:
Jeremy Bernstein wrote:OK, step by step:

1. Un7z the Stockfish_211_PA_GTB_Gran2c.7z file. Verify that there are files in the src directory.
2. Open a console window and navigate to the "src" directory in the folder you unpacked.
3. Type 'cd egtb'
4. Type 'make'
5. Type 'cd ..' (you're now back in src)
6. Type 'make build ARCH=[archname]' where [archname] is one of the architectures specified in the makefile -- you probably want x86-64 or x86-64-modern, or x86-32 if you need 32-bit.

If that works, you can consider making an optimized build with 'make popcnt-profile-build ARCH=[archname]'.

Jeremy
Step 1. I ran this: 7z e Stockfish_211_PA_GTB_Gran2c.7z and expanded this into the directory /home/roy/chess/SF-2.1.1-PA-GTB (already existing and empty directory). There are NO source files in the src directory. They are all in the directory above src in /home/roy/chess/SF-2.1.1-PA-GTB and not in /home/roy/chess/SF-2.1.1-PA-GTB/src .
Sounds like your 7z program isn't expanding the archive correctly. Try '7z ex' instead of just '7z e'.

jb
7z x Stockfish*.7z that worked and I moved the resulting directory into the SF-2.1.1-PA-GTB directory.

OK, now the last step of your process yields this:

g++ -o stockfish bitboard.o pawns.o material.o endgame.o egtb.o evaluate.o main.o misc.o move.o movegen.o movepick.o search.o position.o tt.o uci.o ucioption.o book.o bitbase.o thread.o benchmark.o timeman.o -L. -lpthread -static-libstdc++ -static-libgcc -lgcov -lgtb
/usr/bin/ld: cannot find -lgtb
collect2: ld returned 1 exit status
make[2]: *** [stockfish] Error 1
make[2]: Leaving directory `/home/roy/chess/SF-2.1.1-PA-GTB/Stockfish_211_PA_GTB_Gran2c/src'
make[1]: *** [gcc-profile-make] Error 2
make[1]: Leaving directory `/home/roy/chess/SF-2.1.1-PA-GTB/Stockfish_211_PA_GTB_Gran2c/src'
make: *** [profile-build] Error 2

<snip>

And we are back again to /usr/bin/ld cannot find -lgtb

Getting closer. I did not put USE_EGTB on the command line this time for the make though I would like to be able to use GTBs in the end.
This output didn't come from the new Makefile I posted earlier. Replace the unzipped version with that version please.

jb
I thought I did but I redownloaded your Makefile.zip file and unzipped it into the src directory and re-ran make and got the same result ...

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Strange Stockfish behavior?

Post by Jeremy Bernstein » Thu Jun 30, 2011 3:06 pm

Sorry, I'm an ass. I posted the wrong Makefile (pre-save). The correct one is attached. Sorry to waste your time.
Attachments
Makefile.zip
(4.01 KiB) Downloaded 238 times

BB+
Posts: 1484
Joined: Thu Jun 10, 2010 4:26 am

Re: Strange Stockfish behavior?

Post by BB+ » Fri Jul 01, 2011 1:48 pm

Sounds like your 7z program isn't expanding the archive correctly. Try '7z ex' instead of just '7z e'.
I had the same problem at first. I just ran "7za e <name>", and had to realise that you need to add the x option to get the directory structure to also be extracted:

Code: Select all

  e: Extract files from archive (without using directory names)
  x: eXtract files with full paths
[It initially gave me a query about overwriting Makefile (the one from egtb/), which led me to wonder was going on].

Prima
Posts: 328
Joined: Tue Dec 14, 2010 6:12 am

Re: Strange Stockfish behavior?

Post by Prima » Tue Jul 12, 2011 3:13 am

Thanks Jeremy for these Stockfish 2.11 pa GTB Gran series. Thanks to others involved; Uly, BB, etc /9sorry if I missed someone).

Post Reply