open_spiel icon indicating copy to clipboard operation
open_spiel copied to clipboard

No smart_holder.h in pybind11

Open wyz2368 opened this issue 5 years ago • 3 comments

Hi authors,

When installing openspiel (build from source), I met the following issue.

[ 93%] Building CXX object python/CMakeFiles/pyspiel.dir/pybind11/algorithms_trajectories.cc.o In file included from /Users/wangyzh/PycharmProjects/open_spiel/open_spiel/python/pybind11/algorithms_corr_dist.cc:15: In file included from /Users/wangyzh/PycharmProjects/open_spiel/open_spiel/../open_spiel/python/pybind11/algorithms_corr_dist.h:18: In ./open_spiel/python/pybind11/pybind11.h:29:10: fatal error: 'pybind11/include/pybind11/smart_holder.h' file not found #include "pybind11/include/pybind11/smart_holder.h" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I found that smart_holder.h only exists in the smart_holder branch of pybind11 rather than the master branch. So it is possible that the smart_holder branch is not installed by default.

Thanks.

wyz2368 avatar Jul 30 '21 18:07 wyz2368

Hi @wyz2368, the install.sh script clones the smart holder branch here: https://github.com/deepmind/open_spiel/blob/a432cf7441acc08479b868ffc2cde208464d403e/open_spiel/scripts/install.sh#L98

Have you pulled from master within an older clone (possibly before we started using the smart holder branchof pybind11)? Or did you start from scratch (running install.sh on a fresh clone)?

lanctot avatar Jul 30 '21 22:07 lanctot

Hi @lanctot ,

I fetched the newest open_spiel to merge the local old version. I found that the pybind11 in my old version was not removed after the merge. I guess when I compiled, the installation detected the old pybind11 so it didn't download the new smart_holder branch. The issue was solved when I replaced the old pybind11 with the new one. Interestingly, the pybind11 folder was not placed in the download_cache directory (I guess it is due to the old setting).

For curiosity, I cloned a brand new openspiel from master and tried to install it. Everything, including pybind11, double_dummy_solver and abseil-cpp, was downloaded to the download_cache directory, following the install.sh exactly. So it is like the issue was raised by the residue of previous installations.

Anyway, thank you so much for your help. : )

wyz2368 avatar Jul 30 '21 23:07 wyz2368

Great, glad you were able to fix it!

lanctot avatar Jul 31 '21 09:07 lanctot