How to install the Stockfish NNUE engine into Hiarcs UCI

Get your specific HIARCS/Junior support questions answered here as well as up-to-the-minute news!

Moderators: Watchman, Mark Uniacke, mrudolf

Rei
Member
Posts: 5
Joined: Sun Dec 22, 2019 4:22 pm

How to install the Stockfish NNUE engine into Hiarcs UCI

Post by Rei »

Dear Hiarcs members & Support,

I would like to know how I could install the Stockfish 12 NNUE engine into HIARCS UCI Chess Interface for my MacBook Pro OSX 10.15.7.

Previously versions I could get the Stockfish engine and moved into the HIARCS UCI directory and then it worked well. For this new version, I have no idea.

Would you please help me to install it?

Thank you for your attention.

Cheers,
Reinaldo.
Wheelman
Member
Posts: 66
Joined: Mon Mar 23, 2020 1:11 am

Post by Wheelman »

Hi Reinaldo,

Installing Stockfish 12 is the same as installing Stockfish 11, 10, etc. With SF12, at least EvalFile is added into the configuration. You can install a different network (other than the default one that comes with SF12) from here: https://tests.stockfishchess.org/nns. Once you install a net from there, you can make a folder for SF12 and put that file in there. You could then change the default SF12 net in HIARCS by looking for EvalFile and inserting the network file name (for example: nn-82215d0fd0df.nnue). After that, you're all set!
Rei
Member
Posts: 5
Joined: Sun Dec 22, 2019 4:22 pm

Post by Rei »

Hi Wheelman,

Thank you for your reply and info. I reckon it isn't easy to install the SF12 engine only as previous SFs for Mac. The SF website informs that it is necessary to install the Homebrew:

"If you want the engine only, you can get it through Homebrew:
brew install stockfish
" (Source: https://stockfishchess.org/download/)

Did you install it into your Mac?

Previous SF engines could be installed into the HIARCS UCI-format easily because the file was visible when you unzipped the package. But now it seems I need to install this Homebrew and then I don't know what happens further.

Please let me know the step-by-step procedure of SF installing.

Thank you for your attention and help.

Cheers,
Rei.
Wheelman
Member
Posts: 66
Joined: Mon Mar 23, 2020 1:11 am

Post by Wheelman »

Hey Rei,

I am terribly sorry; I have misread your initial post. I gave instructions on how to do it for windows; I have no idea what the procedure is for mac. Forgive me for wasting your time. I would have tried to know how, but I do not have a mac. I tried to search on how to do it anyway, and I thought these links might be of help:
https://brewinstall.org/Install-stockfi ... with-Brew/
https://formulae.brew.sh/formula/stockfish#default
https://www.youtube.com/watch?v=SELYgZvAZbU

Best wishes,

Wheelman
Rei
Member
Posts: 5
Joined: Sun Dec 22, 2019 4:22 pm

Post by Rei »

Hey Wheelman,

Thank you for your post and links. I'll see them and I hope I could install it into my Mac.

Cheers,
Rei.
User avatar
mrudolf
HCE Developer
Posts: 988
Joined: Thu Dec 17, 2020 4:44 pm

Post by mrudolf »

I guess the simplest way may be to use Stockfish from App Store, but for anybody who wants to use homebrew, here is the instruction:

1. Goto https://brew.sh/ and follow the instructions to install Homebrew.
2. Open terminal and type:

Code: Select all

brew install stockfish
3. Open HCE, go to Preferences/Engines and press Add...
4. In the file dialog press Cmd+Shift+G to select path.
5. In the edit box enter

Code: Select all

/usr/local/bin
Edit: if you have M1, you probably have to enter:

Code: Select all

/opt/homebrew/Cellar
6. Find file named stockfish and click on it.

The newest Stockfish should appear in the engine list.
Rei
Member
Posts: 5
Joined: Sun Dec 22, 2019 4:22 pm

Post by Rei »

Hi Rudolf,

Thank you for your message. The issue I see using the Stockfish UCI is that app doesn't allow you to analyse an entire game as HIARC UCI does (i.e., Hiarcs Chess Explorer -> Game -> Analyse game). For that reason, if SF 12 NNUE ran under Hiarcs Chess Explorer UCI, it would be amazing!

Cheers,
Reinaldo.
User avatar
mrudolf
HCE Developer
Posts: 988
Joined: Thu Dec 17, 2020 4:44 pm

Post by mrudolf »

It is definitely possible: see my screenshot of Stockfish configuration in HCE 1.9.4.

https://ibb.co/By5HWH1
Patzkopf
Member
Posts: 10
Joined: Wed Aug 29, 2012 6:01 pm

