Compiling Cfish

Moderators: Elijah, Igbo, timetraveller

Nemesis

Top contribute Forum Top Active Users
Forum Contributions
Points: 33 999,00 
Posts: 2585
Joined: 05/02/2020, 10:42
Status: Offline (Active 1 Month, 3 Days, 3 Hours, 10 Minutes ago)
Medals: 2
Topics: 194
Reputation: 7481
Has thanked: 6579 times
Been thanked: 6863 times

Compiling Cfish

Post by Nemesis »

popcorm1 popcorm1

Was going to post this a while ago - forgot .. xrf27
Tangentially reminded by Scorpio .. [xrf32

I'm sure this has been posted already - never mind I'll be reminded soon enough.

Compiling Cfish specifically for your hardware.

First :

Go to msys2.org and follow the installation instructions there.

Then you have two options - either downloading the cfish source and compiling it manually or 'automatically' via a script

Second - doing it manually :

Go here, click on the green button >> https://github.com/syzygy1/Cfish

Unzip to your desktop

Open folder and drag 'src' folder to your desktop
[much later I'll show you how to edit some of the source files - maybe around Nov 2025]

Open MSYS2 terminal window and >> cd to the 'src' folder

Type >> make pgo

[this instruction takes the legwork out of the process - it will compile specifically for your hardware]

You'll know when its done - this hand will jump out of your screen and tweak your nose then open the 'src' folder very carefully just in case it explodes or your teeth turn red - you will find the cfish binary inside - it will be named either cfish.exe or cfish profile xxxxxxxxxxxx - I dont remember now.

You can close the MSYS2 window.

Open a regular terminal window.

Drag the binary to the terminal window and type bench - if it disappears you're in big doo-doo - oops sorry - it means it needs the latest net so

Download the latest net

Create a folder on your desktop - MyCfish - and dump the binary and the net inside.

Drag that folder onto the terminal window and type table sorry bench - it should do its thing.

You're now good to go

Next if somebody reminds me in a few days I'll provide a script with a how-to to do it automatically.

If things dont work for you please dont let me know - I'm always very busy - thank you !

If you have no idea what I'm talking about you're in excellent company - I havent a clue either .. lol lol

MSYS2 >> https://www.msys2.org/

Cfish >> https://github.com/syzygy1/Cfish

Neural >> https://tests.stockfishchess.org/nns

More knowledgeable members are at liberty to correct without reference to me - thank you !
Nemesis

Top contribute Forum Top Active Users
Forum Contributions
Points: 33 999,00 
Posts: 2585
Joined: 05/02/2020, 10:42
Status: Offline (Active 1 Month, 3 Days, 3 Hours, 10 Minutes ago)
Medals: 2
Topics: 194
Reputation: 7481
Has thanked: 6579 times
Been thanked: 6863 times

Cfish

Post by Nemesis »

popcorm1 popcorm1

IF the MSYS2 environment is installed correctly and you have this on your desktop >>


Image


you're good to go with this >>

► Show Spoiler
[NOTE : only TWO command inputs .. the cd and make pgo at the top]

The above will ONLY happen IF IF IF the MSYS2 package installed correctly and is updated as per the instructions on its web page.
hazsan88
Forum Contributions
Points: 6 000,00 
Posts: 130
Joined: 23/11/2019, 19:48
Status: Offline (Active 1 Year, 7 Months, 2 Weeks, 5 Days, 12 Hours, 24 Minutes ago)
Topics: 2
Reputation: 196
Has thanked: 16 times
Been thanked: 204 times

Cfish

Post by hazsan88 »

Is it still possible to build it using command prompt?
35a
Nemesis

Top contribute Forum Top Active Users
Forum Contributions
Points: 33 999,00 
Posts: 2585
Joined: 05/02/2020, 10:42
Status: Offline (Active 1 Month, 3 Days, 3 Hours, 10 Minutes ago)
Medals: 2
Topics: 194
Reputation: 7481
Has thanked: 6579 times
Been thanked: 6863 times

Cfish

Post by Nemesis »

hazsan88 wrote:Is it still possible to build it using command prompt?
35a
No - needs MSYS2 package.
hazsan88
Forum Contributions
Points: 6 000,00 
Posts: 130
Joined: 23/11/2019, 19:48
Status: Offline (Active 1 Year, 7 Months, 2 Weeks, 5 Days, 12 Hours, 24 Minutes ago)
Topics: 2
Reputation: 196
Has thanked: 16 times
Been thanked: 204 times

Cfish

Post by hazsan88 »

janus wrote:
hazsan88 wrote:Is it still possible to build it using command prompt?
35a
No - needs MSYS2 package.
Answering my own question
Using this code, everything will be automatically downloaded and built
name it >> makefish.sh
► Show Spoiler
If things dont work for you please dont let me know - I'm always very busy - thank you !
(Janus jokees)
dance4
Nemesis

Top contribute Forum Top Active Users
Forum Contributions
Points: 33 999,00 
Posts: 2585
Joined: 05/02/2020, 10:42
Status: Offline (Active 1 Month, 3 Days, 3 Hours, 10 Minutes ago)
Medals: 2
Topics: 194
Reputation: 7481
Has thanked: 6579 times
Been thanked: 6863 times

Cfish

Post by Nemesis »

hazsan88 wrote:
janus wrote:
hazsan88 wrote:Is it still possible to build it using command prompt?
35a
No - needs MSYS2 package.
Answering my own question
Using this code, everything will be automatically downloaded and built
name it >> makefish.sh
► Show Spoiler
If things dont work for you please dont let me know - I'm always very busy - thank you !
(Janus jokees)
dance4
I have a similar script but have always used it with MSYS2.
If it works under the regular terminal then great - will solve a heap of problems for many members wishing to self-compile.

jury_ratings
kramnik

Top contribute Forum
Forum Contributions
Points: 40 305,00 
Posts: 1924
Joined: 04/11/2019, 14:45
Status: Offline (Active 3 Months, 6 Days, 16 Hours, 26 Minutes ago)
Medals: 1
Topics: 71
Reputation: 2388
Location: North-Italy
Has thanked: 1185 times
Been thanked: 2951 times

Cfish

Post by kramnik »

(1) It's advicable to NOT install the MSYS2 nor the MingW environments on said directory (Desktop) since the file path can contain spaces then giving issues (for example C:\Users\John Doe\Desktop\MSYS2) but in plain C directory: C:\MSYS2 or C:\MingW. After that one can create shortcuts to such folders and to the .bat compiler to place on the Desktop.

(2) It's not ended after you've made the compiling, you still have to strip the executable for much better performances:

strip [nameoftheexecutable].exe

for example

Code: Select all

strip cfish.exe
janus wrote:popcorm1 popcorm1

IF the MSYS2 environment is installed correctly and you have this on your desktop >>


Image


you're good to go with this >>

► Show Spoiler
[NOTE : only TWO command inputs .. the cd and make pgo at the top]

The above will ONLY happen IF IF IF the MSYS2 package installed correctly and is updated as per the instructions on its web page.
moonstonelight
Forum Contributions
Points: 7 463,00 
Posts: 92
Joined: 04/11/2019, 13:44
Status: Offline (Active 4 Days, 1 Hour, 27 Minutes ago)
Topics: 10
Reputation: 12
Location: Turkey
Has thanked: 4 times
Been thanked: 41 times

Cfish

Post by moonstonelight »

Hi,
I get this error:
► Show Spoiler
How can I avoid this?
Nemesis

Top contribute Forum Top Active Users
Forum Contributions
Points: 33 999,00 
Posts: 2585
Joined: 05/02/2020, 10:42
Status: Offline (Active 1 Month, 3 Days, 3 Hours, 10 Minutes ago)
Medals: 2
Topics: 194
Reputation: 7481
Has thanked: 6579 times
Been thanked: 6863 times

Cfish

Post by Nemesis »

moonstonelight wrote:Hi,
I get this error:
► Show Spoiler
How can I avoid this?
In the original 'numa.h' file there is no piping symbol before the #include - I have no idea where thats coming from.
Also your system appears to be translating some of the lines into Turkish ?
leonhurricaneX
Forum Contributions
Points: 15 587,00 
Posts: 233
Joined: 19/01/2020, 17:51
Status: Offline (Active 2 Weeks, 5 Days, 17 Hours, 7 Minutes ago)
Topics: 14
Reputation: 229
Location: Edge of the World
Has thanked: 159 times
Been thanked: 188 times

Cfish

Post by leonhurricaneX »

moonstonelight wrote:Hi,
I get this error:
► Show Spoiler
How can I avoid this?
Just add numa=no in your build command.
moonstonelight
Forum Contributions
Points: 7 463,00 
Posts: 92
Joined: 04/11/2019, 13:44
Status: Offline (Active 4 Days, 1 Hour, 27 Minutes ago)
Topics: 10
Reputation: 12
Location: Turkey
Has thanked: 4 times
Been thanked: 41 times

Cfish

Post by moonstonelight »

janus wrote:
moonstonelight wrote:Hi,
I get this error:
► Show Spoiler
How can I avoid this?
In the original 'numa.h' file there is no piping symbol before the #include - I have no idea where thats coming from.
Also your system appears to be translating some of the lines into Turkish ?
Yes, it translates automatically. I checked again and numa.h is same as on github's. The symbol belongs msys.
But still I can't find the reason. I reinstalled msys and pacman but I get the same error.
Can you upload your compiles? I use sse4.1 popcnt version.
Thanks
Nemesis

Top contribute Forum Top Active Users
Forum Contributions
Points: 33 999,00 
Posts: 2585
Joined: 05/02/2020, 10:42
Status: Offline (Active 1 Month, 3 Days, 3 Hours, 10 Minutes ago)
Medals: 2
Topics: 194
Reputation: 7481
Has thanked: 6579 times
Been thanked: 6863 times

Cfish

Post by Nemesis »

moonstonelight wrote:
janus wrote:
moonstonelight wrote:Hi,
I get this error:
► Show Spoiler
How can I avoid this?
In the original 'numa.h' file there is no piping symbol before the #include - I have no idea where thats coming from.
Also your system appears to be translating some of the lines into Turkish ?
Yes, it translates automatically. I checked again and numa.h is same as on github's. The symbol belongs msys.
But still I can't find the reason. I reinstalled msys and pacman but I get the same error.
Can you upload your compiles? I use sse4.1 popcnt version.
Thanks
Unfortunately I dont have a generic version as firstly I have an AVX2-compatible system plus I've edited some of the files within the source to suit. I may try to compile a generic but it wont be until much much later today as I have a long day ahead of me.

maybe @leonhurricanex can help ?
kramnik

Top contribute Forum
Forum Contributions
Points: 40 305,00 
Posts: 1924
Joined: 04/11/2019, 14:45
Status: Offline (Active 3 Months, 6 Days, 16 Hours, 26 Minutes ago)
Medals: 1
Topics: 71
Reputation: 2388
Location: North-Italy
Has thanked: 1185 times
Been thanked: 2951 times

Cfish

Post by kramnik »

Try

Code: Select all

make profile-build ARCH=x86-64-modern COMP=mingw
that should work. The source is optimized for profile building.
moonstonelight wrote:Hi,
I get this error:
► Show Spoiler
How can I avoid this?
leonhurricaneX
Forum Contributions
Points: 15 587,00 
Posts: 233
Joined: 19/01/2020, 17:51
Status: Offline (Active 2 Weeks, 5 Days, 17 Hours, 7 Minutes ago)
Topics: 14
Reputation: 229
Location: Edge of the World
Has thanked: 159 times
Been thanked: 188 times

Cfish

Post by leonhurricaneX »

:sm73:
(syzygy1 committed 35 minutes ago)

https://github.com/syzygy1/Cfish

And sorry moonstonelight I can't help I have Linux PC I can only compile standard builds for Windows no pgo.
ChessMan
Forum Contributions
Points: 33 618,00 
Posts: 869
Joined: 05/11/2019, 16:04
Status: Offline (Active 1 Month, 1 Week, 1 Hour, 49 Minutes ago)
Topics: 11
Reputation: 1577
Location: Ukraine
Has thanked: 216 times
Been thanked: 1310 times

Cfish

Post by ChessMan »

moonstonelight wrote:Hi,
I get this error:
► Show Spoiler
How can I avoid this?
Hello!
What CPU you have and waht OS?
For Linux build you need to add lnuma or disable NUMA

try something like this:
make profile-build ARCH=x86-64-modern extra=yes native=no numa=no popcnt=yes -j 8 COMP=gcc
Post Reply

Return to “Programming, Technical Discussions, Chess related questions etc.”