Default Stockfish in XBoard

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

Moderators: hgm, Rebel, chrisw

User avatar
Look
Posts: 364
Joined: Thu Jun 05, 2014 2:14 pm
Location: Iran
Full name: Mehdi Amini

Default Stockfish in XBoard

Post by Look »

Hi,

How can I use Stockfish 10 as a default engine (for analysis) in XBoard ?
Farewell.
User avatar
Look
Posts: 364
Joined: Thu Jun 05, 2014 2:14 pm
Location: Iran
Full name: Mehdi Amini

Re: Default Stockfish in XBoard

Post by Look »

Should I just copy Stockfish 10 to usr/games then in XBoard "Engine" menu "Load new 1st engine" and select that. Or that is something different ?
Farewell.
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Default Stockfish in XBoard

Post by hgm »

After you put the stockfish binary in /usr/games it should be available as a plain command (/usr/games is normally in the shell's search path). So when you register it through the Load 1st Engine menu, you should specify "stockfish" as the engine command (and the directory should be of no importance). Don't forget to tick the UCI checkbox, though. And make sure you have the Polyglot package installed.

If you install from a binary package the binary should be placed automatically where it belongs in your distro, and the engine should be automatically be registered to XBoard, and appear in the listbox of registered engines of the Load Engine dialogs. The same should happen when you install from source through 'make install'.

You can also run XBoard with the command

xboard -fcp stockfish -fUCI

In that case it won't be added to your list of registered engines.
User avatar
Look
Posts: 364
Joined: Thu Jun 05, 2014 2:14 pm
Location: Iran
Full name: Mehdi Amini

Re: Default Stockfish in XBoard

Post by Look »

hgm wrote: Sat Oct 26, 2019 2:21 pm After you put the stockfish binary in /usr/games it should be available as a plain command (/usr/games is normally in the shell's search path). So when you register it through the Load 1st Engine menu, you should specify "stockfish" as the engine command (and the directory should be of no importance). Don't forget to tick the UCI checkbox, though. And make sure you have the Polyglot package installed.
I use Ubuntu 18.04.3 LTS .
I put stockfish_10_x64_bmi2 to usr/games/ and after sudo -H nautilus command , right click then enable "Allow executing file as program" in "Permissions" , I am able to run it on Terminal :

Code: Select all

~$ '/usr/games/stockfish_10_x64_bmi2' 
Stockfish 10 64 BMI2 by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
^C

But the engine does not appear in "Registered engines" in "Engine" menu in XBoard.
If you install from a binary package the binary should be placed automatically where it belongs in your distro, and the engine should be automatically be registered to XBoard, and appear in the listbox of registered engines of the Load Engine dialogs. The same should happen when you install from source through 'make install'.
[...]

Unfortunately Stockfish package in my Ubuntu is version 8 which is out-dated.
Farewell.
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Default Stockfish in XBoard

Post by hgm »

Engines would only be registered automatically when the are installed through the proper procedure (make-install or a binary package). Just moving them to an executable location is not enough; XBoard has no way to guess whether a new file you put somewhere (even if it could detect that you did that at all) is a chess engine. It might as well be a utility to erase your hard disk...

To register it by hand you have to use the Load Engine dialog, and tell it the name of the command (or browse to the executable using the browse button, which in Linux is a bit cumbersome as executables are usually well hidden), and engine type (UCI/xboard)
User avatar
Look
Posts: 364
Joined: Thu Jun 05, 2014 2:14 pm
Location: Iran
Full name: Mehdi Amini

Re: Default Stockfish in XBoard

Post by Look »

hgm wrote: Sun Oct 27, 2019 11:13 am Engines would only be registered automatically when the are installed through the proper procedure (make-install or a binary package). Just moving them to an executable location is not enough; XBoard has no way to guess whether a new file you put somewhere (even if it could detect that you did that at all) is a chess engine. It might as well be a utility to erase your hard disk...

To register it by hand you have to use the Load Engine dialog, and tell it the name of the command (or browse to the executable using the browse button, which in Linux is a bit cumbersome as executables are usually well hidden), and engine type (UCI/xboard)
Do you think this command is OK ?

Code: Select all

"Stockfish_10" -fcp "stockfish_10_x64_bmi2" -fd "." -fUCI
Farewell.
JohnWoe
Posts: 491
Joined: Sat Mar 02, 2013 11:31 pm

Re: Default Stockfish in XBoard

Post by JohnWoe »

Sometimes $PATH gets messed up after updating Linux distro. To test Sapeli it won't find binaries.
So I write this pretty regularly.

Code: Select all

export PATH="$PATH:/usr/games"
For example to install my engine just see where is Stockfish/Crafty/etc and put Sapeli there too. Works perfectly.
My machine.

Code: Select all

whereis stockfish
stockfish: /usr/games/stockfish /usr/share/man/man6/stockfish.6.gz
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Default Stockfish in XBoard

Post by hgm »

Code: Select all

"Stockfish_10" -fcp "stockfish_10_x64_bmi2" -fd "." -fUCI
This is not a command, but an engine description as it would be stored in XBoard's engine list. The engine command is: stockfish_10_x64_bmi2
As a nickname you could then specify: Stockfish_10
and as directory: .
(Which is the default suggestion in the Load engine dialog. But it doesn't really matter; Stockish would run with any directory set as current, as it doesn't access the file system. And even if it would, compliant Linux programs are supposed to know where their support files (e.g. opening books) are located, without relying on a current directory.)
The -fUCI would be added by ticking the UCI checkbox.

Of course you could enter this line directly into the engine list with the aid of the Edit Engine List menu item. Then you don't have to use the Load Engine dialog at all.