Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To fix come compiling issues for MS Windows #8

Merged
merged 3 commits into from Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Makefile
Expand Up @@ -35,6 +35,8 @@
# -DNODES This enables the sn=x command. Crafty will search until
# exactly X nodes have been searched, then the search
# terminates as if time ran out.
# -DNO_INTRIN use this if your processor does not have builtin intrinsic
# instructions for bit operations (PopCnt and such)
# -DPOSITIONS Causes Crafty to emit FEN strings, one per book line, as
# it creates a book. I use this to create positions to use
# for cluster testing.
Expand Down Expand Up @@ -145,7 +147,7 @@ profile:
@mkdir prof
@touch *.c *.h
$(MAKE) -j unix-clang-profile
@echo "#!/bin/csh" > runprof
@echo "#!/bin/sh" > runprof
@echo "./crafty <<EOF" >>runprof
@echo "bench" >>runprof
@echo "mt=0" >>runprof
Expand All @@ -166,7 +168,7 @@ gcc-profile:
@mkdir prof
@touch *.c *.h
$(MAKE) -j unix-gcc-profile
@echo "#!/bin/csh" > runprof
@echo "#!/bin/sh" > runprof
@echo "./crafty <<EOF" >>runprof
@echo "bench" >>runprof
@echo "mt=0" >>runprof
Expand Down
208 changes: 0 additions & 208 deletions src/Makefile-mb

This file was deleted.

10 changes: 6 additions & 4 deletions src/Makefile-official
Expand Up @@ -35,6 +35,8 @@
# -DNODES This enables the sn=x command. Crafty will search until
# exactly X nodes have been searched, then the search
# terminates as if time ran out.
# -DNO_INTRIN use this if your processor does not have builtin intrinsic
# instructions for bit operations (PopCnt and such)
# -DPOSITIONS Causes Crafty to emit FEN strings, one per book line, as
# it creates a book. I use this to create positions to use
# for cluster testing.
Expand Down Expand Up @@ -77,7 +79,7 @@ quick:
$(MAKE) target=UNIX \
CC=clang \
opt='-DSYZYGY -DTEST -DTRACE -DCPUS=4' \
CFLAGS='-mpopcnt -Wall -Wno-array-bounds -pipe -O3' \
CFLAGS='-Wall -mpopcnt -Wno-array-bounds -pipe -O3' \
LDFLAGS='$(LDFLAGS) -lstdc++' \
crafty-make

Expand Down Expand Up @@ -145,7 +147,7 @@ profile:
@mkdir prof
@touch *.c *.h
$(MAKE) -j unix-clang-profile
@echo "#!/bin/csh" > runprof
@echo "#!/bin/sh" > runprof
@echo "./crafty <<EOF" >>runprof
@echo "bench" >>runprof
@echo "mt=0" >>runprof
Expand All @@ -169,7 +171,7 @@ profile:

#objects = 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 \
see.o tbprobe.o boolean.o utility.o book.o drawn.o epd.o \
see.o boolean.o utility.o book.o drawn.o epd.o tbprobe.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
Expand All @@ -186,7 +188,7 @@ crafty-make:
crafty.o: *.c *.h

crafty: $(objects)
$(CC) $(LDFLAGS) -g -o crafty $(objects) -lm $(LIBS)
$(CC) $(LDFLAGS) -o crafty $(objects) -lm $(LIBS)

evaluate.o: evaluate.h

