Crafty 22.7 : make fails for Ubuntu-64bit - assistance?

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

Moderator: Ras

royb
Posts: 572
Joined: Thu Mar 09, 2006 12:53 am

Crafty 22.7 : make fails for Ubuntu-64bit - assistance?

Post by royb »

I've tried to compile Crafty 22.2 onwards (including 22.7) and it always fails on my Ubuntu 64-bit system running 8.10 (Intrepid Ibex). Here is the output from my attempt at making this -- suggestions to get this to compile successfully are greatly appreciated:

roy@roy-laptop:~/chess/crafty/crafty-22.7$ make linux-amd64
make target=LINUX \
CC=gcc CXX=g++ \
CFLAGS=' -Wall -pipe \
-fbranch-probabilities -fomit-frame-pointer -O3 -march=k8' \
CXFLAGS= \
LDFLAGS=' -lpthread -lnuma -lstdc++' \
opt=' -DINLINE64 -DCPUS=8 -DNUMA -DLIBNUMA' \
crafty-make
make[1]: Entering directory `/home/roy/chess/crafty/crafty-22.7'
make[2]: Entering directory `/home/roy/chess/crafty/crafty-22.7'
gcc -Wall -pipe \
-fbranch-probabilities -fomit-frame-pointer -O3 -march=k8 -DINLINE64 -DCPUS=8 -DNUMA -DLIBNUMA -DLINUX -c crafty.c
In file included from crafty.c:21:
utility.c: In function ‘BookClusterIn’:
utility.c:71: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
utility.c: In function ‘BookClusterOut’:
utility.c:105: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
utility.c: In function ‘RestoreGame’:
utility.c:2340: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
In file included from crafty.c:23:
book.c: In function ‘Book’:
book.c:94: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c:98: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c:132: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c:137: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c: In function ‘BookPonderMove’:
book.c:834: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c:838: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c: In function ‘BookUp’:
book.c:1167: warning: format not a string literal and no format arguments
book.c:1349: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
book.c:1353: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
In file included from crafty.c:24:
analyze.c: In function ‘Analyze’:
analyze.c:148: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
In file included from crafty.c:33:
init.c: In function ‘Initialize’:
init.c:75: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
In file included from crafty.c:37:
learn.c: In function ‘LearnBook’:
learn.c:215: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
In file included from crafty.c:38:
main.c:9:20: error: numa.h: No such file or directory
In file included from crafty.c:38:
main.c: In function ‘main’:
main.c:3719: warning: implicit declaration of function ‘numa_available’
main.c:3722: warning: implicit declaration of function ‘numa_node_to_cpus’
main.c:3724: warning: implicit declaration of function ‘numa_max_node’
main.c:4001: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
main.c:4042: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
main.c:4054: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
main.c:4123: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
main.c:4148: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
In file included from crafty.c:39:
option.c: In function ‘Option’:
option.c:70: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
option.c:934: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
option.c:1278: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
option.c:1284: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
option.c:2648: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
option.c:2913: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
option.c:3770: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
In file included from crafty.c:43:
resign.c: In function ‘ResignOrDraw’:
resign.c:107: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
resign.c:128: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
make[2]: *** [crafty.o] Error 1
make[2]: Leaving directory `/home/roy/chess/crafty/crafty-22.7'
make[1]: *** [crafty-make] Error 2
make[1]: Leaving directory `/home/roy/chess/crafty/crafty-22.7'
make: *** [linux-amd64] Error 2
roy@roy-laptop:~/chess/crafty/crafty-22.7$

Thanks,

Roy
shiv
Posts: 351
Joined: Sat Apr 01, 2006 2:03 am

Re: Crafty 22.7 : make fails for Ubuntu-64bit - assistance?

Post by shiv »

royb wrote:I've tried to compile Crafty 22.2 onwards (including 22.7) and it always fails on my Ubuntu 64-bit system running 8.10 (Intrepid Ibex). Here is the output from my attempt at making this -- suggestions to get this to compile successfully are greatly appreciated:


In file included from crafty.c:38:
main.c:9:20: error: numa.h: No such file or directory
Thanks,

Roy
I had this problem before for all crafty's. You have to install the numa devel package (after which it should work). Forget the exact package name.
glorfindel

Re: Crafty 22.7 : make fails for Ubuntu-64bit - assistance?

Post by glorfindel »

This is the relevant portion of my Makefile

