Compiling Crafty

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Compiling Crafty

Post by Robert Pope »

I decided to try compiling Crafty in Windows, and I got it to run except that it basically uses zero time for its own search. Every move it makes, it gives the exact same odd time message:

time limit 575469:28 (+0.00) (575469:28)

Is there a #define or something I am missing to get the time to work? Basically all I did was #undef UNIX and #define NT_i386.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Compiling Crafty

Post by bob »

That should be all you need. Sounds like it is somehow getting the wrong type of time value. Hopefully someone that compiles under windows can speak up...

GetTickCount() should work correctly, and NT_i386 makes it use that...
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: Compiling Crafty

Post by Robert Pope »

It's definitely using GetTickCount(), and that seems to be returning values okay. I'll have to dig around the shared->time_limit stuff and see if I can figure it out.
Tony

Re: Compiling Crafty

Post by Tony »

Did you use the level command to set the time ?

Tony
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: Compiling Crafty

Post by Robert Pope »

Well, I found the problem, but I don't see why I seem to be the only one with issues:

"shared->search_time_limit" only seems to be changed when you annotate or use the "st" option. In my compile, it is never initialized, so it had a nonzero value in it. And in TimeSet(), we have

Code: Select all

  if (shared->search_time_limit) {
    shared->time_limit = shared->search_time_limit;
    shared->absolute_time_limit = shared->time_limit;
  }
I added "shared->search_time_limit=0;" to InitializeSharedData(void) and the problem went away.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Compiling Crafty

Post by bob »

Then something is broken. Unitialized global variables are supposed to be initialized to zero automatically. What compiler are you using??? I'll make sure everything in "shared" is initialized, but that should already be done.
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: Compiling Crafty

Post by Robert Pope »

I'm using MS Visual C++ 2005 Express.
NJDenson
Posts: 75
Joined: Tue May 23, 2006 7:01 pm

Re: Compiling Crafty

Post by NJDenson »

Did you ever get crafty to compile via Visual Studio 2005. If so can I get your assistance.
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: Compiling Crafty

Post by Robert Pope »

I did. I haven't thought about it much recently, but here's what I think I did:
Start new project
import all .c files except dgt.c and dgtdrv.c
import all .h files.
In chess.h, I may have had to do a few defines. It looks like maybe I set:
#undef UNIX
#define NT_i386

I think once I had done that, I got it to compile okay, except for having to add in the variable initialization we discussed above.

Where are you getting hung up?
NJDenson
Posts: 75
Joined: Tue May 23, 2006 7:01 pm

Re: Compiling Crafty

Post by NJDenson »

Dan usually has a blob.c file that calls all the c's the h usually go in the header section. Its the studio settings for the prodject thats getting me ... sometimes depending what you have in it allows you to compile. I will be using 64 bit, 6 man tb's and 8 cores. Dan had extra little tweaks which he called via the blob. Also profiling helps to speed it up as well. I have the lates Intel compiler ver 10.27