Compile Demolito on a Raspberry Pi?

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

Moderators: hgm, Rebel, chrisw

User avatar
Scally
Posts: 232
Joined: Thu Sep 28, 2017 9:34 pm
Location: Bermondsey, London
Full name: Alan Cooper

Compile Demolito on a Raspberry Pi?

Post by Scally »

Hi all,

I used to be able to compile Demolito on my 32 bit Armv7 Raspberry Pi but lately I’m stumped. Can anyone help or is it now 64 bit only?

I would ask on the GitHub site, but there’s a ‘no spoon feeding here’ comment in the README.


Thanks,

Al.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Compile Demolito on a Raspberry Pi?

Post by MikeB »

Scally wrote: Mon Nov 26, 2018 5:16 pm Hi all,

I used to be able to compile Demolito on my 32 bit Armv7 Raspberry Pi but lately I’m stumped. Can anyone help or is it now 64 bit only?

I would ask on the GitHub site, but there’s a ‘no spoon feeding here’ comment in the README.


Thanks,

Al.
I grabbed the version before he made changes to the makefile - no dice - seg faults to an error. Which was the last version that compiled?

Code: Select all

mike@PicoChess:~/Demolito $ make
clang -std=gnu11 -DNDEBUG -O3 -march=native -Wfatal-errors -Wall -Wextra -Wshadow -DVERSION=\"111262018\" ./src/*.c -o demolito -lm -lpthread
mike@PicoChess:~/Demolito $ ls
demolito  license  makefile  README.md  src
mike@PicoChess:~/Demolito $ ./demolito
uci
id name Demolito 111262018
id author lucasart
option name UCI_Chess960 type check default false
option name Hash type spin default 1 min 1 max 1048576
option name Threads type spin default 1 min 1 max 63
option name Contempt type spin default 10 min -100 max 100
option name Time Buffer type spin default 60 min 0 max 1000
uciok
isready
readyok
go depth 5
Segmentation fault
Image
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Compile Demolito on a Raspberry Pi?

Post by mar »

MikeB wrote: Mon Nov 26, 2018 10:53 pm I grabbed the version before he made changes to the makefile - no dice - seg faults to an error. Which was the last version that compiled?

Code: Select all

mike@PicoChess:~/Demolito $ make
clang -std=gnu11 -DNDEBUG -O3 -march=native -Wfatal-errors -Wall -Wextra -Wshadow -DVERSION=\"111262018\" ./src/*.c -o demolito -lm -lpthread
mike@PicoChess:~/Demolito $ ls
demolito  license  makefile  README.md  src
mike@PicoChess:~/Demolito $ ./demolito
uci
id name Demolito 111262018
id author lucasart
option name UCI_Chess960 type check default false
option name Hash type spin default 1 min 1 max 1048576
option name Threads type spin default 1 min 1 max 63
option name Contempt type spin default 10 min -100 max 100
option name Time Buffer type spin default 60 min 0 max 1000
uciok
isready
readyok
go depth 5
Segmentation fault
I believe you forgot ucinewgame and position commands?
Martin Sedlak
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Compile Demolito on a Raspberry Pi?

Post by MikeB »

mar wrote: Tue Nov 27, 2018 12:14 am
MikeB wrote: Mon Nov 26, 2018 10:53 pm I grabbed the version before he made changes to the makefile - no dice - seg faults to an error. Which was the last version that compiled?

Code: Select all

mike@PicoChess:~/Demolito $ make
clang -std=gnu11 -DNDEBUG -O3 -march=native -Wfatal-errors -Wall -Wextra -Wshadow -DVERSION=\"111262018\" ./src/*.c -o demolito -lm -lpthread
mike@PicoChess:~/Demolito $ ls
demolito  license  makefile  README.md  src
mike@PicoChess:~/Demolito $ ./demolito
uci
id name Demolito 111262018
id author lucasart
option name UCI_Chess960 type check default false
option name Hash type spin default 1 min 1 max 1048576
option name Threads type spin default 1 min 1 max 63
option name Contempt type spin default 10 min -100 max 100
option name Time Buffer type spin default 60 min 0 max 1000
uciok
isready
readyok
go depth 5
Segmentation fault
I believe you forgot ucinewgame and position commands?
good catch - many engines today do not require that, this one does...
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Compile Demolito on a Raspberry Pi?

