Linux friendly engines at all levels

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: Linux friendly engines at all levels

Post by OliverBr »

Here is a list of engines with "perfect unix conformity". They fulfil the following requirements:

1) Sources in GIT
2) Easy "make" in Linux and MacOSX.
3) Complete reliability over many thousands games.

You will be surprised that I could only find 15 engines so far:

Code: Select all

Engine		Rating	Version	Pr	GIT-Url
stockfish 	+990	11	uci	https://github.com/official-stockfish/Stockfish
ethereal 	+740	12.55	uci	https://github.com/AndyGrant/Ethereal
xiphos 		+640	0.6.1	uci	https://github.com/milostatarevic/xiphos
laser		+600	1.8b	uci 	https://github.com/jeffreyan11/laser-chess-engine
weiss 		+300	1.1	uci	https://github.com/TerjeKir/weiss
glaurung	+10	2.2	uci	https://github.com/phenri/glaurung
olithink		5.8.6	xb	https://github.com/olithink/OliThink/
toga ii 	-35	1.2.1a	uci	https://github.com/zwegner/toga-mp
k2 		-35	0.96	x+u	https://github.com/serg-meus/k2
scorpio 	-80	3.0.9	x+u	https://github.com/dshawul/Scorpio
wyldchess 	-120	1.5	x+u	https://github.com/Mk-Chan/WyldChess
stash		-120	21.1	uci	https://gitlab.com/mhouppin/stash-bot
fruit		-130	2.1	uci	https://github.com/Warpten/Fruit-2.1
phalanx		-150	XXV	xb	https://github.com/student-t/Phalanx-XXIII
purplehaze	-800	2.1.0	xb	https://github.com/vinc/purplehaze
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Linux friendly engines at all levels

Post by Ras »

OliverBr wrote: Sun Oct 11, 2020 10:23 pmYou will be surprised that I could only find 15 engines so far:
Sources in Git is unrelated to Linux friendliness. If you drop that requirement, you can add my engine to the list; there's a build script for Linux, and macOS has its own one because it lacks support for some optional Posix stuff.
Rasmus Althoff
https://www.ct800.net
abulmo2
Posts: 433
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: Linux friendly engines at all levels

Post by abulmo2 »

OliverBr wrote: Sun Oct 11, 2020 10:23 pm Here is a list of engines with "perfect unix conformity". They fulfil the following requirements:

1) Sources in GIT
2) Easy "make" in Linux and MacOSX.
3) Complete reliability over many thousands games.

You will be surprised that I could only find 15 engines so far:
What is wrong with my engines? There sources are in Github and come with a makefile:
https://github.com/abulmo/amoeba
https://github.com/abulmo/Dumb
Personally I have got about 130 engines working under Linux, and I do not have more because I am not seeking for actively.
Richard Delorme
jorose
Posts: 358
Joined: Thu Jan 22, 2015 3:21 pm
Location: Zurich, Switzerland
Full name: Jonathan Rosenthal

Re: Linux friendly engines at all levels

Post by jorose »

OliverBr wrote: Sun Oct 11, 2020 10:23 pm Here is a list of engines with "perfect unix conformity". They fulfil the following requirements:

1) Sources in GIT
2) Easy "make" in Linux and MacOSX.
3) Complete reliability over many thousands games.

You will be surprised that I could only find 15 engines so far:

Code: Select all

Engine		Rating	Version	Pr	GIT-Url
stockfish 	+990	11	uci	https://github.com/official-stockfish/Stockfish
ethereal 	+740	12.55	uci	https://github.com/AndyGrant/Ethereal
xiphos 		+640	0.6.1	uci	https://github.com/milostatarevic/xiphos
laser		+600	1.8b	uci 	https://github.com/jeffreyan11/laser-chess-engine
weiss 		+300	1.1	uci	https://github.com/TerjeKir/weiss
glaurung	+10	2.2	uci	https://github.com/phenri/glaurung
olithink		5.8.6	xb	https://github.com/olithink/OliThink/
toga ii 	-35	1.2.1a	uci	https://github.com/zwegner/toga-mp
k2 		-35	0.96	x+u	https://github.com/serg-meus/k2
scorpio 	-80	3.0.9	x+u	https://github.com/dshawul/Scorpio
wyldchess 	-120	1.5	x+u	https://github.com/Mk-Chan/WyldChess
stash		-120	21.1	uci	https://gitlab.com/mhouppin/stash-bot
fruit		-130	2.1	uci	https://github.com/Warpten/Fruit-2.1
phalanx		-150	XXV	xb	https://github.com/student-t/Phalanx-XXIII
purplehaze	-800	2.1.0	xb	https://github.com/vinc/purplehaze
Winter belongs on that List.

