reconnaissanceblindchess / reconchess

ReconChess python implementation
BSD 3-Clause "New" or "Revised" License
42 stars 12 forks source link

stockfish installation #11

Closed JiahaoYao closed 5 years ago

JiahaoYao commented 5 years ago

Hi @calyri,

I followed the stockfish installation instruction to install. I can successfully make the src file. Then, I set the env val export STOCKFISH_EXECUTABLE="/home/jimmy/Downloads/stockfish-10-linux/src".

However, when I run the stockfish bot, I have the following bugs.

  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/site-packages/reconchess/scripts/rc_bot_match.py", line 22, in main
    winner_color, win_reason, history = play_local_game(white_player_cls(), black_player_cls(), game=game)
  File "/home/jimmy/Downloads/reconchess/reconchess/bots/my_bot.py", line 33, in __init__
    self.engine = chess.engine.SimpleEngine.popen_uci(stockfish_path)
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/site-packages/chess/engine.py", line 2409, in popen_uci
    return cls.popen(UciProtocol, command, timeout=timeout, debug=debug, setpgrp=setpgrp, **popen_args)
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/site-packages/chess/engine.py", line 2401, in popen
    return run_in_background(background, debug=debug)
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/site-packages/chess/engine.py", line 185, in run_in_background
    return future.result()
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/site-packages/chess/engine.py", line 164, in background
    loop.run_until_complete(coroutine(future))
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/site-packages/chess/engine.py", line 2390, in background
    transport, protocol = await Protocol.popen(command, setpgrp=setpgrp, **popen_args)
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/site-packages/chess/engine.py", line 894, in popen
    return await loop.subprocess_exec(cls, *command, **popen_args)
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/asyncio/base_events.py", line 1211, in subprocess_exec
    bufsize, **kwargs)
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/asyncio/unix_events.py", line 200, in _make_subprocess_transport
    **kwargs)
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/asyncio/base_subprocess.py", line 39, in __init__
    stderr=stderr, bufsize=bufsize, **kwargs)
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/asyncio/unix_events.py", line 706, in _start
    universal_newlines=False, bufsize=bufsize, **kwargs)
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/home/jimmy/anaconda3/envs/reconchess/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/home/jimmy/Downloads/stockfish-10-linux/src'

So, could you please tell me what is the right way to install the stockfish engine?

calyri commented 5 years ago

@JiahaoYao The stockfish executable environment variable has to point to the actual executable, not the directory that has it. Try updating your variable accordingly and let me know if this works.

JiahaoYao commented 5 years ago

@calyri acutally, this is the point I am confused about here. Could you tell me which should be executable directory?

.
├── AUTHORS
├── Copying.txt
├── Linux
│   ├── stockfish_10_x64
│   ├── stockfish_10_x64_bmi2
│   └── stockfish_10_x64_modern
├── Readme.md
├── Top\ CPU\ Contributors.txt
├── appveyor.yml
├── src
│   ├── Makefile
│   ├── benchmark.cpp
│   ├── bitbase.cpp
│   ├── bitboard.cpp
│   ├── bitboard.h
│   ├── endgame.cpp
│   ├── endgame.h
│   ├── evaluate.cpp
│   ├── evaluate.h
│   ├── main.cpp
│   ├── material.cpp
│   ├── material.h
│   ├── misc.cpp
│   ├── misc.h
│   ├── movegen.cpp
│   ├── movegen.h
│   ├── movepick.cpp
│   ├── movepick.h
│   ├── pawns.cpp
│   ├── pawns.h
│   ├── position.cpp
│   ├── position.h
│   ├── psqt.cpp
│   ├── search.cpp
│   ├── search.h
│   ├── syzygy
│   │   ├── tbprobe.cpp
│   │   └── tbprobe.h
│   ├── thread.cpp
│   ├── thread.h
│   ├── thread_win32.h
│   ├── timeman.cpp
│   ├── timeman.h
│   ├── tt.cpp
│   ├── tt.h
│   ├── types.h
│   ├── uci.cpp
│   ├── uci.h
│   └── ucioption.cpp
└── tests
    ├── instrumented.sh
    ├── perft.sh
    ├── reprosearch.sh
    └── signature.sh

Thank you so much!

calyri commented 5 years ago

If I understand your directories, then your environment variable should be set as: export STOCKFISH_EXECUTABLE="/home/jimmy/Downloads/stockfish-10-linux/Linux/stockfish_10_x64

so that it points to the actual executable for your platform under the Linux folder.

JiahaoYao commented 5 years ago

Thanks @calyri !