Compiling Crafty

Code, algorithms, languages, construction...
Post Reply
quantum
Posts: 28
Joined: Mon Dec 19, 2011 12:19 am

Compiling Crafty

Post by quantum » Tue Dec 29, 2015 12:27 pm

I grabbed a Makefile from Stockfish and adapted it to Crafty.
For example type

make profile-build ARCH=x86-64-modern COMP=gcc cpus=16

to make a build that is able to run with 16 cpus.

Unfortunately I run into some troubles.

On both, Linux and Windows the bench command returns 169405499 for gcc which is as expected.
Clang gives me 230583383.

I added a numa switch to the Makefile to quickly enable -DNUMA it.

Code: Select all

main.c:4309:5: error: too many arguments to function ‘numa_node_to_cpus’
     numa_node_to_cpus(0, cpus, 64);
Does this mean that I need a Numa machine to use this switch?

When I try to enable more than 1 cpu on Windows (mingw-5.2) it fails with the following errors:

Code: Select all

make build ARCH=x86-64-modern cpus=4 COMP=mingw
make ARCH=x86-64-modern COMP=mingw config-sanity
make[1]: Entering directory `/c/Users/quantum/Desktop/crafty-25.0-1'

Config:
debug: 'no'
optimize: 'yes'
arch: 'x86_64'
prefetch: 'yes'
popcnt: 'yes'
sse: 'yes'
asm: 'yes'
cpus: '4'
numa: 'no'

Flags:
CC: gcc
CFLAGS: -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4
LDFLAGS:  -static

Testing config sanity. If this fails, try 'make help' ...

make[1]: Leaving directory `/c/Users/quantum/Desktop/crafty-25.0-1'
make ARCH=x86-64-modern COMP=mingw all
make[1]: Entering directory `/c/Users/quantum/Desktop/crafty-25.0-1'
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o main.o main.c
In file included from chess.h:77:0,
                 from main.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o iterate.o iterate.c
In file included from chess.h:77:0,
                 from iterate.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
iterate.c: In function 'Iterate':
iterate.c:248:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
           NumaStartThread(ThreadInit, (void *) proc);
                                       ^
In file included from iterate.c:1:0:
iterate.c:677:28: warning: implicit declaration of function 'PopCnt' [-Wimplicit-function-declaration]
             max = Max(max, PopCnt(thread[i].max_blocks));
                            ^
chess.h:538:30: note: in definition of macro 'Max'
 #  define Max(a,b)  (((a) > (b)) ? (a) : (b))
                              ^
iterate.c:55:13: warning: unused variable 'pt' [-Wunused-variable]
   pthread_t pt;
             ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o time.o time.c
In file included from chess.h:77:0,
                 from time.c:2:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o search.o search.c
In file included from chess.h:77:0,
                 from search.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o quiesce.o quiesce.c
In file included from chess.h:77:0,
                 from quiesce.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o evaluate.o evaluate.c
In file included from chess.h:77:0,
                 from evaluate.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
evaluate.c: In function 'EvaluateBishops':
evaluate.c:346:14: warning: implicit declaration of function 'LSB' [-Wimplicit-function-declaration]
     square = LSB(temp);
              ^
evaluate.c:385:18: warning: implicit declaration of function 'PopCnt' [-Wimplicit-function-declaration]
         tpawns = PopCnt(dark_squares & Pawns(side));
                  ^
In file included from evaluate.c:1:0:
evaluate.c: In function 'EvaluateKingsFile':
chess.h:574:49: warning: implicit declaration of function 'MSB' [-Wimplicit-function-declaration]
 #  define MostAdvanced(side, squares) ((side) ? MSB(squares) : LSB(squares))
                                                 ^
chess.h:571:28: note: in definition of macro 'Rank'
 #  define Rank(x)        ((x)>>3)
                            ^
evaluate.c:716:37: note: in expansion of macro 'MostAdvanced'
             pawn_defects[side][Rank(MostAdvanced(enemy,
                                     ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o thread.o thread.c
In file included from chess.h:77:0,
                 from thread.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
thread.c: In function 'ThreadSplit':
thread.c:479:14: warning: implicit declaration of function 'LSB' [-Wimplicit-function-declaration]
       temp = LSB(tblocks);
              ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o repeat.o repeat.c
In file included from chess.h:77:0,
                 from repeat.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o hash.o hash.c
In file included from chess.h:77:0,
                 from hash.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o next.o next.c
In file included from chess.h:77:0,
                 from next.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o history.o history.c
In file included from chess.h:77:0,
                 from history.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o movgen.o movgen.c
In file included from chess.h:77:0,
                 from movgen.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
In file included from movgen.c:1:0:
movgen.c: In function 'GenerateCaptures':
chess.h:574:49: warning: implicit declaration of function 'MSB' [-Wimplicit-function-declaration]
 #  define MostAdvanced(side, squares) ((side) ? MSB(squares) : LSB(squares))
                                                 ^
movgen.c:32:12: note: in expansion of macro 'MostAdvanced'
     from = MostAdvanced(side, piecebd);
            ^
chess.h:574:64: warning: implicit declaration of function 'LSB' [-Wimplicit-function-declaration]
 #  define MostAdvanced(side, squares) ((side) ? MSB(squares) : LSB(squares))
                                                                ^
movgen.c:32:12: note: in expansion of macro 'MostAdvanced'
     from = MostAdvanced(side, piecebd);
            ^
movgen.c: In function 'GenerateCheckEvasions':
movgen.c:497:14: warning: implicit declaration of function 'PopCnt' [-Wimplicit-function-declaration]
   checkers = PopCnt(checksqs);
              ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o make.o make.c
In file included from chess.h:77:0,
                 from make.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o unmake.o unmake.c
In file included from chess.h:77:0,
                 from unmake.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o attacks.o attacks.c
In file included from chess.h:77:0,
                 from attacks.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
attacks.c: In function 'Attacked':
attacks.c:108:14: warning: implicit declaration of function 'LSB' [-Wimplicit-function-declaration]
     square = LSB(set);
              ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o swap.o swap.c
In file included from chess.h:77:0,
                 from swap.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o boolean.o boolean.c
In file included from chess.h:77:0,
                 from boolean.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o utility.o utility.c
In file included from chess.h:77:0,
                 from utility.c:4:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
utility.c: In function 'ReadClock':
utility.c:1425:12: warning: unused variable 'tUser64' [-Wunused-variable]
   uint64_t tUser64;
            ^
utility.c:1424:40: warning: unused variable 'ftUser' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                                        ^
utility.c:1424:30: warning: unused variable 'ftKernel' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                              ^
utility.c:1424:22: warning: unused variable 'ftExit' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                      ^
utility.c:1424:12: warning: unused variable 'ftCreate' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
            ^
utility.c:1423:10: warning: unused variable 'hThread' [-Wunused-variable]
   HANDLE hThread;
          ^
utility.c: In function 'InvalidPosition':
utility.c:1465:8: warning: implicit declaration of function 'PopCnt' [-Wimplicit-function-declaration]
   wp = PopCnt(Pawns(white));
        ^
utility.c: In function 'WinNumaInit':
utility.c:2702:16: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
         printf("System is NUMA. %d nodes reported by Windows\n",
                ^
utility.c:2707:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
           printf("Node %d CPUs: ", ulNode);
                  ^
utility.c:2715:24: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
                 printf("%d ", ulCPU);
                        ^
utility.c:2727:16: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
         printf("Current ideal CPU is %u\n", dwCPU);
                ^
utility.c:2733:22: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
               printf("Exchanging nodes 0 and %d\n", ulNode);
                      ^
utility.c:2679:13: warning: unused variable 'dwMask' [-Wunused-variable]
   DWORD_PTR dwMask;
             ^
utility.c: In function 'NumaStartThread':
utility.c:2760:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
     printf("Starting thread on node %d CPU mask %I64d\n", ulNumaNode,
            ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o probe.o probe.c
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o book.o book.c
In file included from chess.h:77:0,
                 from book.c:2:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o drawn.o drawn.c
In file included from chess.h:77:0,
                 from drawn.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o epd.o epd.c
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o epdglue.o epdglue.c
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o init.o init.c
In file included from chess.h:77:0,
                 from init.c:3:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
init.c: In function 'Initialize':
init.c:67:22: warning: overflow in implicit constant conversion [-Woverflow]
     fseek(book_file, -sizeof(int), SEEK_END);
                      ^
init.c:22:7: warning: unused variable 'i' [-Wunused-variable]
   int i, j, v, major, id;
       ^
init.c: In function 'InitializeAttackBoards':
init.c:310:11: warning: implicit declaration of function 'LSB' [-Wimplicit-function-declaration]
       j = LSB(sqs);
           ^
init.c: In function 'InitializeMagic':
init.c:432:14: warning: implicit declaration of function 'PopCnt' [-Wimplicit-function-declaration]
         m += PopCnt(moves & mobility_mask_b[j]) * mobility_score_b[j];
              ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o input.o input.c
In file included from chess.h:77:0,
                 from input.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o autotune.o autotune.c
In file included from chess.h:77:0,
                 from autotune.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o interrupt.o interrupt.c
In file included from chess.h:77:0,
                 from interrupt.c:2:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o option.o option.c
In file included from chess.h:77:0,
                 from option.c:3:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
option.c: In function 'Option':
option.c:929:36: warning: implicit declaration of function 'MSB' [-Wimplicit-function-declaration]
       hash_table_size = ((1ull) << MSB(new_hash_size)) / 16;
                                    ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o output.o output.c
In file included from chess.h:77:0,
                 from output.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o ponder.o ponder.c
In file included from chess.h:77:0,
                 from ponder.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o resign.o resign.c
In file included from chess.h:77:0,
                 from resign.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o root.o root.c
In file included from chess.h:77:0,
                 from root.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
root.c: In function 'RootMoveList':
root.c:18:7: warning: unused variable 'temp' [-Wunused-variable]
   int temp, value;
       ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o learn.o learn.c
In file included from chess.h:77:0,
                 from learn.c:3:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o setboard.o setboard.c
In file included from chess.h:77:0,
                 from setboard.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o test.o test.c
In file included from chess.h:77:0,
                 from test.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o validate.o validate.c
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o annotate.o annotate.c
In file included from chess.h:77:0,
                 from annotate.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o analyze.o analyze.c
In file included from chess.h:77:0,
                 from analyze.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o evtest.o evtest.c
In file included from chess.h:77:0,
                 from evtest.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o bench.o bench.c
In file included from chess.h:77:0,
                 from bench.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o edit.o edit.c
In file included from chess.h:77:0,
                 from edit.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o data.o data.c
In file included from chess.h:77:0,
                 from data.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
g++ -o crafty main.o iterate.o time.o search.o quiesce.o evaluate.o thread.o repeat.o hash.o next.o history.o movgen.o make.o unmake.o attacks.o swap.o boolean.o utility.o probe.o book.o drawn.o epd.o epdglue.o init.o input.o autotune.o interrupt.o option.o output.o ponder.o resign.o root.o learn.o setboard.o test.o validate.o annotate.o analyze.o evtest.o bench.o edit.o data.o  -static
iterate.o:iterate.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
time.o:time.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
search.o:search.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
quiesce.o:quiesce.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
evaluate.o:evaluate.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
thread.o:thread.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
repeat.o:repeat.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
hash.o:hash.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
next.o:next.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
history.o:history.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
movgen.o:movgen.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
make.o:make.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
unmake.o:unmake.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
attacks.o:attacks.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
swap.o:swap.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
boolean.o:boolean.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
utility.o:utility.c:(.text+0x450): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
book.o:book.c:(.text+0x20): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
drawn.o:drawn.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
init.o:init.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
input.o:input.c:(.text+0x490): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
autotune.o:autotune.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
interrupt.o:interrupt.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
option.o:option.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
output.o:output.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
ponder.o:ponder.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
resign.o:resign.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
root.o:root.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
learn.o:learn.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
setboard.o:setboard.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
test.o:test.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
annotate.o:annotate.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
analyze.o:analyze.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
evtest.o:evtest.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
bench.o:bench.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
edit.o:edit.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
data.o:data.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make[1]: *** [crafty] Error 1
make[1]: Leaving directory `/c/Users/quantum/Desktop/crafty-25.0-1'
make: *** [build] Error 2
So I wonder if there is something wrong with my Makefile or with crafty itself?
Attachments
Makefile_remove_zip.zip
(13.13 KiB) Downloaded 301 times