Post by MikeB »

Scally wrote: Mon Nov 26, 2018 5:16 pm Hi all,

I used to be able to compile Demolito on my 32 bit Armv7 Raspberry Pi but lately I’m stumped. Can anyone help or is it now 64 bit only?

I would ask on the GitHub site, but there’s a ‘no spoon feeding here’ comment in the README.


Thanks,

Al.
Hi Al,

I got it working thanks to a little help from Martin ...

pseudo bench go depth 18

Code: Select all

mike@PicoChess:~/Demolito-master-3 $ ./demolito
uci
id name Demolito 11262018
id author lucasart
option name UCI_Chess960 type check default false
option name Hash type spin default 1 min 1 max 1048576
option name Threads type spin default 1 min 1 max 63
option name Contempt type spin default 10 min -100 max 100
option name Time Buffer type spin default 60 min 0 max 1000
uciok
ucinewgame
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
go depth 18
info depth 1 score cp 48 time 1 nodes 21 pv e2e4
info depth 2 score cp 6 time 2 nodes 153 pv e2e4 g8f6
info depth 3 score cp 37 time 4 nodes 325 pv e2e4 e7e6 b1c3
info depth 4 score cp 8 time 7 nodes 660 pv b1c3 e7e6 e2e3 b8c6
info depth 5 score cp 37 time 12 nodes 1301 pv b1c3 b8c6 e2e3 e7e6 d2d4
info depth 6 score cp 8 time 31 nodes 3280 pv b1c3 e7e6 e2e3 b8c6 d2d4 d7d5
info depth 7 score cp 34 time 53 nodes 5490 pv b1c3 e7e6 e2e3 b8c6 d2d4 d7d5 f1b5
info depth 8 score cp 27 time 118 nodes 12006 pv b1c3 e7e6 e2e3 b8c6 d2d4 d7d5 f1e2 g8f6 a2a3
info depth 9 score cp 21 time 262 nodes 40498 pv d2d4 d7d5 b1c3 e7e6 g1f3 c8d7 c1f4 g8f6 f3e5 f8b4
info depth 10 score cp 28 time 455 nodes 84495 pv d2d4 d7d5 b1c3 b8c6 e2e3 e7e6 g1f3 f8b4 f1d3 b4c3 b2c3 g8f6
info depth 11 score cp 28 time 544 nodes 105018 pv d2d4 d7d5 b1c3 b8c6 e2e3 e7e6 g1f3 f8b4 f1d3 b4c3 b2c3 g8f6
info depth 12 score cp 24 time 786 nodes 160571 pv d2d4 d7d5 b1c3 b8c6 g1f3 c8f5 e2e3 g8f6 f3e5 c6b4 f1d3 b4d3 c2d3 c7c6
info depth 13 score cp 29 time 1835 nodes 398754 pv e2e4 g8f6 b1c3 e7e5 g1f3 b8c6 d2d4 e5d4 f3d4 f8b4 c1g5 b4c3 b2c3 e8g8
info depth 14 score cp 21 time 5674 nodes 1248211 pv d2d4 d7d5 b1c3 g8f6 c1f4 b8c6 e2e3 e7e6 f1d3 f8e7 g1f3 c8d7 e1g1 e8g8
info depth 15 score cp 21 time 6464 nodes 1423638 pv d2d4 d7d5 g1f3 g8f6 e2e3 b8c6 b1c3 e7e6 f1d3 f8d6 e1g1 e8g8 c1d2 c8d7 a2a3
info depth 16 score cp 19 time 8112 nodes 1795142 pv d2d4 d7d5 b1c3 g8f6 c1f4 e7e6 e2e3 f8d6 g1h3 e8g8 f4d6 c7d6 f1e2 b8c6 e1g1 c8d7 h3f4
info depth 17 score cp 17 time 15057 nodes 3388735 pv d2d4 d7d5 b1c3 g8f6 c1f4 e7e6 e2e3 b8c6 f1d3 f8d6 f4d6 c7d6 g1e2 e8g8 e1g1 c8d7 e2f4
info depth 18 score cp 14 time 26187 nodes 5948210 pv d2d4 d7d5 b1c3 g8f6 c1f4 e7e6 e2e3 b8c6 g1f3 f6h5 f1b5 h5f4 e3f4 c8d7 b5c6 d7c6 e1g1 f8d6 f3e5 e8g8 e5c6 b7c6
bestmove d2d4
use this for the makefile, type "make pi" or 'make -j4 pi" for a faster build , I hard coded the date in for version, you may not have to do that ( go back to original makefile for version code):

