Page 1 of 1

Re: Linux Version of Maverick 1.5

Posted: Thu Nov 12, 2015 8:24 am
by mid
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

Re: Linux Version of Maverick 1.5

Posted: Thu Nov 12, 2015 9:38 am
by Jim Ablett
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.

Re: Linux Version of Maverick 1.5

Posted: Fri Nov 13, 2015 4:15 am
by mid
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

Re: Linux Version of Maverick 1.5

Posted: Fri Nov 13, 2015 6:58 am
by MikeB
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