Linux Version of Maverick 1.5

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

Moderators: hgm, Harvey Williamson, bob

Post Reply
User avatar
mid
Posts: 19
Joined: Thu Dec 11, 2014 5:34 am
Location: Cupertino, California
Contact:

Re: Linux Version of Maverick 1.5

Post by mid » Thu Nov 12, 2015 7:24 am

On OSX both _BitScanForward64 and __popcnt64 are defined in Intrin.h (comes with Xcode/clang 6.0).

I should be able to take closer look tomorrow.

Best,
Michael
-- http://www.dvorkin.net

User avatar
Jim Ablett
Posts: 1327
Joined: Fri Jul 14, 2006 5:56 am
Location: London, England
Contact:

Re: Linux Version of Maverick 1.5

Post by Jim Ablett » Thu Nov 12, 2015 8:38 am

Can replace with intrinsics >

Code: Select all

__inline int FirstBit(U64 val)  {       // LSB // FirstBit // FirstOne // BitScanForward // BSF
return __builtin_ffsll(val) - 1;
}


__inline int LastBit(U64 val)  {       //  MSB // LastBit // LastOne // BitScanReverse // BSR
return 63 - __builtin_clzll(val);
}


__inline int BitCount(U64 b)
{
	return __builtin_popcountll(b);
}
Jim.

User avatar
mid
Posts: 19
Joined: Thu Dec 11, 2014 5:34 am
Location: Cupertino, California
Contact:

Re: Linux Version of Maverick 1.5

Post by mid » Fri Nov 13, 2015 3:15 am

Hi Steve,

Made it compile on OSX: https://github.com/michaeldv/maverick-1.5-osx

To see the changes check out https://github.com/michaeldv/maverick-1 ... its/master -- second pair of eyes would be good. :-)

Clang threw tons of warnings, you might want to check them out as well: https://gist.github.com/michaeldv/118fbbb66a7d787b119e

HTH,
Michael
-- http://www.dvorkin.net

User avatar
MikeB
Posts: 2509
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

Re: Linux Version of Maverick 1.5

Post by MikeB » Fri Nov 13, 2015 5:58 am

mid wrote:Hi Steve,

Made it compile on OSX: https://github.com/michaeldv/maverick-1.5-osx

To see the changes check out https://github.com/michaeldv/maverick-1 ... its/master -- second pair of eyes would be good. :-)

Clang threw tons of warnings, you might want to check them out as well: https://gist.github.com/michaeldv/118fbbb66a7d787b119e

HTH,
Michael
-- http://www.dvorkin.net
Steve/Michael:

Very good. Ok for gcc compile on OSX - I made these changes:

Code: Select all

uci.cpp ->removed "__stdcall" 
line 41:
/*unsigned __stdcall engine_loop(void* pArguments) delete __stdcall for OSX)*/
unsigned engine_loop(void* pArguments)

proca.h ->removed "__stdcall"
line 11:
/*unsigned __stdcall engine_loop(void* pArguments);  delete __stdcall for OSX */
unsigned engine_loop(void* pArguments);
and gcc PGO make file:

Code: Select all

# Makefile to build Maverick 1.5 on OS X.
# type "make" ; for subsequent builds, type "make clean" , then "make"

#comment in/out the depending on the build you are making
# make first build with  -fprofile-generate flag
# run a few test positions 
# make final build with  -fprofile-use flag
# at this point , very little pickup using PGO, clang is a fraction slower on my machine (20ms)

CC = g++ -pipe -O3 -Ofast -mtune=native -fprofile-generate
#CC = g++ -pipe -O3 -Ofast -mtune=native -fprofile-use
#CC = clang -pipe -O3 -Ofast -mtune=native

APP = maverick-1.5-osx-64
SRC = $(wildcard *.cpp)
OBJ = $(SRC:.cpp=.o)
LDFLAGS='-libc++ -pthread'

$(APP): $(OBJ)
	$(CC) $(LDFLAGS) -c $(SRC)
	$(CC) -o $(APP) $(OBJ)

clean:
	rm -f *.o
	rm -f $(APP)
suedo bench ( go depth 15 from start position)

Code: Select all

id name Maverick 1.5 x64 osx
id author Steve Maughan
option name Hash type spin default 64 min 2 max 1024
option name Ponder type check default true
option name Book Selectivity type combo default Normal var Random var Varied var Normal var Discerning var Tournament
option name UCI_ShowCurrLine type check default false
option name UCI_Chess960 type check default false
option name UCI_EngineAbout type string default Maverick 1.5 x64 osx by Steve Maughan www.chessprogramming.net
option name Show Search Statistics type check default true
option name Futility Pruning type check default false
uciok
...
info nodes 4360009 nps 565573
bestmove e2e4 ponder d7d5

fwiw, a ton of warnings with clang and gcc

Post Reply