Code: Select all

# Compiler
# Linux: clang or gcc
# Linux->Windows cross: x86_64-w64-mingw32-gcc
# Linux->Android cross: arm-linux-gnueabihf-gcc -fPIE
CC = gcc

# Compilation flags
CF = -std=gnu11 -DNDEBUG -O2 -Wfatal-errors -Wall -Wextra -Wshadow -flto

# Linking flags
LF =  -lm -lpthread

# Output file name (add .exe for Windows)
OUT = demolito

# Automatic versioning: ISO format date YYYY-MM-DD from the last commit
VERSION = 11262018

all:
	$(CC) -march=native -DPEXT $(CF) -DVERSION=\"$(VERSION)\" ./src/*.c -o $(OUT) $(LF)

popcnt:
	$(CC) -mpopcnt $(CF) -DVERSION=\"$(VERSION)\" ./src/*.c -o $(OUT)_popcnt -static $(LF)

pext:
	$(CC) -mpopcnt -mbmi2 -DPEXT $(CF) -DVERSION=\"$(VERSION)\" ./src/*.c -o $(OUT)_pext -static $(LF)
pi:
	$(CC) $(CF) -DVERSION=\"$(VERSION)\" ./src/*.c -o $(OUT)  -march=armv8-a+crc -mfpu=neon-vfpv4 -mtune=cortex-a53 -ftree-vectorize -mfloat-abi=hard -O3 $(LF)

clean:
	rm $(OUT)
Image
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Compile Demolito on a Raspberry Pi?

Post by lucasart »

MikeB wrote: Tue Nov 27, 2018 1:19 am

Code: Select all

$(CC) $(CF) -DVERSION=\"$(VERSION)\" ./src/*.c -o $(OUT)  -march=armv8-a+crc -mfpu=neon-vfpv4 -mtune=cortex-a53 -ftree-vectorize -mfloat-abi=hard -O3 $(LF)
All of this seems completely gratuitous:
-mfpu=neon-vfpv4 -mtune=cortex-a53 -ftree-vectorize -mfloat-abi=hard

And I doubt this will work for a 32-bit PI:
-march=armv8-a+crc

ARM V8 = 64 bit ARM.

All the OP has to do is correct the march parameter, to whether matches his PI.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Compile Demolito on a Raspberry Pi?

Post by MikeB »

lucasart wrote: Tue Nov 27, 2018 2:22 am
MikeB wrote: Tue Nov 27, 2018 1:19 am

Code: Select all

$(CC) $(CF) -DVERSION=\"$(VERSION)\" ./src/*.c -o $(OUT)  -march=armv8-a+crc -mfpu=neon-vfpv4 -mtune=cortex-a53 -ftree-vectorize -mfloat-abi=hard -O3 $(LF)
All of this seems completely gratuitous:
-mfpu=neon-vfpv4 -mtune=cortex-a53 -ftree-vectorize -mfloat-abi=hard

And I doubt this will work for a 32-bit PI:
-march=armv8-a+crc