Expand Down
2 changes: 1 addition & 1 deletion src/annotate.c
Expand Up @@ -556,7 +556,7 @@ void AnnotateFooterHTML(FILE * annotate_out) {
fprintf(annotate_out, "</BODY>\n");
fprintf(annotate_out, "</HTML>\n");
}
void AnnotatePositionHTML(TREE * RESTRICT tree, int wtm, FILE * annotate_out) {
void AnnotatePositionHTML(TREE *tree, int wtm, FILE * annotate_out) {
char filename[32], html_piece;
char alt[32];
int rank, file;
Expand Down
8 changes: 4 additions & 4 deletions src/attacks.c
Expand Up @@ -11,7 +11,7 @@
* *
*******************************************************************************
*/
int Attacks(TREE * RESTRICT tree, int side, int square) {
int Attacks(TREE *tree, int side, int square) {
if ((rook_attacks[square] & (Rooks(side) | Queens(side)))
&& (RookAttacks(square,
OccupiedSquares) & (Rooks(side) | Queens(side))))
Expand Down Expand Up @@ -43,7 +43,7 @@ int Attacks(TREE * RESTRICT tree, int side, int square) {
* *
*******************************************************************************
*/
uint64_t AttacksTo(TREE * RESTRICT tree, int square) {
uint64_t AttacksTo(TREE *tree, int square) {
uint64_t attacks =
(PawnAttacks(white, square) & Pawns(black)) | (PawnAttacks(black,
square) & Pawns(white));
Expand All @@ -69,7 +69,7 @@ uint64_t AttacksTo(TREE * RESTRICT tree, int square) {
* *
*******************************************************************************
*/
uint64_t AttacksFrom(TREE * RESTRICT tree, int side, int source) {
uint64_t AttacksFrom(TREE *tree, int side, int source) {

switch (Abs(PcOnSq(source))) {
case queen:
Expand Down Expand Up @@ -98,7 +98,7 @@ uint64_t AttacksFrom(TREE * RESTRICT tree, int side, int source) {
* *
*******************************************************************************
*/
uint64_t Attacked(TREE * RESTRICT tree, int side, uint64_t squares) {
uint64_t Attacked(TREE *tree, int side, uint64_t squares) {
uint64_t bsliders, rsliders, set;
int square;

Expand Down
4 changes: 2 additions & 2 deletions src/autotune.c
Expand Up @@ -44,8 +44,8 @@
*******************************************************************************
*/
void AutoTune(int nargs, char *args[]) {
unsigned int target_time = 3000, accuracy = 4, atstart, atend;
unsigned int time, current, setting[64], times[64], last_time, stageii;
uint32_t target_time = 3000, accuracy = 4, atstart, atend;
uint32_t time, current, setting[64], times[64], last_time, stageii;
int benchd, i, v, p, best, bestv, samples;
FILE *craftyrc = fopen(".craftyrc", "a");

Expand Down
10 changes: 5 additions & 5 deletions src/book.c
Expand Up @@ -40,7 +40,7 @@
*/
#define BAD_MOVE 0x02
#define GOOD_MOVE 0x08
int Book(TREE * RESTRICT tree, int wtm) {
int Book(TREE *tree, int wtm) {
static int book_moves[200];
static BOOK_POSITION start_moves[200];
static uint64_t selected_key[200];
Expand Down Expand Up @@ -798,7 +798,7 @@ int Book(TREE * RESTRICT tree, int wtm) {
* *
*******************************************************************************
*/
int BookPonderMove(TREE * RESTRICT tree, int wtm) {
int BookPonderMove(TREE *tree, int wtm) {
uint64_t temp_hash_key, common;
static unsigned book_moves[200];
int i, v, key, cluster, n_moves, im, played, tplayed;
Expand Down Expand Up @@ -917,7 +917,7 @@ int BookPonderMove(TREE * RESTRICT tree, int wtm) {
* *
*******************************************************************************
*/
void Bookup(TREE * RESTRICT tree, int nargs, char **args) {
void Bookup(TREE *tree, int nargs, char **args) {
BB_POSITION *bbuffer;
uint64_t temp_hash_key, common;
FILE *book_input;
Expand Down Expand Up @@ -945,7 +945,7 @@ void Bookup(TREE * RESTRICT tree, int nargs, char **args) {
************************************************************
*/
#if defined(POSITIONS)
unsigned int output_pos, output_wtm;
uint32_t output_pos, output_wtm;
FILE *pout = fopen("positions", "w");
#endif
if (!strcmp(args[1], "create")) {
Expand Down Expand Up @@ -1522,7 +1522,7 @@ BB_POSITION BookupNextPosition(int files, int init) {
return least;
}

int BookupCompare(const void *pos1, const void *pos2) {
int CDECL BookupCompare(const void *pos1, const void *pos2) {
static uint64_t p1, p2;

memcpy((char *) &p1, ((BB_POSITION *) pos1)->position, 8);
Expand Down
4 changes: 1 addition & 3 deletions src/boolean.c
Expand Up @@ -15,8 +15,7 @@
* *
*******************************************************************************
*/
#if !defined(INLINEASM)
/*
#if defined(NO_INTRIN)
int MSB(uint64_t arg1) {
if (arg1 >> 48)
return msb[arg1 >> 48] + 48;
Expand Down Expand Up @@ -44,5 +43,4 @@ int PopCnt(uint64_t arg1) {
arg1 &= arg1 - 1;
return c;
}
*/
#endif