Post by Patzkopf »

You need to be able to use the Terminal, then there are several ways to compile Stockfish 12 for MAC.

I recommend the following four terminal commands (you will be prompted to install developer tools):

cd Downloads/
git clone https://github.com/official-stockfish/Stockfish.git Stockfish-master
cd Stockfish-master/src
make build ARCH=x86-64-bmi2


You then find your stockfish engine in the folder .../Downloads/Stockfish-master/src

Further remarks for the geeks:
the x86-64-bmi2 version should be good for most computers. The last line of the terminal commands can be amended to optimise according to your CPU. Here are the alternative parameters in boldface:
(sorry I do not know how to paste in a nice table, it is from https://github.com/nodchip/Stockfish/releases :
  • x86-64 Intel Streaming SIMD Extensions 2 >= AMD Athlon 64
    x86-64-ssse3 Intel Supplemental Streaming SIMD Extensions 3 >= Intel Pentium 4 (Prescott model F)
    x86-64-sse3-popcnt Intel Streaming SIMD Extensions 3 + POPCNT >= AMD Phenom
    x86-64-modern Intel Streaming SIMD Extensions 4.1 >= Intel Core 2 Duo (Penryn)
    x86-64-sse41-popcnt Intel Streaming SIMD Extensions 4.1 + POPCNT >= AMD Bobcat
    x86-64-avx2 Intel Advanced Vector Extensions 2 >= AMD APU (Carrizo)
    x86-64-bmi2 [/b]Intel Advanced Vector Extensions 2 + BMI2 >= Intel Core i7 (Haswell)
    x86-64-avx512 Intel Advanced Vector Extensions 512 >= Intel Core i9/i7 (Skylake-X)
    x86-64-vnni256 Intel Advanced Vector Extensions 2 + BMI2 + VNNI >= Intel Xeon (Cascade Lake)
    x86-64-vnni512 Intel Advanced Vector Extensions 512 + BMI2 + VNNI >= Intel Core i7/i5/i3 (Ice Lake)
If you are really geeky you can also swap the .nnue-file for further experimentation within the code and compile various versions.

Any questions just ask.
Have fun: Patzkopf
User avatar
mrudolf
HCE Developer
Posts: 988
Joined: Thu Dec 17, 2020 4:44 pm

Post by mrudolf »

Patzkopf wrote:You need to be able to use the Terminal, then there are several ways to compile Stockfish 12 for MAC.
Probably the simplest way is to use Homebrew: https://brew.sh
1. Follow the instructions there to install Homebrew
2. Run

Code: Select all

brew install stockfish
in Terminal
3. In HCE, go to Preferences/Engines and select Add
4. Press Cmd+Shift+G to enter path
5. Enter

Code: Select all

/usr/local/bin
and press Enter
6. Select stockfish in the list.
adel
Posts: 1
Joined: Thu Jan 07, 2021 5:31 am

Post by adel »

Homebrew stockfish is definitely a lot easier than compiling it from source.
Also note there is no need to go to the /usr directory to find stockfish, if you search for stockfish on the search-bar (top right) it will pop up.
Fake Ideal
Posts: 1
Joined: Tue Jul 28, 2020 8:51 pm

Post by Fake Ideal »

Excellent, thank you for the walkthrough.

I was a bit daunted by the sound of it when I saw the home-brew workaround on the Stockfish site, but following your steps it was quick and painless. :D
User avatar
Pedja
Member
Posts: 28
Joined: Mon Feb 08, 2021 6:27 am
Location: Vancouver

Post by Pedja »

I followed mrudolf instructions but it didn't work... I was not able to apply Homebrew solution as my Mac is pre-Mojave OS version.

Any way to do the same for Mac with 10.13 OS?

Much appreciated!!!
User avatar
Pedja
Member
Posts: 28
Joined: Mon Feb 08, 2021 6:27 am
Location: Vancouver

Post by Pedja »

Well, updated to Mojave OS, mrudolf's solution worked perfectly.
jldchess
Member
Posts: 101
Joined: Wed Jan 15, 2014 3:22 pm
Location: France

Post by jldchess »

Thanx mrudolf !
Stockfish engine works perfectly (MacMini 2012 Mojave / HCE 1.9.5)
Probably the simplest way is to use Homebrew: https://brew.sh
1. Follow the instructions there to install Homebrew
2. Run
Quote:
brew install stockfish
in Terminal
3. In HCE, go to Preferences/Engines and select Add
4. Press Cmd+Shift+G to enter path
5. Enter
Code:
/usr/local/bin
and press Enter
6. Select stockfish in the list.
But you forgot the last step :lol:
7. Enjoy !
Post Reply