ARM V8 = 64 bit ARM.

All the OP has to do is correct the march parameter, to whether matches his PI.
It works , may be gratuitous in the sense that the speed up is very small. I am familiar with Al's Revelation Pi - so I already know it will work for him :)

https://www.raspberrypi.org/forums/view ... p?t=144115

So at the end of the day , it was your comment that was not necessary, appropriate, or justified . i.e, it was gratuitous ;)
Image
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Compile Demolito on a Raspberry Pi?

Post by lucasart »

MikeB wrote: Tue Nov 27, 2018 5:37 am
lucasart wrote: Tue Nov 27, 2018 2:22 am
MikeB wrote: Tue Nov 27, 2018 1:19 am

Code: Select all

$(CC) $(CF) -DVERSION=\"$(VERSION)\" ./src/*.c -o $(OUT)  -march=armv8-a+crc -mfpu=neon-vfpv4 -mtune=cortex-a53 -ftree-vectorize -mfloat-abi=hard -O3 $(LF)
All of this seems completely gratuitous:
-mfpu=neon-vfpv4 -mtune=cortex-a53 -ftree-vectorize -mfloat-abi=hard

And I doubt this will work for a 32-bit PI:
-march=armv8-a+crc

ARM V8 = 64 bit ARM.

All the OP has to do is correct the march parameter, to whether matches his PI.
It works , may be gratuitous in the sense that the speed up is very small. I am familiar with Al's Revelation Pi - so I already know it will work for him :)

https://www.raspberrypi.org/forums/view ... p?t=144115

So at the end of the day , it was your comment that was not necessary, appropriate, or justified . i.e, it was gratuitous ;)
So you found an internet forum, where clueless noobs exchange magical commands to Ctrl+V without understanding, like performing pagan rituals.

I think you should try a Hakka dance before cross compiling, it should give you a small speedup. If it doesn't, perhaps sacrificing a chicken should do it.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Compile Demolito on a Raspberry Pi?

Post by MikeB »

lucasart wrote: Tue Nov 27, 2018 6:17 am
MikeB wrote: Tue Nov 27, 2018 5:37 am
lucasart wrote: Tue Nov 27, 2018 2:22 am
MikeB wrote: Tue Nov 27, 2018 1:19 am

Code: Select all

$(CC) $(CF) -DVERSION=\"$(VERSION)\" ./src/*.c -o $(OUT)  -march=armv8-a+crc -mfpu=neon-vfpv4 -mtune=cortex-a53 -ftree-vectorize -mfloat-abi=hard -O3 $(LF)
All of this seems completely gratuitous:
-mfpu=neon-vfpv4 -mtune=cortex-a53 -ftree-vectorize -mfloat-abi=hard

And I doubt this will work for a 32-bit PI:
-march=armv8-a+crc

ARM V8 = 64 bit ARM.

All the OP has to do is correct the march parameter, to whether matches his PI.
It works , may be gratuitous in the sense that the speed up is very small. I am familiar with Al's Revelation Pi - so I already know it will work for him :)

https://www.raspberrypi.org/forums/view ... p?t=144115

So at the end of the day , it was your comment that was not necessary, appropriate, or justified . i.e, it was gratuitous ;)
So you found an internet forum, where clueless noobs exchange magical commands to Ctrl+V without understanding, like performing pagan rituals.

I think you should try a Hakka dance before cross compiling, it should give you a small speedup. If it doesn't, perhaps sacrificing a chicken should do it.
Your true colors are now displayed and it rhymes with Bass Soul - take a chill pill - you started it and I will end it - time for you to go home to momma, you just peed your pants - what a douchebag. F****** A******. I was trying to be nice with smileys , but you are so f****** clueless. I hope you feel better :D
Image
User avatar
Scally
Posts: 232
Joined: Thu Sep 28, 2017 9:34 pm
Location: Bermondsey, London
Full name: Alan Cooper

Re: Compile Demolito on a Raspberry Pi?

Post by Scally »

Thanks Guys

Al.