Borland 5.5 - Any working Crafty makefiles?

Discussion of chess software programming and technical issues.

Moderator: Ras

jhaglund
Posts: 173
Joined: Sun May 11, 2008 7:43 am

Borland 5.5 - Any working Crafty makefiles?

Post by jhaglund »

Looking to find a working makefile for Crafty for this Borland compiler version. It's been years since I've used that specific one.

Any help will be appreciated!

Happy Thanksgiving,
:)
Joshua
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Borland 5.5 - Any working Crafty makefiles?

Post by bob »

jhaglund wrote:Looking to find a working makefile for Crafty for this Borland compiler version. It's been years since I've used that specific one.

Any help will be appreciated!

Happy Thanksgiving,
:)
Joshua
If you have anything old at all, you just need to use "crafty.c" as the source file, as that is a file that #includes everything else into one large wad to make inline optimizations possible. Old options should work since I assume you are not using any parallel stuff??
jhaglund
Posts: 173
Joined: Sun May 11, 2008 7:43 am

Re: Borland 5.5 - Any working Crafty makefiles?

Post by jhaglund »

If you have anything old at all, you just need to use "crafty.c" as the source file, as that is a file that #includes everything else into one large wad to make inline optimizations possible. Old options should work since I assume you are not using any parallel stuff??
Thanks Bob :)

This is what I get:


C:\Borland\BCC55\Bin>bcc32
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
Syntax is: BCC32 [ options ] file[s] * = default; -x- = turn switch x off
-3 * 80386 Instructions -4 80486 Instructions
-5 Pentium Instructions -6 Pentium Pro Instructions
-Ax Disable extensions -B Compile via assembly
-C Allow nested comments -Dxxx Define macro
-Exxx Alternate Assembler name -Hxxx Use pre-compiled headers
-Ixxx Include files directory -K Default char is unsigned
-Lxxx Libraries directory -M Generate link map
-N Check stack overflow -Ox Optimizations
-P Force C++ compile -R Produce browser info
-RT * Generate RTTI -S Produce assembly output
-Txxx Set assembler option -Uxxx Undefine macro
-Vx Virtual table control -X Suppress autodep. output
-aN Align on N bytes -b * Treat enums as integers
-c Compile only -d Merge duplicate strings
-exxx Executable file name -fxx Floating point options
-gN Stop after N warnings -iN Max. identifier length
-jN Stop after N errors -k * Standard stack frame
-lx Set linker option -nxxx Output file directory
-oxxx Object file name -p Pascal calls
-tWxxx Create Windows app -u * Underscores on externs
-v Source level debugging -wxxx Warning control
-xxxx Exception handling -y Produce line number info
-zxxx Set segment names


C:\Borland\BCC55\Bin>bcc32 Crafty.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
crafty.c:
Error E2176 chess.h 148: Too many types in declaration
Warning W8060 searchr.c 36: Possibly incorrect assignment in function SearchRoot

Warning W8060 search.c 313: Possibly incorrect assignment in function Search
Warning W8012 thread.c 198: Comparing signed and unsigned values in function Cop
yToChild
Warning W8019 thread.c 259: Code has no effect in function WaitForAllThreadsInit
ialized
Warning W8019 thread.c 411: Code has no effect in function ThreadWait
Warning W8075 searchmp.c 49: Suspicious pointer conversion in function SearchPar
allel
Warning W8060 qevasions.c 70: Possibly incorrect assignment in function QuiesceE
vasions
Warning W8004 evaluate.c 1141: 'king_sq' is assigned a value that is never used
in function EvaluatePassedPawns
Warning W8004 evaluate.c 1681: 'pns' is assigned a value that is never used in f
unction EvaluatePawns
Warning W8057 movgen.c 483: Parameter 'ply' is never used in function GenerateCh
ecks
Warning W8055 movgen.c 682: Possible overflow in shift operation in function Gen
erateCheckEvasions
Warning W8004 movgen.c 760: 'ep' is assigned a value that is never used in funct
ion GenerateCheckEvasions
Error E2293 hash.c 67: ) expected in function HashProbe
Warning W8055 hash.c 69: Possible overflow in shift operation in function HashPr
obe
Error E2293 hash.c 105: ) expected in function HashProbe
Warning W8055 hash.c 107: Possible overflow in shift operation in function HashP
robe
Warning W8004 hash.c 141: 'pieces' is assigned a value that is never used in fun
ction HashProbe
Warning W8055 hash.c 200: Possible overflow in shift operation in function HashS
tore
Warning W8055 hash.c 216: Possible overflow in shift operation in function HashS
tore
Warning W8055 hash.c 266: Possible overflow in shift operation in function HashS
torePV
Warning W8055 hash.c 267: Possible overflow in shift operation in function HashS
torePV
Warning W8055 hash.c 268: Possible overflow in shift operation in function HashS
torePV
Warning W8055 hash.c 270: Possible overflow in shift operation in function HashS
torePV
Warning W8055 hash.c 271: Possible overflow in shift operation in function HashS
torePV
Warning W8055 hash.c 275: Possible overflow in shift operation in function HashS
torePV
Warning W8055 hash.c 276: Possible overflow in shift operation in function HashS
torePV
Warning W8060 swap.c 80: Possibly incorrect assignment in function Swap
Warning W8041 swap.c 84: Negating unsigned value in function Swap
Warning W8055 boolean.c 80: Possible overflow in shift operation in function MSB

