Compiling Stockfish MSVS 2010

Code, algorithms, languages, construction...
Post Reply
Webkikr
Posts: 16
Joined: Sat Feb 05, 2011 9:18 pm
Real Name: Peter Skinner
Location: Canada
Contact:

Compiling Stockfish MSVS 2010

Post by Webkikr » Sat Nov 05, 2011 8:38 pm

Anyone have a working makefile for Stockfish under MS Visual Studio 2010? Any special options I should be using?

I compiled Stockfish 1.8 at one time, but I lost the makefile I used.

gaard
Posts: 127
Joined: Thu Jun 10, 2010 1:39 am
Real Name: Martin Wyngaarden
Location: Holland, Michigan

Re: Compiling Stockfish MSVS 2010

Post by gaard » Sun Nov 06, 2011 1:31 am

Webkikr wrote:Anyone have a working makefile for Stockfish under MS Visual Studio 2010? Any special options I should be using?

I compiled Stockfish 1.8 at one time, but I lost the makefile I used.
Stockfish is pretty easy to make at the command line with the MS compiler.

cl /Festockfish /Ox /DNDEBUG /DIS_64BIT /DUSE_POPCNT /DUSE_PREFETCH *.cpp
of course only use /DIS_64BIT and /DUSE_POPCNT if you can

to do a PGO attach /GL /link /LTCG:PGI

then

stockfish bench 32 1 10 default depth

and re-link: link /LTCG:PGO /OUT:stockfish.exe *.obj

HumbleProgrammer
Posts: 40
Joined: Sat Jun 19, 2010 11:00 pm
Real Name: Lee Neuse

Re: Compiling Stockfish MSVS 2010

Post by HumbleProgrammer » Mon Nov 07, 2011 1:06 pm

An excellent reply: succinct, helpful, and accurate. Wish there was a way to applaud...oh, wait...I just did.

dbxuau
Posts: 10
Joined: Sat Dec 17, 2011 9:01 pm
Real Name: jimbo

Re: Compiling Stockfish MSVS 2010

Post by dbxuau » Thu Dec 22, 2011 12:26 am

How does this compare to using the ICC compiler for POPCNT? Does the MS compiler do popcnt enabling as well? Curious which one runs better once compiled. Cheers

User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Re: Compiling Stockfish MSVS 2010

Post by kingliveson » Fri Dec 23, 2011 6:54 am

dbxuau wrote:How does this compare to using the ICC compiler for POPCNT? Does the MS compiler do popcnt enabling as well? Curious which one runs better once compiled. Cheers

Both ICC and MSVC have built-in intrinsic functions _mm_popcnt_u64 and __popcnt64 respectively. There should be no difference in speed because they map to CPU specific instructions.

As far as ICC vs MSVC, personal experience is ICC produces faster x86_64 binaries and MSVC, faster x86 binaries.
PAWN : Knight >> Bishop >> Rook >>Queen

Post Reply