Error compiling Crafty

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

glorfindel

Error compiling Crafty

Post by glorfindel »

I cannot compile crafty 21.6 here

Code: Select all

christos@glorfindel ~/Desktop/crafty-21.6 $ make linux-amd64
make target=LINUX \
                CC=gcc CXX=g++ \
                CFLAGS=' -Wall -pipe \
                -fbranch-probabilities -fomit-frame-pointer -O3 -march=k8' \
                CXFLAGS= \
                LDFLAGS=' -lnuma -lstdc++' \
                opt=' -DINLINE64 -DCPUS=1' \
                crafty-make
make[1]: Entering directory `/home/christos/Desktop/crafty-21.6'
make[2]: Entering directory `/home/christos/Desktop/crafty-21.6'
g++ -c  -DINLINE64 -DCPUS=1 -DLINUX egtb.cpp
egtb.cpp:84: error: 'lock_t' does not name a type
egtb.cpp:4483: warning: 'TB_CRC_CHECK' initialized and declared 'extern'
make[2]: *** [egtb.o] Error 1
make[2]: Leaving directory `/home/christos/Desktop/crafty-21.6'
make[1]: *** [crafty-make] Error 2
make[1]: Leaving directory `/home/christos/Desktop/crafty-21.6'
make: *** [linux-amd64] Error 2
Any ideas?
Guetti

Re: Error compiling Crafty

Post by Guetti »

glorfindel wrote:I cannot compile crafty 21.6 here

Code: Select all

christos@glorfindel ~/Desktop/crafty-21.6 $ make linux-amd64
make target=LINUX \
                CC=gcc CXX=g++ \
                CFLAGS=' -Wall -pipe \
                -fbranch-probabilities -fomit-frame-pointer -O3 -march=k8' \
                CXFLAGS= \
                LDFLAGS=' -lnuma -lstdc++' \
                opt=' -DINLINE64 -DCPUS=1' \
                crafty-make
make[1]: Entering directory `/home/christos/Desktop/crafty-21.6'
make[2]: Entering directory `/home/christos/Desktop/crafty-21.6'
g++ -c  -DINLINE64 -DCPUS=1 -DLINUX egtb.cpp
egtb.cpp:84: error: 'lock_t' does not name a type
egtb.cpp:4483: warning: 'TB_CRC_CHECK' initialized and declared 'extern'
make[2]: *** [egtb.o] Error 1
make[2]: Leaving directory `/home/christos/Desktop/crafty-21.6'
make[1]: *** [crafty-make] Error 2
make[1]: Leaving directory `/home/christos/Desktop/crafty-21.6'
make: *** [linux-amd64] Error 2
Any ideas?

Yes, comment out line 84 in egtb.cpp. Put // at the beginning of the line.

There is also a problem with the makefile, as CFLAGS are not passed to g++ probably on a lot of systems (my two included). Just put the same flags after the CXFLAGS entry:

CXFLAGS=' -Wall -pipe \
-fbranch-probabilities -fomit-frame-pointer -O3 -march=k8' \