hyatt
Posts: 1242
Joined: Thu Jun 10, 2010 2:13 am
Real Name: Bob Hyatt (Robert M. Hyatt)
Location: University of Alabama at Birmingham
Contact:

Re: Compiling Crafty

Post by hyatt » Wed Dec 30, 2015 12:03 am

quantum wrote:I grabbed a Makefile from Stockfish and adapted it to Crafty.
For example type

make profile-build ARCH=x86-64-modern COMP=gcc cpus=16

to make a build that is able to run with 16 cpus.

Unfortunately I run into some troubles.

On both, Linux and Windows the bench command returns 169405499 for gcc which is as expected.
Clang gives me 230583383.
DO you have a .craftyrc file? If so, comment out the "hash=" line by putting a "#" on the front. If you change the hash size, it will change the nodes.


I added a numa switch to the Makefile to quickly enable -DNUMA it.

Code: Select all

main.c:4309:5: error: too many arguments to function ‘numa_node_to_cpus’
     numa_node_to_cpus(0, cpus, 64);
Does this mean that I need a Numa machine to use this switch?
You should not use it without a NUMA box. In your case, there appears to be a change in libnuma somewhere along the way that has changed the number of arguments. I thought I had fixed this, which might mean you have an old version of libnuma. I will try to confirm.


