Crafty source

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

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
bob
Posts: 20342
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Crafty source

Post by bob » Wed Sep 26, 2012 1:37 pm

Several have been asking about 23.5. Our FTP machine slowly went senile. I have moved everything over to our departmental web server, which can be accessed here:

http://www.cis.uab.edu/hyatt/crafty

The source stuff is in the "source" directory there, as always. This greatly simplifies maintaining this (for me). Automatic backups. This filesystem is remotely mounted so I can copy to it directly when a new version is ready, etc...

23.5 is available there. If you have any problems compiling or running, let me know. I've done a lot of cleaning up, including moving to "int64_t" or "uint64_t" rather than "long long" for 64 bit values.

zullil
Posts: 4878
Joined: Mon Jan 08, 2007 11:31 pm
Location: PA USA

Re: Crafty source

Post by zullil » Wed Sep 26, 2012 1:57 pm

bob wrote:Several have been asking about 23.5. Our FTP machine slowly went senile. I have moved everything over to our departmental web server, which can be accessed here:

http://www.cis.uab.edu/hyatt/crafty

The source stuff is in the "source" directory there, as always. This greatly simplifies maintaining this (for me). Automatic backups. This filesystem is remotely mounted so I can copy to it directly when a new version is ready, etc...

23.5 is available there. If you have any problems compiling or running, let me know. I've done a lot of cleaning up, including moving to "int64_t" or "uint64_t" rather than "long long" for 64 bit values.
Thanks, Bob.

User avatar
pocopito
Posts: 228
Joined: Tue Jul 12, 2011 11:31 am
Contact:

Re: Crafty source

Post by pocopito » Wed Sep 26, 2012 3:31 pm

Thanks Robert

It compiled with some warnings on fedora 17 64b, gcc-4.7.
This is the output, just in case is of any use:

Code: Select all

$ make linux
make target=LINUX \
	CC=gcc CXX=g++ \
	CFLAGS=' -Wall -pipe -O3 \
		-pg -fno-gcse -mpreferred-stack-boundary=8' \
	CXFLAGS= \
	LDFLAGS=' -pg -lpthread -lstdc++' \
	opt=' -DINLINE64 -DCPUS=8' \
	crafty-make
gcc -Wall -pipe -O3 \
		-pg -fno-gcse -mpreferred-stack-boundary=8 -DINLINE64 -DCPUS=8 -DLINUX -c crafty.c
In file included from crafty.c:27:0:
utility.c: In function ‘Kibitz’:
utility.c:2322:13: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘uint64_t’ [-Wformat]
utility.c:2325:13: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘uint64_t’ [-Wformat]
In file included from crafty.c:27:0:
utility.c: In function ‘Trace’:
utility.c:2416:9: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat]
In file included from crafty.c:41:0:
interrupt.c: In function ‘Interrupt’:
interrupt.c:75:11: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ [-Wformat]
interrupt.c:87:11: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ [-Wformat]
In file included from crafty.c:45:0:
option.c: In function ‘Option’:
option.c:1822:5: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘size_t’ [-Wformat]
option.c:1825:7: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘size_t’ [-Wformat]
In file included from crafty.c:45:0:
option.c:2396:5: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ [-Wformat]
g++ -c  -DINLINE64 -DCPUS=8 -DLINUX egtb.cpp
gcc -pg -lpthread -lstdc++ -o crafty crafty.o egtb.o -lm  
Two first meanings of the dutch word "leren":
1. leren [vc] (learn, larn, acquire) acquire or gain knowledge or skills.
2. leren [v] (teach, learn, instruct) impart skills or knowledge to.

ZirconiumX
Posts: 1327
Joined: Sun Jul 17, 2011 9:14 am

Re: Crafty source

Post by ZirconiumX » Wed Sep 26, 2012 4:04 pm

chess.h required some changes for me:

Code: Select all

#if !defined(IPHONE)
#  include <malloc.h>
#endif
should become

Code: Select all

#if !defined&#40;__APPLE__)
#  include <malloc.h>
#endif
Build log:

Code: Select all

