Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error in docker #321

Closed
ekaradon-Alexander opened this issue Aug 26, 2020 · 3 comments
Closed

Compile error in docker #321

ekaradon-Alexander opened this issue Aug 26, 2020 · 3 comments

Comments

@ekaradon-Alexander
Copy link

Host OS:

  • macOS Catalina 10.15.6
  • Docker 19.03.12

Run command:

docker build --target base -t openspiel . --rm

Error message:

Step 17/30 : RUN make -j12
...
...
In file included from /repo/open_spiel/game_parameters.cc:15:
/repo/open_spiel/../open_spiel/game_parameters.h:117:7: error: explicit specialization of 'value' in class scope
  int value() const {
      ^
/repo/open_spiel/../open_spiel/game_parameters.h:121:10: error: explicit specialization of 'value' in class scope
  double value() const {
         ^
/repo/open_spiel/../open_spiel/game_parameters.h:125:22: error: explicit specialization of 'value' in class scope
  const std::string& value() const {
                     ^
/repo/open_spiel/../open_spiel/game_parameters.h:129:15: error: explicit specialization of 'value' in class scope
  std::string value() const {
              ^
/repo/open_spiel/../open_spiel/game_parameters.h:133:8: error: explicit specialization of 'value' in class scope
  bool value() const {
       ^
/repo/open_spiel/../open_spiel/game_parameters.h:137:47: error: explicit specialization of 'value' in class scope
  const std::map<std::string, GameParameter>& value() const {
                                              ^
/repo/open_spiel/../open_spiel/game_parameters.h:141:40: error: explicit specialization of 'value' in class scope
  std::map<std::string, GameParameter> value() const {
                                       ^
In file included from In file included from /repo/open_spiel/fog/observation_history.cc:15:
In file included from /repo/open_spiel/../open_spiel/fog/observation_history.h:24:
In file included from /repo/open_spiel/../open_spiel/spiel.h:36:
/repo/open_spiel/../open_spiel/game_parameters.h:117:7: error: explicit specialization of 'value' in class scope
  int value() const {
      ^
/repo/open_spiel/../open_spiel/game_parameters.h:121:10: error: explicit specialization of 'value' in class scope
  double value() const {
         ^
/repo/open_spiel/../open_spiel/game_parameters.h:125:22: error: explicit specialization of 'value' in class scope
  const std::string& value() const {
                     ^
/repo/open_spiel/../open_spiel/game_parameters.h:129:15: error: explicit specialization of 'value' in class scope
  std::string value() const {
              ^
/repo/open_spiel/../open_spiel/game_parameters.h:133:8: error: explicit specialization of 'value' in class scope
  bool value() const {
       ^
/repo/open_spiel/../open_spiel/game_parameters.h:137:47: error: explicit specialization of 'value' in class scope
  const std::map<std::string, GameParameter>& value() const {
                                              ^
/repo/open_spiel/../open_spiel/game_parameters.h/repo/open_spiel/observer.cc:141:40: error: explicit specialization of 'value' in class scope
  std::map<std::string, GameParameter> value() const {
:                                       ^
22:
In file included from /repo/open_spiel/../open_spiel/spiel.h:36:
/repo/open_spiel/../open_spiel/game_parameters.h:117:7: error: explicit specialization of 'value' in class scope
  int value() const {
      ^
/repo/open_spiel/../open_spiel/game_parameters.h:121:10: error: explicit specialization of 'value' in class scope
  double value() const {
         ^
/repo/open_spiel/../open_spiel/game_parameters.h:125:22: error: explicit specialization of 'value' in class scope
  const std::string& value() const {
                     ^
/repo/open_spiel/../open_spiel/game_parameters.h:129:15: error: explicit specialization of 'value' in class scope
  std::string value() const {
              ^
/repo/open_spiel/../open_spiel/game_parameters.h:133:8: error: explicit specialization of 'value' in class scope
  bool value() const {
       ^
/repo/open_spiel/../open_spiel/game_parameters.h:137:47: error: explicit specialization of 'value' in class scope
  const std::map<std::string, GameParameter>& value() const {
                                              ^
/repo/open_spiel/../open_spiel/game_parameters.h:141:40: error: explicit specialization of 'value' in class scope
  std::map<std::string, GameParameter> value() const {
                                       ^
In file included from /repo/open_spiel/matrix_game.cc:15:
In file included from /repo/open_spiel/../open_spiel/matrix_game.h:25:
In file included from /repo/open_spiel/../open_spiel/normal_form_game.h:24:
In file included from /repo/open_spiel/../open_spiel/simultaneous_move_game.h:22:
In file included from /repo/open_spiel/../open_spiel/spiel.h:36:
/repo/open_spiel/../open_spiel/game_parameters.h:117:7: error: explicit specialization of 'value' in class scope
  int value() const {
      ^
/repo/open_spiel/../open_spiel/game_parameters.h:121:10: error: explicit specialization of 'value' in class scope
  double value() const {
         ^
/repo/open_spiel/../open_spiel/game_parameters.h:125:22: error: explicit specialization of 'value' in class scope
  const std::string& value() const {
                     ^
/repo/open_spiel/../open_spiel/game_parameters.h:129:15: error: explicit specialization of 'value' in class scope
  std::string value() const {
              ^
/repo/open_spiel/../open_spiel/game_parameters.h:133:8: error: explicit specialization of 'value' in class scope
  bool value() const {
       ^
/repo/open_spiel/../open_spiel/game_parameters.h:137:47: error: explicit specialization of 'value' in class scope
  const std::map<std::string, GameParameter>& value() const {
                                              ^
/repo/open_spiel/../open_spiel/game_parameters.h:141:40: error: explicit specialization of 'value' in class scope
  std::map<std::string, GameParameter> value() const {
                                       ^
In file included from /repo/open_spiel/policy.cc:15:
In file included from /repo/open_spiel/../open_spiel/policy.h:25:
In file included from /repo/open_spiel/../open_spiel/spiel.h:36:
/repo/open_spiel/../open_spiel/game_parameters.h:117:7: error: explicit specialization of 'value' in class scope
  int value() const {
      ^
/repo/open_spiel/../open_spiel/game_parameters.h:121:10: error: explicit specialization of 'value' in class scope
  double value() const {
         ^
/repo/open_spiel/../open_spiel/game_parameters.h:125:22: error: explicit specialization of 'value' in class scope
  const std::string& value() const {
                     ^
/repo/open_spiel/../open_spiel/game_parameters.h:129:15: error: explicit specialization of 'value' in class scope
  std::string value() const {
              ^
/repo/open_spiel/../open_spiel/game_parameters.h:133:8: error: explicit specialization of 'value' in class scope
  bool value() const {
       ^
/repo/open_spiel/../open_spiel/game_parameters.h:137:47: error: explicit specialization of 'value' in class scope
  const std::map<std::string, GameParameter>& value() const {
                                              ^
/repo/open_spiel/../open_spiel/game_parameters.h:141:40: error: explicit specialization of 'value' in class scope
  std::map<std::string, GameParameter> value() const {
                                       ^
In file included from /repo/open_spiel/simultaneous_move_game.cc:15:
In file included from /repo/open_spiel/../open_spiel/simultaneous_move_game.h:22:
In file included from /repo/open_spiel/../open_spiel/spiel.h:36:
/repo/open_spiel/../open_spiel/game_parameters.h:117:7: error: explicit specialization of 'value' in class scope
  int value() const {
      ^
@lanctot
Copy link
Collaborator

lanctot commented Aug 26, 2020

Ah yes, we fixed this recently on the colab hosts as well. It is caused by old version of Clang that ships with Ubuntu 18.04. It is not caught by our Travis-CI tests because they use a newer version of clang.

I think the quick fix is to simply move to Ubuntu 20.04. That involves changing two lines in the Dockerfile:

  1. Change the first line of the Dockerfile to 20.04.
  2. You also have to add the -y to the apt-get install command in install.sh. See here for details: Ubuntu 20.04 Docker container #295

If this works for you I'd be happy if you submit a PR with an updated Ubuntu 20.04 image.

@lanctot
Copy link
Collaborator

lanctot commented Aug 27, 2020

I have fixed this and will be syncing to github shortly, thanks for reporting.

@andyljones
Copy link
Contributor

If anyone else runs into this problem on Ubuntu 18, you can fix it with

apt-get install clang-10
ln -s $(which clang-10) /usr/bin/clang++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants