How to compile Stockfish?

Discussion of chess software programming and technical issues.

Moderator: Ras

lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

How to compile Stockfish?

Post by lech »

I tried to compile Stockfish’s source code (Windows 98SE) by free Borland C++ 5.5 complier. The result was extreme negative one. How should I do it? They are my first steps in C++. I am used to Pascal.
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: How to compile Stockfish?

Post by mcostalba »

lech wrote:I tried to compile Stockfish’s source code (Windows 98SE) by free Borland C++ 5.5 complier. The result was extreme negative one. How should I do it? They are my first steps in C++. I am used to Pascal.
Please post command line used and _full_ console output with the compile error.

Thanks
lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

Re: How to compile Stockfish?

Post by lech »

mcostalba wrote:
lech wrote:I tried to compile Stockfish’s source code (Windows 98SE) by free Borland C++ 5.5 complier. The result was extreme negative one. How should I do it? They are my first steps in C++. I am used to Pascal.
Please post command line used and _full_ console output with the compile error.

Thanks
Marco, thanks for quick answer, but I think that I must first install MinGW.
My earlier tries, to compile it, were probably too amusing to publish it.
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: How to compile Stockfish?

Post by mcostalba »

lech wrote:
mcostalba wrote:
lech wrote:I tried to compile Stockfish’s source code (Windows 98SE) by free Borland C++ 5.5 complier. The result was extreme negative one. How should I do it? They are my first steps in C++. I am used to Pascal.
Please post command line used and _full_ console output with the compile error.

Thanks
Marco, thanks for quick answer, but I think that I must first install MinGW.
My earlier tries, to compile it, were probably too amusing to publish it.
With MinGW you should not have problems, just type: make ;-)
Aleks Peshkov
Posts: 922
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Borland C++ 5.5

Post by Aleks Peshkov »

Borland C++ is very ancient and do not support all current standard C++ language features.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: How to compile Stockfish?

Post by bob »

lech wrote:I tried to compile Stockfish’s source code (Windows 98SE) by free Borland C++ 5.5 complier. The result was extreme negative one. How should I do it? They are my first steps in C++. I am used to Pascal.
First step, get a decent compiler. gcc for windows works, or microsoft's compiler.
lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

Re: How to compile Stockfish?

Post by lech »

Thanks for help.
Stockfish can be improved. Each position may be considered in 4 ways (combinations of: white<->black and King<->Queen). Results are different e.g. 138, 2, 49, 85 seconds to find solution for the same (in fact) position. It gives huge possibilities to improve Stockfish.
It needs a team work.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: How to compile Stockfish?

Post by Sven »

lech wrote:Thanks for help.
Stockfish can be improved. Each position may be considered in 4 ways (combinations of: white<->black and King<->Queen). Results are different e.g. 138, 2, 49, 85 seconds to find solution for the same (in fact) position. It gives huge possibilities to improve Stockfish.
It needs a team work.
Can you give an example position where mirroring (which is what I understood from your post) leads to such different solution times?

Sven
lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

Re: How to compile Stockfish?

Post by lech »

Sven Schüle wrote:
lech wrote:Thanks for help.
Stockfish can be improved. Each position may be considered in 4 ways (combinations of: white<->black and King<->Queen). Results are different e.g. 138, 2, 49, 85 seconds to find solution for the same (in fact) position. It gives huge possibilities to improve Stockfish.
It needs a team work.
Can you give an example position where mirroring (which is what I understood from your post) leads to such different solution times?

Sven

Code: Select all

Searching: 6bk/8/1P3P1K/6PB/4r3/q7/3P1B2/5R2 w - -
infinite: 0 ponder: 0 time: 0 increment: 0 moves to go: 0
 2     +0.73   00:00      469 g6 Bd5 
 3     +0.89   00:00      977 g6 Bd5 Re1 
 4     +1.01   00:00     2857 g6 Bd5 Re1 Kg8 Rxe4 Bxe4 
 5     +1.66   00:00    10086 g6 Ba2 Re1 Rxe1 Bxe1 Kg8 
 6  >  +3.07   00:00    17420 g6 Ba2 g7+ Kg8 f7+ Bxf7 Bxf7+ Kxf7 Bc5+ 
 7     +3.52   00:00    28991 g6 Bf7 gxf7 Qf8+ Kg6 Re6 Kf5 Rd6 b7 Rd5+ Kg6 
 8     +4.16   00:01   216943 g6 Bf7 gxf7 Qd6 Be3 Re5 Bg4 Re4 Kg5 Re5+ Bf5 
 9  >  +6.42   00:02   433273 g6 Bf7 gxf7 Qd6 Kg6 Rf4 Bd4 Rh4 Be5 Qf8 b7 
10     +5.94   00:02   483858 g6 Bf7 gxf7 Ra4 b7 Qf8+ Kg6 Ra6 Bd4 Qg7+ Kf5 Qh7+ 
                              Kg4 Qe4+ Kg3 Ra3+ Rf3 Qe1+ Kf4 
11     +7.07   00:04    1402k g6 Bf7 gxf7 Re5 Bg4 Qf8+ Kg6 Rh5 Bxh5 Qh6+ Kf5 
                              Qxh5+ Ke6 Qg4+ Ke7 Qe4+ Kd6 Qf4+ Kd7 Qf5+ Ke8 
                              Qe5+ Kf8 Qxf6 
12     +6.06   00:06    2089k g6 Bf7 gxf7 Re5 Bg4 Qf8+ Kg6 Rh5 Bxh5 Qh6+ Kf5 
                              Qxh5+ Ke6 Qg4+ Ke7 Qe4+ Kd6 Qf4+ Kd7 Qf5+ Kc7 
                              Qe5+ Kb7 Qd5+ Kb8 Qxf7 Bd4 Kg8 
13     +5.78   00:10    3283k g6 Bf7 gxf7 Re5 Bg4 Qf8+ Kg6 Rh5 Bxh5 Qh6+ Kf5 
                              Qxh5+ Ke6 Qg4+ Ke7 Qe4+ Kd6 Qf4+ Kc5 Qe5+ Kb4 
                              Qb2+ Kc4 Qa2+ Kc5 Qxf7 Rh1+ Kg8 Bd4 Qb7 
14     +5.78   00:15    5139k g6 Bf7 gxf7 Re5 Bg4 Qf8+ Kg6 Rh5 Bxh5 Qh6+ Kf5 
                              Qxh5+ Ke6 Qg4+ Ke7 Qe4+ Kd6 Qf4+ Kc5 Qe5+ Kb4 
                              Qb2+ Kc4 Qa2+ Kc5 Qxf7 Rh1+ Kg8 Bd4 Qb7 
15  >  +6.06   00:20    7166k g6 Bf7 gxf7 Re5 Bg4 Qf8+ Kg6 Rh5 Bxh5 Qh6+ Kf5 
                              Qxh5+ Ke6 Qg4+ Kd6 Qf4+ Kc5 Qe5+ Kc4 Qe6+ Kb4 
                              Qxf7 Bc5 Kh7 d4 Kg6 d5 
16     +5.45   00:37   13388k g6 Bf7 gxf7 Qd6 Kg6 Rf4 Bd4 Rxd4 Rh1 Rh4 Rxh4 
                              Qd3+ Kg5 Qd5+ Kf4 Qxd2+ Ke5 Qa5+ Ke4 Qb4+ Kf5 
                              Qc5+ Kg6 Qc2+ Kg5 Qc5+ Kg4 Kh7 b7 
17     +5.41   02:18   48160k g6 Bf7 b7 Qb4 g7+ Kg8 Bxf7+ Kxf7 g8=Q+ Kxg8 f7+ 
                              Kxf7 b8=Q Qxb8 Bg3+ Ke6 Bxb8 Kd5 Kg5 Re8 Rf5+ Kc4 
                              Ba7 Kd3 Be3 Ke4 Rf4+ Kd5 Ra4 Rg8+ Kf4 Rf8+ Kg4 
Nodes: 62340145
Nodes/second: 346257
Best move: g6
Ponder move: Bf7

Searching: kb6/8/K1P3P1/BP6/3r4/7q/2B1P3/2R5 w - -
infinite: 0 ponder: 0 time: 0 increment: 0 moves to go: 0
 2     +0.73   00:00      467 b6 Be5 
 3     +0.89   00:00      959 b6 Be5 Rd1 
 4     +1.01   00:00     3001 b6 Be5 Rd1 Kb8 Rxd4 Bxd4 
 5     +0.81   00:00     7099 b6 Be5 Rd1 Rxd1 Bxd1 Kb8 
 6  >  +1.33   00:00     8999 b6 Be5 b7+ Kb8 c7+ Bxc7 Bxc7+ Kxc7 Bf5+ 
 7  >  +3.64   00:00    11604 b6 Be5 b7+ Kb8 c7+ Bxc7 Bxc7+ Kxc7 Bf5+ 
 8     +3.72   00:00    88617 b6 Bc7 bxc7 Qc8+ Kb6 Rd6 Kc5 Re6 g7 Re5+ Kb6 Rh5 
 9     +4.85   00:01   477403 b6 Bc7 bxc7 Rd5 Bd3 Qg4 Bb4 Rd4 Rb1 Qe6 Kb6 
10     +4.93   00:02   671967 b6 Bc7 g7 Qe6 b7+ Kb8 Bxc7+ Kxc7 b8=Q+ Kxb8 g8=Q+ 
                              Qxg8 c7+ Kxc7 Bb3+ Kd6 Bxg8 Re4 Bc4 Ke5 

Nodes: 61530189
Nodes/second: 341644
Best move: b6
Ponder move: Bc7

Searching: 2r5/2b1p3/7Q/3R4/bp6/k1p3p1/8/KB6 b - -
infinite: 0 ponder: 0 time: 0 increment: 0 moves to go: 0
 2     +0.77   00:00      270 b3 Be4 
 3     +0.93   00:00      664 b3 Be4 Ra8 
 4     +1.05   00:00     2725 b3 Be4 Rd8 Kb1 Rxd5 Bxd5 
 5     +0.85   00:00     4190 b3 Be4 Rd8 Rxd8 Bxd8 Kb1 
 6  >  +1.37   00:00     5828 b3 Be4 b2+ Kb1 c2+ Bxc2 Bxc2+ Kxc2 Bf4+ 
 7     +3.56   00:00    15411 b3 Bc2 bxc2 Qc1+ Kb3 Rd3 Kc4 Re3 g2 Re4+ Kb3 
 8     +4.04   00:00   128505 b3 Bc2 bxc2 Qe3 Bb6 Qc1+ Kb3 Rd3 g2 Qb2+ Kc4 
                              Qxc3+ Kb5 Rd5+ Bc5 
 9     +3.15   00:00   272253 b3 Bc2 bxc2 Qe3 Bd6 Rd4 Bd7 Re4 Bb4 Rd4 Bf5 Qc1+ 
                              Kb3 
10  >  +5.41   00:02   892112 b3 Bc2 bxc2 Qe3 Kb3 Rc5 Be5 Rxc8 c1=R+ Qxc1 c2+ 
11     +5.98   00:04    1399k b3 Bc2 bxc2 Rh5 g2 Qc1+ Kb3 Rh3 Be5 Qb2+ Kc4 Qa2+ 
                              Kb5 Qd5+ Kb6 Rh6+ Rc6 Qd8+ Kc5 
12     +5.82   00:08    2954k b3 Bc2 bxc2 Rc5 Bf4 Rxc3+ Rxc3 Qd6+ Kb3 Qb8+ Kc4 
                              Qxf4+ Kb3 Qb8+ Kc4 Qf4+ Kb3 
13     +5.29   00:10    3635k b3 Bc2 bxc2 Rc5 Bf4 Rxc3+ Rxc3 Qd6+ Kb3 Qb8+ Kc4 
                              Qxf4+ Kb3 Qb8+ Kc4 Qf4+ Kb3 
14     +5.98   00:15    5493k b3 Bc2 bxc2 Rc5 Kb4 Qe3 c1=Q+ Qxc1 Kxc5 Qxc3+ Kb6 
                              Qd4+ Kb7 Qb4+ Bb6 Qg4 e5 Qxg3 Bd4+ Kb1 Rc2 Qf3+ 
                              Kc7 Qe4 
15     +6.59   00:29   10423k b3 Bc2 bxc2 Rd4 Bb5 Qc1+ Kb3 Ra4 Bxa4 Qa3+ Kc4 
                              Qxa4+ Kd3 Qb5+ Kd2 Qd5+ Ke3 Qe6+ Kf3 Qf5+ Bf4 
                              Qd3+ Kf2 Qxc2+ Ke3 Qc1+ Kf3 Qd1+ Ke4 Qc2+ Kd4 
                              Qa4+ Ke5 Qb5+ Ke6 Qa6+ Kd7 