When I try to enable more than 1 cpu on Windows (mingw-5.2) it fails with the following errors:

Code: Select all

make build ARCH=x86-64-modern cpus=4 COMP=mingw
make ARCH=x86-64-modern COMP=mingw config-sanity
make[1]: Entering directory `/c/Users/quantum/Desktop/crafty-25.0-1'

Config:
debug: 'no'
optimize: 'yes'
arch: 'x86_64'
prefetch: 'yes'
popcnt: 'yes'
sse: 'yes'
asm: 'yes'
cpus: '4'
numa: 'no'

Flags:
CC: gcc
CFLAGS: -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4
LDFLAGS:  -static

Testing config sanity. If this fails, try 'make help' ...

make[1]: Leaving directory `/c/Users/quantum/Desktop/crafty-25.0-1'
make ARCH=x86-64-modern COMP=mingw all
make[1]: Entering directory `/c/Users/quantum/Desktop/crafty-25.0-1'
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o main.o main.c
In file included from chess.h:77:0,
                 from main.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o iterate.o iterate.c
In file included from chess.h:77:0,
                 from iterate.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
iterate.c: In function 'Iterate':
iterate.c:248:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
           NumaStartThread(ThreadInit, (void *) proc);
                                       ^
In file included from iterate.c:1:0:
iterate.c:677:28: warning: implicit declaration of function 'PopCnt' [-Wimplicit-function-declaration]
             max = Max(max, PopCnt(thread[i].max_blocks));
                            ^
chess.h:538:30: note: in definition of macro 'Max'
 #  define Max(a,b)  (((a) > (b)) ? (a) : (b))
                              ^
iterate.c:55:13: warning: unused variable 'pt' [-Wunused-variable]
   pthread_t pt;
             ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o time.o time.c
In file included from chess.h:77:0,
                 from time.c:2:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o search.o search.c
In file included from chess.h:77:0,
                 from search.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o quiesce.o quiesce.c
In file included from chess.h:77:0,
                 from quiesce.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o evaluate.o evaluate.c
In file included from chess.h:77:0,
                 from evaluate.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
evaluate.c: In function 'EvaluateBishops':
evaluate.c:346:14: warning: implicit declaration of function 'LSB' [-Wimplicit-function-declaration]
     square = LSB(temp);
              ^
evaluate.c:385:18: warning: implicit declaration of function 'PopCnt' [-Wimplicit-function-declaration]
         tpawns = PopCnt(dark_squares & Pawns(side));
                  ^
In file included from evaluate.c:1:0:
evaluate.c: In function 'EvaluateKingsFile':
chess.h:574:49: warning: implicit declaration of function 'MSB' [-Wimplicit-function-declaration]
 #  define MostAdvanced(side, squares) ((side) ? MSB(squares) : LSB(squares))
                                                 ^
chess.h:571:28: note: in definition of macro 'Rank'
 #  define Rank(x)        ((x)>>3)
                            ^
evaluate.c:716:37: note: in expansion of macro 'MostAdvanced'
             pawn_defects[side][Rank(MostAdvanced(enemy,
                                     ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o thread.o thread.c
In file included from chess.h:77:0,
                 from thread.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
thread.c: In function 'ThreadSplit':
thread.c:479:14: warning: implicit declaration of function 'LSB' [-Wimplicit-function-declaration]
       temp = LSB(tblocks);
              ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o repeat.o repeat.c
In file included from chess.h:77:0,
                 from repeat.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o hash.o hash.c
In file included from chess.h:77:0,
                 from hash.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o next.o next.c
In file included from chess.h:77:0,
                 from next.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o history.o history.c
In file included from chess.h:77:0,
                 from history.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o movgen.o movgen.c
In file included from chess.h:77:0,
                 from movgen.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
In file included from movgen.c:1:0:
movgen.c: In function 'GenerateCaptures':
chess.h:574:49: warning: implicit declaration of function 'MSB' [-Wimplicit-function-declaration]
 #  define MostAdvanced(side, squares) ((side) ? MSB(squares) : LSB(squares))
                                                 ^
movgen.c:32:12: note: in expansion of macro 'MostAdvanced'
     from = MostAdvanced(side, piecebd);
            ^
chess.h:574:64: warning: implicit declaration of function 'LSB' [-Wimplicit-function-declaration]
 #  define MostAdvanced(side, squares) ((side) ? MSB(squares) : LSB(squares))
                                                                ^
movgen.c:32:12: note: in expansion of macro 'MostAdvanced'
     from = MostAdvanced(side, piecebd);
            ^
movgen.c: In function 'GenerateCheckEvasions':
movgen.c:497:14: warning: implicit declaration of function 'PopCnt' [-Wimplicit-function-declaration]
   checkers = PopCnt(checksqs);
              ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o make.o make.c
In file included from chess.h:77:0,
                 from make.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o unmake.o unmake.c
In file included from chess.h:77:0,
                 from unmake.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o attacks.o attacks.c
In file included from chess.h:77:0,
                 from attacks.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
attacks.c: In function 'Attacked':
attacks.c:108:14: warning: implicit declaration of function 'LSB' [-Wimplicit-function-declaration]
     square = LSB(set);
              ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o swap.o swap.c
In file included from chess.h:77:0,
                 from swap.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o boolean.o boolean.c
In file included from chess.h:77:0,
                 from boolean.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o utility.o utility.c
In file included from chess.h:77:0,
                 from utility.c:4:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
utility.c: In function 'ReadClock':
utility.c:1425:12: warning: unused variable 'tUser64' [-Wunused-variable]
   uint64_t tUser64;
            ^
utility.c:1424:40: warning: unused variable 'ftUser' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                                        ^
utility.c:1424:30: warning: unused variable 'ftKernel' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                              ^
utility.c:1424:22: warning: unused variable 'ftExit' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
                      ^
utility.c:1424:12: warning: unused variable 'ftCreate' [-Wunused-variable]
   FILETIME ftCreate, ftExit, ftKernel, ftUser;
            ^
utility.c:1423:10: warning: unused variable 'hThread' [-Wunused-variable]
   HANDLE hThread;
          ^
utility.c: In function 'InvalidPosition':
utility.c:1465:8: warning: implicit declaration of function 'PopCnt' [-Wimplicit-function-declaration]
   wp = PopCnt(Pawns(white));
        ^
utility.c: In function 'WinNumaInit':
utility.c:2702:16: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
         printf("System is NUMA. %d nodes reported by Windows\n",
                ^
utility.c:2707:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
           printf("Node %d CPUs: ", ulNode);
                  ^
utility.c:2715:24: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
                 printf("%d ", ulCPU);
                        ^
utility.c:2727:16: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
         printf("Current ideal CPU is %u\n", dwCPU);
                ^
utility.c:2733:22: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
               printf("Exchanging nodes 0 and %d\n", ulNode);
                      ^
utility.c:2679:13: warning: unused variable 'dwMask' [-Wunused-variable]
   DWORD_PTR dwMask;
             ^
utility.c: In function 'NumaStartThread':
utility.c:2760:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
     printf("Starting thread on node %d CPU mask %I64d\n", ulNumaNode,
            ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o probe.o probe.c
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o book.o book.c
In file included from chess.h:77:0,
                 from book.c:2:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o drawn.o drawn.c
In file included from chess.h:77:0,
                 from drawn.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o epd.o epd.c
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o epdglue.o epdglue.c
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o init.o init.c
In file included from chess.h:77:0,
                 from init.c:3:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
init.c: In function 'Initialize':
init.c:67:22: warning: overflow in implicit constant conversion [-Woverflow]
     fseek(book_file, -sizeof(int), SEEK_END);
                      ^
init.c:22:7: warning: unused variable 'i' [-Wunused-variable]
   int i, j, v, major, id;
       ^
init.c: In function 'InitializeAttackBoards':
init.c:310:11: warning: implicit declaration of function 'LSB' [-Wimplicit-function-declaration]
       j = LSB(sqs);
           ^
init.c: In function 'InitializeMagic':
init.c:432:14: warning: implicit declaration of function 'PopCnt' [-Wimplicit-function-declaration]
         m += PopCnt(moves & mobility_mask_b[j]) * mobility_score_b[j];
              ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o input.o input.c
In file included from chess.h:77:0,
                 from input.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o autotune.o autotune.c
In file included from chess.h:77:0,
                 from autotune.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o interrupt.o interrupt.c
In file included from chess.h:77:0,
                 from interrupt.c:2:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o option.o option.c
In file included from chess.h:77:0,
                 from option.c:3:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
option.c: In function 'Option':
option.c:929:36: warning: implicit declaration of function 'MSB' [-Wimplicit-function-declaration]
       hash_table_size = ((1ull) << MSB(new_hash_size)) / 16;
                                    ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o output.o output.c
In file included from chess.h:77:0,
                 from output.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o ponder.o ponder.c
In file included from chess.h:77:0,
                 from ponder.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o resign.o resign.c
In file included from chess.h:77:0,
                 from resign.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o root.o root.c
In file included from chess.h:77:0,
                 from root.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
root.c: In function 'RootMoveList':
root.c:18:7: warning: unused variable 'temp' [-Wunused-variable]
   int temp, value;
       ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o learn.o learn.c
In file included from chess.h:77:0,
                 from learn.c:3:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o setboard.o setboard.c
In file included from chess.h:77:0,
                 from setboard.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o test.o test.c
In file included from chess.h:77:0,
                 from test.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o validate.o validate.c
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o annotate.o annotate.c
In file included from chess.h:77:0,
                 from annotate.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o analyze.o analyze.c
In file included from chess.h:77:0,
                 from analyze.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o evtest.o evtest.c
In file included from chess.h:77:0,
                 from evtest.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o bench.o bench.c
In file included from chess.h:77:0,
                 from bench.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o edit.o edit.c
In file included from chess.h:77:0,
                 from edit.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
gcc -Wall -Wno-array-bounds -pipe -DNOEGTB  -O3 -msse -msse3 -mpopcnt -DPOPCNT -DCPUS=4   -c -o data.o data.c
In file included from chess.h:77:0,
                 from data.c:1:
lock.h:18:0: warning: ignoring #pragma intrinsic  [-Wunknown-pragmas]
 #    pragma intrinsic (_InterlockedExchange)
 ^
g++ -o crafty main.o iterate.o time.o search.o quiesce.o evaluate.o thread.o repeat.o hash.o next.o history.o movgen.o make.o unmake.o attacks.o swap.o boolean.o utility.o probe.o book.o drawn.o epd.o epdglue.o init.o input.o autotune.o interrupt.o option.o output.o ponder.o resign.o root.o learn.o setboard.o test.o validate.o annotate.o analyze.o evtest.o bench.o edit.o data.o  -static
iterate.o:iterate.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
time.o:time.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
search.o:search.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
quiesce.o:quiesce.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
evaluate.o:evaluate.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
thread.o:thread.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
repeat.o:repeat.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
hash.o:hash.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
next.o:next.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
history.o:history.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
movgen.o:movgen.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
make.o:make.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
unmake.o:unmake.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
attacks.o:attacks.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
swap.o:swap.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
boolean.o:boolean.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
utility.o:utility.c:(.text+0x450): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
book.o:book.c:(.text+0x20): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
drawn.o:drawn.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
init.o:init.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
input.o:input.c:(.text+0x490): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
autotune.o:autotune.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
interrupt.o:interrupt.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
option.o:option.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
output.o:output.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
ponder.o:ponder.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
resign.o:resign.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
root.o:root.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
learn.o:learn.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
setboard.o:setboard.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
test.o:test.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
annotate.o:annotate.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
analyze.o:analyze.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
evtest.o:evtest.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
bench.o:bench.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
edit.o:edit.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
data.o:data.c:(.text+0x0): multiple definition of `Pause'
main.o:main.c:(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make[1]: *** [crafty] Error 1
make[1]: Leaving directory `/c/Users/quantum/Desktop/crafty-25.0-1'
make: *** [build] Error 2
So I wonder if there is something wrong with my Makefile or with crafty itself?
Why are you trying to use the stockfish Makefile? The standard Makefile should work flawlessly.

"make unix-clang" ought to work perfectly. Or even better, if you use the Makefile that is included, just "make profile", wait about 2 minutes, and you should be ready to go. At least on an apple OS X box. Otherwise use "make unix-gcc" which is significantly better than clang anyway...

For a unix box, you need -DUNIX as an option in your Makefile, but I am not sure of the advantage of using a foreign Makefile, it leads to exactly these kinds of problems...

quantum
Posts: 28
Joined: Mon Dec 19, 2011 12:19 am

Re: Compiling Crafty

Post by quantum » Wed Dec 30, 2015 7:39 pm

Thanks for your reply.

I basically switched to another Makefile because I feel more comfortable with it.

This version of libnuma is on my system.

libnuma-dev:amd64 2.0.10-1ubuntu6 amd64 Development files for libnuma

I could enable multible cpus on Windows, after I activated -DINLINEASM for mingw, too.

The incorrect nodecount with clang comes from: http://talkchess.com/forum/viewtopic.ph ... &start=130

Looking forward to see some games of this new crafty. :)

hyatt
Posts: 1242
Joined: Thu Jun 10, 2010 2:13 am
Real Name: Bob Hyatt (Robert M. Hyatt)
Location: University of Alabama at Birmingham
Contact:

Re: Compiling Crafty

Post by hyatt » Thu Dec 31, 2015 11:04 pm

I don't see a reference to clang with the link you gave. however, clang is what I use on my macbook (all development done here) and my office iMac...

Works fine for me..

hyatt
Posts: 1242
Joined: Thu Jun 10, 2010 2:13 am
Real Name: Bob Hyatt (Robert M. Hyatt)
Location: University of Alabama at Birmingham
Contact:

Re: Compiling Crafty

Post by hyatt » Thu Dec 31, 2015 11:23 pm

I did a quick check. It looks like libnuma changed again. Used to have to pass it an array of 64 bit ints, followed by a constant telling it the max node number possible. That apparently changed. You might just remove that as it is simply an informative message. I have fixed it in 25.1...

Post Reply