Build instructions:

1) git clone the repo
2) cd into directory
3) call "make". If you dont have clang, call "make CC=g++"
-Jonathan
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Linux friendly engines at all levels

Post by mvanthoor »

hgm wrote: Sun Oct 11, 2020 10:15 pm When I started compiling C on my PC MSYS2 did not exist yet. I liked Cygwin because it provided a Linux-like environment. (I use commands like grep a lot.) But MSYS2 does that too, doesn't it? On my laptop I now use MinGW, because the anti-virus software removed Cygwin. But then I cannot use the Makefile for building WinBoard, which sort of renders it useless. If I re-install Cygwin gcc 3.4.4 is no longer in the menu...

Otherwise I usually work according to the principle "if it ain't broken, don't try to fix it!". In my experience newer versions are usually worse. Ubuntus became inacceptable after 10.04, so I am still running that for Linux.
Cygwin is still required for some programs (it includes the cygwin1.dll posix-layer, which MSYS2 does not), but MSYS2 is able to replace a lot of what Cygwin does.

I've been using Cygwin since about the day it came out (and "Unix services for Windows NT" before that), but after I switched to MSYS2, I never looked back. I have gcc, g++, and clang installed to compile my own engines (if I want to).

MSYS2 is my default shell on Windows. (I dislike Powershell with a passion...)

(I even use "stable-x86_64-pc-windows-gnu" in my Rust installation in Windows, and use GDB through MSYS2 for debugging; my engine actually is a Linux program built on Windows using Rust's GNU toolchain for Windows. The reason is that this build is almost 10% faster than the one produced by "stable-x86_64-pc-windows-msvc." The difference is that the -gnu toolchain uses the gcc linker, while the -msvc toolchain uses the Microsoft linker. I think it's weird that Linux-linkers building Windows programs make faster Windows programs than Microsoft's own linker.)
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: Linux friendly engines at all levels

Post by OliverBr »

jorose wrote: Mon Oct 12, 2020 1:56 am Winter belongs on that List.
Not yet. It doesn't work with MacOSX + clang, yet:

Code: Select all

make
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/magic.cc -o src/general/magic.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/parse.cc -o src/general/parse.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/wdl_score.cc -o src/general/wdl_score.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/learning/cluster.cc -o src/learning/cluster.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/learning/machine_learning.cc -o src/learning/machine_learning.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/benchmark.cc -o src/benchmark.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/board.cc -o src/board.o
src/board.cc:177:20: error: constexpr variable 'all_castling_squares' must be initialized by a constant expression
constexpr BitBoard all_castling_squares = castling_relevant_bbs[0] | castling_relevant_bbs[1]
                   ^                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/board.cc:177:43: note: non-constexpr function 'operator[]' cannot be used in a constant expression
constexpr BitBoard all_castling_squares = castling_relevant_bbs[0] | castling_relevant_bbs[1]
                                          ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/array:193:21: note: declared here
    const_reference operator[](size_type __n) const {return __elems_[__n];}
                    ^
1 error generated.
make: *** [src/board.o] Error 1
Build instructions:

1) git clone the repo
2) cd into directory
3) call "make". If you dont have clang, call "make CC=g++"
Done, but yields error, see above.
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: Linux friendly engines at all levels

Post by OliverBr »

abulmo2 wrote: Sun Oct 11, 2020 11:28 pm
OliverBr wrote: Sun Oct 11, 2020 10:23 pm Here is a list of engines with "perfect unix conformity". They fulfil the following requirements:

1) Sources in GIT
2) Easy "make" in Linux and MacOSX.
3) Complete reliability over many thousands games.

You will be surprised that I could only find 15 engines so far:
What is wrong with my engines? There sources are in Github and come with a makefile:
I had tested Dumb before (on of my favorite engines), but it didn't compile on my computers, because it needs "gdc", which is not standard there. So unfortunately it's not "easy make".
https://github.com/abulmo/amoeba
https://github.com/abulmo/Dumb
Personally I have got about 130 engines working under Linux, and I do not have more because I am not seeking for actively.
Some engines have problems like: They won't compile under MacOSX or crash/hang sometimes.
If course, I haven't test all engines, so I am happy to test more, if you tell me the GIT Url :)
Last edited by OliverBr on Mon Oct 12, 2020 6:44 am, edited 2 times in total.
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
jorose
Posts: 358
Joined: Thu Jan 22, 2015 3:21 pm
Location: Zurich, Switzerland
Full name: Jonathan Rosenthal

Re: Linux friendly engines at all levels

Post by jorose »

OliverBr wrote: Mon Oct 12, 2020 6:20 am
jorose wrote: Mon Oct 12, 2020 1:56 am Winter belongs on that List.
Not yet. It doesn't work with MacOSX + clang, yet:

Code: Select all

make
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/magic.cc -o src/general/magic.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/parse.cc -o src/general/parse.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/general/wdl_score.cc -o src/general/wdl_score.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/learning/cluster.cc -o src/learning/cluster.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/learning/machine_learning.cc -o src/learning/machine_learning.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/benchmark.cc -o src/benchmark.o
clang++ -c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++11 -Isrc -Isrc/general -Isrc/learning src/board.cc -o src/board.o
src/board.cc:177:20: error: constexpr variable 'all_castling_squares' must be initialized by a constant expression
constexpr BitBoard all_castling_squares = castling_relevant_bbs[0] | castling_relevant_bbs[1]
                   ^                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/board.cc:177:43: note: non-constexpr function 'operator[]' cannot be used in a constant expression
constexpr BitBoard all_castling_squares = castling_relevant_bbs[0] | castling_relevant_bbs[1]
                                          ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/array:193:21: note: declared here
    const_reference operator[](size_type __n) const {return __elems_[__n];}
                    ^
1 error generated.
make: *** [src/board.o] Error 1
Build instructions:

1) git clone the repo
2) cd into directory
3) call "make". If you dont have clang, call "make CC=g++"
Done, but yields error, see above.
Interesting. I don't have an OSX device (Im on Xubuntu), but I imagine that shouldnt be the issue. Would you mind specifying your clang version?

EDIT: I tested with clang versions 4, 6 and 9. None of them had issues for me. Again, I am on Linux though.
-Jonathan
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: Linux friendly engines at all levels

Post by OliverBr »

jorose wrote: Mon Oct 12, 2020 6:30 am Interesting. I don't have an OSX device (Im on Xubuntu), but I imagine that shouldnt be the issue. Would you mind specifying your clang version?
Of course, I am very happy to assist in fixing this. Winter is a very interesting engine:

Code: Select all

clang --version
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
PS: On my Linux server there is no error, just a warning:

Code: Select all

src/net_evaluation.cc:74:11: warning: unused variable 'net_version' [-Wunused-const-variable]
const int net_version = 20051601; // Unused warning is expected.
          ^
1 warning generated.
Clang version:

Code: Select all

clang --version
clang version 7.0.1-8 (tags/RELEASE_701/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
jorose
Posts: 358
Joined: Thu Jan 22, 2015 3:21 pm
Location: Zurich, Switzerland
Full name: Jonathan Rosenthal

Re: Linux friendly engines at all levels

Post by jorose »

I suspect this is the issue: https://stackoverflow.com/questions/316 ... -constexpr

In this case the easiest solution is to do something I have been considering anyways, which is update to C++14.

Could you replace std=c++11 with std=c++14 on line four of the Makefile? Assuming that works I will update the repository as well as I don't have much of a reason to stick to the older C++ version.

EDIT: After reading the link more properly I realize I might have to do some more work, but I am pretty sure this is the issue. Its interesting that it works on Linux and Windows though. For the Windows compiles I am actually also using C++14, so updating version makes sense anyways.
Last edited by jorose on Mon Oct 12, 2020 6:49 am, edited 1 time in total.
-Jonathan