16     +5.41   00:49   17750k b3 Bc2 g2 Qe3 b2+ Kb1 Bxc2+ Kxc2 b1=Q+ Kxb1 g1=Q+ 
                              Qxg1 c2+ Kxc2 Bb6+ Kd3 Bxg1 Re5 Bc5 Re1 Ka4 Ke4 
                              Rd8 Rb1 Bd4 Rb7 e5 Rb1 Ra8 Rb7 Rh8 

Nodes: 62790105
Nodes/second: 348737
Best move: b3
Ponder move: Bc2

Searching: 5r2/3p1b2/Q7/4R3/6pb/1p3p1k/8/6BK b - -
infinite: 0 ponder: 0 time: 0 increment: 0 moves to go: 0
 2     +0.77   00:00      269 g3 Bd4 
 3     +0.93   00:00      663 g3 Bd4 Rh8 
 4     +1.05   00:00     2447 g3 Bd4 Re8 Kg1 Rxe5 Bxe5 
 5     +0.85   00:00     3811 g3 Bd4 Re8 Rxe8 Bxe8 Kg1 
 6  >  +1.37   00:00     5519 g3 Bd4 g2+ Kg1 f2+ Bxf2 Bxf2+ Kxf2 Bc4+ 
 7  >  +3.68   00:00     8863 g3 Bd4 g2+ Kg1 f2+ Bxf2 Bxf2+ Kxf2 Bc4+ 
 8     +3.72   00:00    56066 g3 Bf2 gxf2 Qf1+ Kg3 Re3 Kf4 Rd3 b2 Rd4+ Kg3 Rb4 
 9     +4.28   00:01   440486 g3 Bf2 gxf2 Re4 Re8 Rxe8 Bxe8 Qe6+ Kg3 Qd6+ Kg4 
                              Qd4+ Kf5 Qd5+ Kf6 Qd3 
10     +4.32   00:02   939045 g3 Bf2 gxf2 Re4 Be6 Qf1+ Kg3 Rxh4 Kxh4 Qxf2+ Kg4 
                              Qg1+ Kh5 Qh2+ Kg5 Qg3+ Kh6 Qf2 Kg6 Kg1 d5 Qf1 
11  >  +4.97   00:03    1192k g3 Bf2 gxf2 Re4 Bg5 Qf1+ Kg3 Rg4+ Kxg4 Qh3+ Kf4 
12     +7.27   00:05    1765k g3 Bf2 gxf2 Re3 Bd5 Rxb3 Bf6 Qf1+ Kg4 Qxf2 Rh8+ 
                              Kg1 Bxb3 Qe3 Bd5 Qf2 
13     +7.31   00:12    4169k g3 Bf2 gxf2 Rf5 Kg4 Qd3 f1=Q+ Qxf1 Kxf5 Qxf3+ Kg6 
                              Kg1 Rg8 Qe4+ Kg5 Kf1 b2 Qe7+ Kg6 Qe4+ Kg7 Ke2 d5 
14  <  +5.58   00:23    8096k g3 Bf2 gxf2 Re4 Bg5 Qf1+ Kg3 Rh4 Kxh4 Qh3+ Kxh3 
15     +5.82   00:34   12129k g3 Bf2 gxf2 Re4 Bg5 Qf1+ Kg3 Rh4 Bxh4 Qh3+ Kf4 
                              Qxh4+ Ke3 Qg5+ Kd3 Qf5+ Kc4 Qe4+ Kc5 Qe3+ Kb5 
                              Qd3+ Kb4 Qd2+ Kc4 Qxf2 Rh8+ Kg1 Bd5 Qb2 
16     +5.45   01:25   29908k g3 Bf2 b2 Qd3 g2+ Kg1 Bxf2+ Kxf2 g1=Q+ Kxg1 b1=Q+ 
                              Qxb1 f2+ Kxf2 Bg6+ Ke3 Bxb1 Rd5 Bf5 Rd1 Kh4 Kd4 
                              Kg5 Rh1 Re8 Rg1+ Kf6 Rf1 d6 Kd5 
Nodes: 61860134
Nodes/second: 343571
Best move: g3
Ponder move: Bf2
Last depths are the solution.
Pentium !!! 192M Hash (bench for 4 positions)
lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

Re: How to compile Stockfish?

Post by lech »

It is important to find the key. Why and when is Stockfish faster? :lol: I doubt that there is possible to do it by analyzing the Stockfish’s source code.
Probably only tests (4x) can give the result. I have a first experience. :wink: