google-deepmind / open_spiel

OpenSpiel is a collection of environments and algorithms for research in general reinforcement learning and search/planning in games.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Preprocessor error when compiling with torchlib

robinpdev opened this issue · comments

steps to reproduce (from alphazero libtorch build instructions )

  1. In global_variables.sh, find the
    OPEN_SPIEL_BUILD_WITH_LIBNOP variable and set its value to "ON".
  2. In global_variables.sh, find the
    OPEN_SPIEL_BUILD_WITH_LIBTORCH variable and set its value to "ON".
  3. In global_variables.sh, find the
    OPEN_SPIEL_BUILD_WITH_LIBTORCH_DOWNLOAD_URL variable and set its value to
    the LibTorch version URL compatible with your OS and hardware (see the
    comments in global_variables.sh for the URLs):
  4. Download libnop and the specified version of LibTorch by running:
    $ ./install.sh
  5. Build OpenSpiel to compile LibTorch-dependent and libnop-dependent code
    (such as LibTorch AlphaZero).
    $ ./open_spiel/scripts/build_and_run_tests.sh

the error this generates when running open_spiel/scripts/build_and_run_tests.sh:

.../open_spiel/algorithms/dqn_torch/dqn_torch_test.cc:25:10: fatal error: 'open_spiel/games/efg_game.h' file not found #include "open_spiel/games/efg_game.h"

This error is caused by 2 include statements in open_spiel/algorithms/dqn_torch/dqn_torch_test.cc

It was seemingly introduced when the referenced files were moved but these statements were not updated.

#include "open_spiel/games/efg_game.h"
#include "open_spiel/games/efg_game_data.h"

I made pull request #1132 to correct this issue.