|| make target=FreeBSD \
|| 	CC=gcc CXX=g++ \
|| 	CFLAGS='-Wall -pipe -O3' \
|| 	CXFLAGS='-Wall -pipe -O3' \
|| 	LDFLAGS= \
|| 	LIBS='-lstdc++' \
|| 	opt='' \
|| 	crafty-make
|| gcc -Wall -pipe -O3  -DFreeBSD -c crafty.c
|| In file included from search.c&#58;1,
||                  from crafty.c&#58;13&#58;
chess.h|389| warning&#58; parameter names &#40;without types&#41; in function declaration
chess.h|390| warning&#58; parameter names &#40;without types&#41; in function declaration
chess.h|391| warning&#58; parameter names &#40;without types&#41; in function declaration
chess.h|393| warning&#58; parameter names &#40;without types&#41; in function declaration
chess.h|394| warning&#58; parameter names &#40;without types&#41; in function declaration
|| In file included from crafty.c&#58;13&#58;
|| search.c&#58; In function 'Search'&#58;
search.c|17| warning&#58; unused variable 'start_nodes'
|| In file included from crafty.c&#58;14&#58;
|| thread.c&#58; In function 'ThreadInit'&#58;
thread.c|283| warning&#58; cast from pointer to integer of different size
thread.c|285| warning&#58; cast from pointer to integer of different size
thread.c|286| warning&#58; cast from pointer to integer of different size
thread.c|289| warning&#58; cast from pointer to integer of different size
thread.c|295| warning&#58; cast from pointer to integer of different size
|| g++ -c -Wall -pipe -O3  -DFreeBSD egtb.cpp
|| egtb.cpp&#58; In function 'void* PvMalloc&#40;size_t&#41;'&#58;
egtb.cpp|334| warning&#58; format '%d' expects type 'int', but argument 2 has type 'size_t'
|| egtb.cpp&#58; In function 'void VInitEnumerations&#40;)'&#58;
egtb.cpp|1270| warning&#58; format '%d' expects type 'int', but argument 3 has type 'ULONG'
egtb.cpp|1274| warning&#58; format '%d' expects type 'int', but argument 3 has type 'ULONG'
egtb.cpp|1281| warning&#58; format '%d' expects type 'int', but argument 4 has type 'ULONG'
egtb.cpp|1288| warning&#58; format '%d' expects type 'int', but argument 4 has type 'ULONG'
egtb.cpp|1298| warning&#58; format '%d' expects type 'int', but argument 5 has type 'ULONG'
egtb.cpp|1307| warning&#58; format '%d' expects type 'int', but argument 5 has type 'ULONG'
egtb.cpp|1310| warning&#58; format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
|| egtb.cpp&#58; In function 'int FCheckExtentExistance&#40;char*, int, color, int&#41;'&#58;
egtb.cpp|6303| warning&#58; unused variable 'fWasError'
egtb.cpp|6304| warning&#58; unused variable 'block'
egtb.cpp|6305| warning&#58; unused variable 'rgbBuffer'
|| egtb.cpp&#58; In static member function 'static INDEX T42<piw1, piw2, piw3, pib1>&#58;&#58;IndCalcB&#40;square*, square*, square, int&#41; &#91;with int piw1 = 5, int piw2 = 5, int piw3 = 1, int pib1 = 5&#93;'&#58;
egtb.cpp|3248| warning&#58; control may reach end of non-void function 'unsigned int IndEnPassant21B&#40;square, square, square, square&#41;' being inlined
|| tbdecode.h&#58; At global scope&#58;
tbdecode.h|771| warning&#58; 'int comp_tell_blocks&#40;decode_info*)' defined but not used
egtb.cpp|6097| warning&#58; 'int TbtProbeTable&#40;int, color, INDEX&#41;' defined but not used
|| gcc  -o crafty crafty.o egtb.o -lm  -lstdc++
Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.

User avatar
Giorgio Medeot
Posts: 51
Joined: Fri Jan 29, 2010 1:01 pm
Location: Ivrea, Italy

Re: Crafty source

Post by Giorgio Medeot » Wed Sep 26, 2012 4:53 pm

I think you should use macros such as PRIu64, SCNu64 (repectively for printf and scanf family functions) and the like, when dealing with exact legth data types, while for MSVC you define:

Code: Select all

#define PRIu64 "I64u"
#define SCNu64 "I64u"
edit: sorry, I see now the warnings about data types are in egtb.cpp, so maybe not your own code?
  • Giorgio

Peter Skinner
Posts: 1758
Joined: Sun Feb 26, 2006 12:49 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Crafty source

Post by Peter Skinner » Wed Sep 26, 2012 5:58 pm

bob wrote:Several have been asking about 23.5. Our FTP machine slowly went senile. I have moved everything over to our departmental web server, which can be accessed here:

http://www.cis.uab.edu/hyatt/crafty

The source stuff is in the "source" directory there, as always. This greatly simplifies maintaining this (for me). Automatic backups. This filesystem is remotely mounted so I can copy to it directly when a new version is ready, etc...

23.5 is available there. If you have any problems compiling or running, let me know. I've done a lot of cleaning up, including moving to "int64_t" or "uint64_t" rather than "long long" for 64 bit values.
I also have the source and pre-made Win32/64 exe's at http://www.kikrtech.com.

Peter
I got kicked out of Chapters because I moved all the Bible's to the fiction section.

Dirt
Posts: 2851
Joined: Wed Mar 08, 2006 9:01 pm
Location: Irvine, CA, USA

Re: Crafty source

Post by Dirt » Thu Sep 27, 2012 11:28 am

pocopito wrote:

Code: Select all

$ make linux
Hey, thanks for that. It seemed to want the Intel compiler by default so I had given up.

Post Reply