Code: Select all

linux-amd64:
        $(MAKE) target=LINUX \
                CC=gcc CXX=g++ \
                CFLAGS='$(CFLAGS) -Wall -pipe \
                -fbranch-probabilities -fomit-frame-pointer -O3 -march=k8' \
                CXFLAGS=$(CFLAGS) \
                LDFLAGS='$(LDFLAGS) -lpthread -lstdc++' \
                opt='$(opt) -DINLINE64 -DCPUS=4' \
                crafty-make
If the problem is really NUMA (as it was for me too) you don't have to install it. You can also try disabling it by removing the relevant parts in the Makefile as I have done. I don't know for sure which method of the two would be faster, but I have an SMP system and I guess that without NUMA I am at least as fast.

TIP: If you write a good makefile, keep it for the next versions too.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty 22.7 : make fails for Ubuntu-64bit - assistance?

Post by bob »

royb wrote:I've tried to compile Crafty 22.2 onwards (including 22.7) and it always fails on my Ubuntu 64-bit system running 8.10 (Intrepid Ibex). Here is the output from my attempt at making this -- suggestions to get this to compile successfully are greatly appreciated:

roy@roy-laptop:~/chess/crafty/crafty-22.7$ make linux-amd64
make target=LINUX \
CC=gcc CXX=g++ \
CFLAGS=' -Wall -pipe \
-fbranch-probabilities -fomit-frame-pointer -O3 -march=k8' \
CXFLAGS= \
LDFLAGS=' -lpthread -lnuma -lstdc++' \
opt=' -DINLINE64 -DCPUS=8 -DNUMA -DLIBNUMA' \
crafty-make
make[1]: Entering directory `/home/roy/chess/crafty/crafty-22.7'
make[2]: Entering directory `/home/roy/chess/crafty/crafty-22.7'
gcc -Wall -pipe \
-fbranch-probabilities -fomit-frame-pointer -O3 -march=k8 -DINLINE64 -DCPUS=8 -DNUMA -DLIBNUMA -DLINUX -c crafty.c
In file included from crafty.c:21:
utility.c: In function ‘BookClusterIn’:
utility.c:71: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
utility.c: In function ‘BookClusterOut’:
utility.c:105: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
utility.c: In function ‘RestoreGame’:
utility.c:2340: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
In file included from crafty.c:23:
book.c: In function ‘Book’:
book.c:94: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c:98: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c:132: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c:137: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c: In function ‘BookPonderMove’:
book.c:834: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c:838: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
book.c: In function ‘BookUp’:
book.c:1167: warning: format not a string literal and no format arguments
book.c:1349: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
book.c:1353: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
In file included from crafty.c:24:
analyze.c: In function ‘Analyze’:
analyze.c:148: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
In file included from crafty.c:33:
init.c: In function ‘Initialize’:
init.c:75: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
In file included from crafty.c:37:
learn.c: In function ‘LearnBook’:
learn.c:215: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
In file included from crafty.c:38:
main.c:9:20: error: numa.h: No such file or directory
In file included from crafty.c:38:
main.c: In function ‘main’:
main.c:3719: warning: implicit declaration of function ‘numa_available’
main.c:3722: warning: implicit declaration of function ‘numa_node_to_cpus’
main.c:3724: warning: implicit declaration of function ‘numa_max_node’
main.c:4001: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
main.c:4042: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
main.c:4054: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
main.c:4123: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
main.c:4148: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
In file included from crafty.c:39:
option.c: In function ‘Option’:
option.c:70: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
option.c:934: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
option.c:1278: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
option.c:1284: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
option.c:2648: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
option.c:2913: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
option.c:3770: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
In file included from crafty.c:43:
resign.c: In function ‘ResignOrDraw’:
resign.c:107: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
resign.c:128: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
make[2]: *** [crafty.o] Error 1
make[2]: Leaving directory `/home/roy/chess/crafty/crafty-22.7'
make[1]: *** [crafty-make] Error 2
make[1]: Leaving directory `/home/roy/chess/crafty/crafty-22.7'
make: *** [linux-amd64] Error 2
roy@roy-laptop:~/chess/crafty/crafty-22.7$

Thanks,

Roy
You don't want to use the AMD option, as you are probably not running an AMD NUMA box. If you are, you need libnuma installed. Otherwise, edit the Makefile and get rid of the NUMA option in that section of the file and it should work just fine...