facebook twitter hatena line email

将棋プログラム/技巧/mac

提供: 初心者エンジニアの簡易メモ
2017年10月6日 (金) 09:38時点におけるAdmin (トーク | 投稿記録)による版 (monoインストール)

移動: 案内検索

(自分用メモ:/d/www/Gikouで実行)

技巧インストール

$ git clone https://github.com/gikou-official/Gikou.git
$ make release
$ ls -ltA bin/release
> bin/release

makeでmake[1]: *** [obj/release/src/bitboard.o] Error 1となる場合

  1. 以下項目に従ってgcc&g++のバージョンを変更
  2. 以下項目に従ってSIPを無効にする

gcc&g++49をインストール

$ sudo brew install gcc49
$ which gcc
/usr/bin/gcc
/usr/local/bin/gcc-4.9 -v
> gcc version 4.9.2 (Debian 4.9.2-10)
/usr/local/bin/g++-4.9 -v
> gcc version 4.9.2 (Debian 4.9.2-10)
$ sudo /usr/bin/gcc /usr/bin/gcc_bk # 一応元あったものをバックアップしておく
$ sudo /usr/bin/g++ /usr/bin/g++_bk # 一応元あったものをバックアップしておく
$ sudo ln -s /usr/local/bin/gcc-4.9 /usr/bin/gcc
$ sudo ln -s /usr/local/bin/g++-4.9 /usr/bin/g++

SIPを無効

/usr/bin/gccを変更するときにエラーが出た場合は、SIPを一旦無効にする

  1. macを再起動し、[Command+R]を押して起動
  2. ユーティリティ/ターミナルを選択
$ csrutil status
> System Integrity Protection status: enabled.
$ csrutil disable
Successufully disabled System Integrity Protection. Please restart the machine for the changes to take effect.  
$ reboot

gccを更新後はSIPを再度有効に戻す

$ csrutil enable
$ reboot

技巧学習

./bin/release --learn-progress

技巧バイナリ追加

$ wget https://github.com/gikou-official/Gikou/archive/v2.0.2.tar.gz
tar zxvf v2.0.2.tar.gz
bin/releaseと同じdirへ回答したファイルを移動

unzipインストール

apt-get install unzip

monoインストール

apt-get install -y mono-complete

usi使い方

> bin/release
info string Unsupported Command:
> usi
id name Gikou 2 (v2.0.2)
id author Yosuke Demura
option name BookFile type filename default book.bin
option name BookMaxPly type spin default 20 min 0 max 50
option name ByoyomiMargin type spin default 100 min 0 max 10000
option name DepthLimit type spin default 100 min 1 max 100
option name DrawScore type spin default 0 min -200 max 200
option name FischerMargin type spin default 12000 min 0 max 60000
option name MinThinkingTime type spin default 1000 min 10 max 60000
option name MultiPV type spin default 1 min 1 max 700
option name NarrowBook type check default false
option name OwnBook type check default true
option name ResignScore type spin default -10000 min -32600 max -500
option name SuddenDeathMargin type spin default 60 min 0 max 600
option name Threads type spin default 4 min 1 max 64
option name TinyBook type check default false
usiok
> setoption name USI_Ponder value false
> setoption name USI_Hash value 256
> setoption name MultiPV value 1
> isready
readyok
> usinewgame
> position startpos moves 2g2f 8c8d 7g7f 4a3b 6i7h 8d8e 8h7g 3c3d 7i8h 2b7g+ 8h7g 3a4b 3i3h 7a7b 4g4f 6c6d 3g3f 7b6c 5i6h 4b3c 3h4g 7c7d
> go btime 0 wtime 0 byoyomi 3000
info depth 1 seldepth 1 time 1 nodes 190 nps 190000 hashfull 142 score cp 151 multipv 1 pv 6h7i
info depth 2 seldepth 2 time 1 nodes 827 nps 827000 hashfull 142 score cp 227 multipv 1 pv 4i5h 6a5b
info depth 21 seldepth 22 time 2904 nodes 2092176 nps 720446 hashfull 176 score cp 104 multipv 1 pv 9g9f 9c9d 1g1f 1c1d 6h7i 6a5b 2i3g 8a7c 6g6f 5a4b 4g5f 6c5d 4f4e 4b3a 4i5h 5b6c 2h4h 6d6e 6f6e 5d6e
bestmove 9g9f

局面をsfenでも入力する場合

> sfen lnsg1k3/1r3+P3/p1ppp3p/7+B1/6p2/1+pP2L3/P2PPPP1P/9/LNSGKGSNL w BGSNP2r 1
> go btime 0 wtime 0 byoyomi 3000
info depth 1 seldepth 1 time 1 nodes 2 nps 2000 hashfull 0 score mate -2 multipv 1 pv 8b4b
info depth 2 seldepth 3 time 1 nodes 5 nps 5000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
info depth 3 seldepth 3 time 1 nodes 8 nps 8000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
info depth 4 seldepth 3 time 1 nodes 11 nps 11000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
info depth 5 seldepth 3 time 1 nodes 14 nps 14000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
info depth 6 seldepth 3 time 1 nodes 17 nps 17000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
info depth 7 seldepth 3 time 1 nodes 20 nps 20000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
info depth 8 seldepth 3 time 1 nodes 23 nps 23000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
info depth 9 seldepth 3 time 1 nodes 26 nps 26000 hashfull 0 score mate -2 multipv 1 pv 8b4b 4f4b+
bestmove 8b4b