Request Cfish dev with BMI2 support

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

Moderators: hgm, Rebel, chrisw

User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Request Cfish dev with BMI2 support

Post by Nordlandia »

I have Cfish with popcnt support, although BMI2 is faster.
main line
Posts: 60
Joined: Thu Jul 07, 2016 10:15 pm

Re: Request Cfish dev with BMI2 support

Post by main line »

You need to read only first 3 sentences from this link -
https://github.com/glinscott/fishtest/w ... on-Windows ;
and do it:

download and install MSYS2, use the 64 bit or 32 bit installer according your operating system and follow the official instruction to update the MSYS2 packages (simply: a. update the core packages executing pacman -Syuu, when requested close the windows pushing the top right X button b. open a MSYS2 MinGW 64-bit shell and update the others packages executing pacman -Syuu);

After that all is simple:

Build Cfish writing and executing this bash script

64 bit Windows: use a MSYS2 MinGW 64-bit shell
#!/bin/bash
# makefish.sh

# install packages if not already installed
unzip -v &> /dev/null || pacman -S --noconfirm unzip
make -v &> /dev/null || pacman -S --noconfirm make
g++ -v &> /dev/null || pacman -S --noconfirm mingw-w64-x86_64-gcc

# download the Cfish source code
wget https://github.com/syzygy1/Cfish/archive/master.zip
unzip master.zip
cd Cfish-master/src

# build the cfish executable
# to speedup the building process you can keep only the section that fits your CPU architecture

# build the binary for CPU with bmi2 instruction (e.g. Intel Haswell or newer)
if [ "$(g++ -Q -march=native --help=target | grep mbmi2 | grep enabled)" ] ; then
make profile-build ARCH=x86-64-bmi2 COMP=mingw
strip cfish.exe
mv cfish.exe ../../cfish_x64_bmi2.exe
make clean
fi

cd
And you will find Cfish engine here:
C:\msys64\home\<your name>
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Request Cfish dev with BMI2 support

Post by Nordlandia »

main line: it did not work per your suggested recipe.

see - https://github.com/syzygy1/Cfish#cfish
main line
Posts: 60
Joined: Thu Jul 07, 2016 10:15 pm

Re: Request Cfish dev with BMI2 support

Post by main line »

Nordlandia wrote: Sat May 19, 2018 6:24 am main line: it did not work per your suggested recipe.

see - https://github.com/syzygy1/Cfish#cfish
In my computer it is working :
https://youtu.be/_MNrq9FzvsQ
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Request Cfish dev with BMI2 support

Post by Dann Corbit »

https://drive.google.com/file/d/12VucGI ... sp=sharing

Oops, I made two binaries without bmi support.

Don't bother with the download, but you can use my makefile and it will work on Windows.
Last edited by Dann Corbit on Sat May 19, 2018 8:59 am, edited 2 times in total.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Request Cfish dev with BMI2 support

Post by Dann Corbit »

main line wrote: Sat May 19, 2018 8:41 am
Nordlandia wrote: Sat May 19, 2018 6:24 am main line: it did not work per your suggested recipe.

see - https://github.com/syzygy1/Cfish#cfish
In my computer it is working :
https://youtu.be/_MNrq9FzvsQ
Some simple things cause problems.
Like, in the makefile, you have to change the name of the binary from cfish to cfish.exe for windows.
I guess it is something simple like that.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Request Cfish dev with BMI2 support

Post by Nordlandia »

It messed up my directory, had to uninstall whole msys64.

Latest cfish with bmi2 is fine.
main line
Posts: 60
Joined: Thu Jul 07, 2016 10:15 pm

Re: Request Cfish dev with BMI2 support

Post by main line »

deleted
Last edited by main line on Sun May 20, 2018 11:20 pm, edited 3 times in total.
main line
Posts: 60
Joined: Thu Jul 07, 2016 10:15 pm

Re: Request Cfish dev with BMI2 support

Post by main line »

Nordlandia wrote: Sat May 19, 2018 7:59 pm It messed up my directory, had to uninstall whole msys64.

Latest cfish with bmi2 is fine.
After last Fix compilation under MingW, method with MSYS 2 works perfect
https://github.com/syzygy1/Cfish
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Request Cfish dev with BMI2 support

Post by Nordlandia »

The problem is present on my end. I reinstalled MSYS2 and updated packages, then pasting the script.

Is something else needed beside MSYS2?