bsamseth / Goldfish

Goldfish - Stockfish's very distant and not so bright cousin - a UCI chess engine
MIT License
6 stars 2 forks source link

Exes #47

Closed SzotsGabor closed 1 month ago

SzotsGabor commented 1 month ago

Hi Bendik,

Thanks for the new version. Up till now the only problem has been that I can't use it because I am on Windows and you have not provided exes yet. I have Rust and Visual Studio installed so I tried to compile it myself. I failed, and this is an excerpt from the error log:

error: failed to run custom build command for fathom v0.1.0 (E:\Sakk\compiles\Goldfish\Goldfish-2.1.0\fathom)

Caused by: process didn't exit successfully: e:\Sakk\compiles\Goldfish\Goldfish-2.1.0\target\release\build\fathom-7153cfbe18549b63\build-script-build (exit code: 1) --- stdout OUT_DIR = Some(e:\Sakk\compiles\Goldfish\Goldfish-2.1.0\target\release\build\fathom-82be9e6eac2de69e\out) TARGET = Some(x86_64-pc-windows-msvc) OPT_LEVEL = Some(3) HOST = Some(x86_64-pc-windows-msvc) cargo:rerun-if-env-changed=VCINSTALLDIR VCINSTALLDIR = None cargo:rerun-if-env-changed=VisualStudioDir VisualStudioDir = None cargo:rerun-if-env-changed=VSCMD_ARG_VCVARS_SPECTRE VSCMD_ARG_VCVARS_SPECTRE = None cargo:rerun-if-env-changed=WindowsSdkDir WindowsSdkDir = None cargo:rerun-if-env-changed=WindowsSDKVersion WindowsSDKVersion = None cargo:rerun-if-env-changed=LIB LIB = None cargo:rerun-if-env-changed=PATH PATH = Some(e:\Sakk\compiles\Goldfish\Goldfish-2.1.0\target\release\deps;e:\Sakk\compiles\Goldfish\Goldfish-2.1.0\target\release;C:\Users\szots.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\Users\szots.cargo\bin;C:\Users\szots\AppData\Local\Microsoft\WindowsApps;c:\msys64\mingw64\bin\;c:\msys64\mingw32\bin\;c:\msys64\usr\bin\;c:\msys64\mingw64\include\gtkmm-3.0\;c:\msys64\mingw32\include\gtkmm-3.0\;c:\Program Files\Java\jdk-17\bin\;C:\Users\szots.dotnet\tools;C:\Users\szots\AppData\Roaming\npm) cargo:rerun-if-env-changed=INCLUDE INCLUDE = None cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc CC_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc CC_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CC HOST_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some(adx,aes,avx,avx2,bmi1,bmi2,cmpxchg16b,f16c,fma,fxsr,lzcnt,movbe,pclmulqdq,popcnt,rdrand,rdseed,sha,sse,sse2,sse3,sse4.1,sse4.2,ssse3,xsave,xsavec,xsaveopt,xsaves) DEBUG = Some(false) cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc CFLAGS_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc CFLAGS_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CFLAGS HOST_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT tbprobe.c C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\vcruntime_c11_stdatomic.h(36): error C2061: syntax error: identifier 'atomic_bool' ``

Can you help?

Gabor Szots CCRL testing group

bsamseth commented 1 month ago

Hi! Thanks for the interest and the error log. It's been on my todo list for a bit, but I will try to set aside some time to fix (ideally automatically built) binaries. It would be fun to have a newer version tested on CCRL! I'll ping this issue once I get around to fixing it!

bsamseth commented 1 month ago

Cross compiling turned out to be a little tricker than I hoped. But, the latest release now has a Windows executable, for Intel CPUs. Hopefully that runs well.

I did manage to reproduce the error you got, and I believe I have been able to fix it. If you can, it would be great to known if you are now able to compile from source. Something to the effect of

cargo build --profile release-lto --bin goldfish  # Enables all optimizations, takes a while.
cp target/release-lto/goldfish.exe goldfish-2.1.0.exe

If so, the resulting executable will be slightly faster than the one attached to the release, as it will have enabled some extra CPU instructions which are not enabled in the generic release binary.

SzotsGabor commented 1 month ago

Your compile seems to run well under W11. I have successfully compiled the source. It is indeed slightly faster than yours.

The engine prints some yellowish WARN while calculating.

bsamseth commented 1 month ago

Indeed, I have forgotten to remove some extra logging.

I'll close this issue for now. Going forward I'll make a point to remember to both publish binaries and ensure it builds on windows too.

Thanks again for reporting!