Warning W8055 boolean.c 81: Possible overflow in shift operation in function MSB

Warning W8055 boolean.c 82: Possible overflow in shift operation in function MSB

Warning W8055 boolean.c 83: Possible overflow in shift operation in function MSB

Warning W8055 boolean.c 95: Possible overflow in shift operation in function LSB

Warning W8055 boolean.c 96: Possible overflow in shift operation in function LSB

Warning W8055 boolean.c 97: Possible overflow in shift operation in function LSB

Error E2209 utility.c 19: Unable to open include file 'sys/times.h'
Error E2209 utility.c 20: Unable to open include file 'sys/time.h'
Error E2209 utility.c 23: Unable to open include file 'unistd.h'
Error E2209 utility.c 35: Unable to open include file 'sys/filio.h'
Error E2209 utility.c 39: Unable to open include file 'stropts.h'
Error E2209 utility.c 41: Unable to open include file 'sys/conf.h'
Error E2209 utility.c 46: Unable to open include file 'sys/wait.h'
Error E2209 utility.c 49: Unable to open include file 'sys/ipc.h'
Error E2209 utility.c 50: Unable to open include file 'sys/shm.h'
Warning W8055 utility.c 153: Possible overflow in shift operation in function Bo
okIn64
Warning W8055 utility.c 153: Possible overflow in shift operation in function Bo
okIn64
Warning W8055 utility.c 154: Possible overflow in shift operation in function Bo
okIn64
Warning W8055 utility.c 154: Possible overflow in shift operation in function Bo
okIn64
Warning W8055 utility.c 212: Possible overflow in shift operation in function Bo
okOut64
Warning W8055 utility.c 213: Possible overflow in shift operation in function Bo
okOut64
Warning W8055 utility.c 214: Possible overflow in shift operation in function Bo
okOut64
Warning W8055 utility.c 215: Possible overflow in shift operation in function Bo
okOut64
Error E2451 utility.c 322: Undefined symbol 'fd_set' in function CheckInput
Error E2379 utility.c 322: Statement missing ; in function CheckInput
Error E2140 utility.c 323: Declaration is not allowed here in function CheckInpu
t
Error E2450 utility.c 323: Undefined structure 'timeval' in function CheckInput
Error E2449 utility.c 323: Size of 'tv' is unknown or zero in function CheckInpu
t
Error E2450 utility.c 323: Undefined structure 'timeval' in function CheckInput
Error E2450 utility.c 323: Undefined structure 'timeval' in function CheckInput
Error E2449 utility.c 323: Size of 'tv' is unknown or zero in function CheckInpu
t
Error E2140 utility.c 324: Declaration is not allowed here in function CheckInpu
t
Warning W8065 utility.c 326: Call to function 'isatty' with no prototype in func
tion CheckInput
Error E2451 utility.c 332: Undefined symbol 'readfds' in function CheckInput
Warning W8065 utility.c 332: Call to function 'FD_ZERO' with no prototype in fun
ction CheckInput
Warning W8065 utility.c 333: Call to function 'FD_SET' with no prototype in func
tion CheckInput
Error E2451 utility.c 334: Undefined symbol 'tv_sec' in function CheckInput
Error E2451 utility.c 335: Undefined symbol 'tv_usec' in function CheckInput
Warning W8065 utility.c 336: Call to function 'select' with no prototype in func
tion CheckInput
Warning W8065 utility.c 337: Call to function 'FD_ISSET' with no prototype in fu
nction CheckInput
Warning W8012 utility.c 358: Comparing signed and unsigned values in function Cl
earHashTableScores
Warning W8019 utility.c 385: Code has no effect in function CraftyExit
Warning W8012 utility.c 1229: Comparing signed and unsigned values in function E
GTBPV
Error E2450 utility.c 1377: Undefined structure 'timeval' in function ReadClock
Error E2228 utility.c 1377: Too many error or warning messages in function ReadC
lock
*** 26 errors in Compile ***

C:\Borland\BCC55\Bin>

It doesn't look very good.
CThinker
Posts: 388
Joined: Wed Mar 08, 2006 10:08 pm

Re: Borland 5.5 - Any working Crafty makefiles?

Post by CThinker »

1. At the top of chess.h, add these lines:

#ifdef __GNUC__
# define UI64(n_) (n_##ULL)
#else
# define UI64(n_) (n_##ui64)
#endif

2. In all occurences of 0x....ULL and 0x....ull constants, replace them with UI64(0x....). Remember to remove ULL/ull at the end of the constants.

3. In the line that has _kbhit(), replace it with:

#ifdef __BORLANDC__
i = kbhit();
#else
i = _kbhit();
#endif

4. Replace _beginthreadex with CreateThread, and cast the parameter "func" with "(PTHREAD_START_ROUTINE)func".

5. Lastly, complie with:

bcc32 -DNT_i386 -DNOEGTB -DCPUS=2 -w-aus -w-sus -w-pia -w-spa -w-csu -w-spc -w-par -w-eff crafty.c

Add whatever optimization option you like.

Having said all that, I recommend that you use Vistual Studio instead. It is free and produces the most efficient (fastest) executable binary.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Borland 5.5 - Any working Crafty makefiles?

Post by bob »

CThinker wrote:1. At the top of chess.h, add these lines:

#ifdef __GNUC__
# define UI64(n_) (n_##ULL)
#else
# define UI64(n_) (n_##ui64)
#endif

2. In all occurences of 0x....ULL and 0x....ull constants, replace them with UI64(0x....). Remember to remove ULL/ull at the end of the constants.

3. In the line that has _kbhit(), replace it with:

#ifdef __BORLANDC__
i = kbhit();
#else
i = _kbhit();
#endif

4. Replace _beginthreadex with CreateThread, and cast the parameter "func" with "(PTHREAD_START_ROUTINE)func".

5. Lastly, complie with:

bcc32 -DNT_i386 -DNOEGTB -DCPUS=2 -w-aus -w-sus -w-pia -w-spa -w-csu -w-spc -w-par -w-eff crafty.c

Add whatever optimization option you like.

Having said all that, I recommend that you use Vistual Studio instead. It is free and produces the most efficient (fastest) executable binary.
I suspect Borland is simply not going to work. The 64 bit stuff will confuse it, and it does not understand newer C ideas like if((a=b)) where the extra parens make the "=" avoid warnings. There are tons of other issues in the output that suggest it will never work even if the #include issues are fixed...
CThinker
Posts: 388
Joined: Wed Mar 08, 2006 10:08 pm

Re: Borland 5.5 - Any working Crafty makefiles?

Post by CThinker »

bob wrote:
CThinker wrote:1. At the top of chess.h, add these lines:

#ifdef __GNUC__
# define UI64(n_) (n_##ULL)
#else
# define UI64(n_) (n_##ui64)
#endif

2. In all occurences of 0x....ULL and 0x....ull constants, replace them with UI64(0x....). Remember to remove ULL/ull at the end of the constants.

3. In the line that has _kbhit(), replace it with:

#ifdef __BORLANDC__
i = kbhit();
#else
i = _kbhit();
#endif

4. Replace _beginthreadex with CreateThread, and cast the parameter "func" with "(PTHREAD_START_ROUTINE)func".

5. Lastly, complie with:

bcc32 -DNT_i386 -DNOEGTB -DCPUS=2 -w-aus -w-sus -w-pia -w-spa -w-csu -w-spc -w-par -w-eff crafty.c

Add whatever optimization option you like.

Having said all that, I recommend that you use Vistual Studio instead. It is free and produces the most efficient (fastest) executable binary.
I suspect Borland is simply not going to work. The 64 bit stuff will confuse it, and it does not understand newer C ideas like if((a=b)) where the extra parens make the "=" avoid warnings. There are tons of other issues in the output that suggest it will never work even if the #include issues are fixed...
I have tried it and it works. That is the reason I am able to list those things that are needed to make it work.
jhaglund
Posts: 173
Joined: Sun May 11, 2008 7:43 am

Re: Borland 5.5 - Any working Crafty makefiles?

Post by jhaglund »

Good news...
1. At the top of chess.h, add these lines:

#ifdef __GNUC__
# define UI64(n_) (n_##ULL)
#else
# define UI64(n_) (n_##ui64)
#endif

2. In all occurences of 0x....ULL and 0x....ull constants, replace them with UI64(0x....). Remember to remove ULL/ull at the end of the constants.

3. In the line that has _kbhit(), replace it with:

#ifdef __BORLANDC__
i = kbhit();
#else
i = _kbhit();
#endif
I commented // the NUMA support out because I couldn't figure out the:
4. Replace _beginthreadex with CreateThread, and cast the parameter "func" with "(PTHREAD_START_ROUTINE)func".


lol :D

This compiles.
bcc32 -DNT_i386 -DNOEGTB -w-aus -w-sus -w-pia -w-spa -w-csu -w-spc -w-par -w-eff crafty.c

It takes a lot to impress me. I must say I'm really impressed by you Lance! Thanks!!

Joshua