google-deepmind / lab2d

A customisable 2D platform for agent-based AI research

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation error on ubuntu

kinalmehta opened this issue · comments

Tried installing with wheel file with pip but it raised the error

ERROR: dmlab2d-1.0-cp39-cp39-manylinux_2_31_x86_64.whl is not a supported wheel on this platform.

Error compiling the library on ubuntu

(marl) ➜  lab2d git:(main) cat /etc/os-release                
NAME="Ubuntu"
VERSION="16.04.7 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.7 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
  • Bazel -> 4.0.0
  • Lua -> 5.1.5
  • python -> 3.9.7
  • python libs
    • packaging -> 21.3
    • numpy -> 1.22
    • pygame -> 2.1.2

Error:

(marl) ➜  lab2d git:(main) bazel build -c opt --define=lua=5_2 //dmlab2d:dmlab2d_wheel
WARNING: Output base '/home2/kinal.mehta/.cache/bazel/_bazel_kinal.mehta/776ac33cd29ba70c2d6d5bfa82a6d2d6' is on NFS. This may lead to surprising failures and undetermined behavior.
Starting local Bazel server and connecting to it...
INFO: SHA256 (https://github.com/bazelbuild/bazel-skylib/archive/main.zip) = 16d40a28a09bf72fe915c6ecf612bf5b8578918b9784b1e0716f606692c44b26
DEBUG: Rule 'bazel_skylib' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "16d40a28a09bf72fe915c6ecf612bf5b8578918b9784b1e0716f606692c44b26"
DEBUG: Repository bazel_skylib instantiated at:
  /home2/kinal.mehta/marl/lab2d/WORKSPACE:30:13: in <toplevel>
Repository rule http_archive defined at:
  /home2/kinal.mehta/.cache/bazel/_bazel_kinal.mehta/776ac33cd29ba70c2d6d5bfa82a6d2d6/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: SHA256 (https://github.com/bazelbuild/rules_python/archive/main.zip) = ad1b6cdf525b1a7c50b27f2df32863d30d1cce12f855b5e038e33650af5021d8
DEBUG: Rule 'rules_python' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "ad1b6cdf525b1a7c50b27f2df32863d30d1cce12f855b5e038e33650af5021d8"
DEBUG: Repository rules_python instantiated at:
  /home2/kinal.mehta/marl/lab2d/WORKSPACE:24:13: in <toplevel>
Repository rule http_archive defined at:
  /home2/kinal.mehta/.cache/bazel/_bazel_kinal.mehta/776ac33cd29ba70c2d6d5bfa82a6d2d6/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: SHA256 (https://github.com/deepmind/dm_env/archive/3c6844db2aa4ed5994b2c45dbfd9f31ad948fbb8.zip) = 64e62362f5b0f27edccc54b9d9a41f450436be59cf1844e8fe74f934eda35825
DEBUG: Rule 'dm_env_archive' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "64e62362f5b0f27edccc54b9d9a41f450436be59cf1844e8fe74f934eda35825"
DEBUG: Repository dm_env_archive instantiated at:
  /home2/kinal.mehta/marl/lab2d/WORKSPACE:130:13: in <toplevel>
Repository rule http_archive defined at:
  /home2/kinal.mehta/.cache/bazel/_bazel_kinal.mehta/776ac33cd29ba70c2d6d5bfa82a6d2d6/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/main.zip) = 3839996049629e6377abdfd04681ddeeb0cc3db13b9d2ff81bf46700cb4529f7
DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "3839996049629e6377abdfd04681ddeeb0cc3db13b9d2ff81bf46700cb4529f7"
DEBUG: Repository rules_cc instantiated at:
  /home2/kinal.mehta/marl/lab2d/WORKSPACE:18:13: in <toplevel>
Repository rule http_archive defined at:
  /home2/kinal.mehta/.cache/bazel/_bazel_kinal.mehta/776ac33cd29ba70c2d6d5bfa82a6d2d6/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: SHA256 (https://pypi.python.org/packages/94/4a/db842e7a0545de1cdb0439bb80e6e42dfe82aaeaadd4072f2263a4fbed23/funcsigs-1.0.2.tar.gz) = a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50
DEBUG: Rule 'funcsigs_archive' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50"
DEBUG: Repository funcsigs_archive instantiated at:
  /home2/kinal.mehta/marl/lab2d/WORKSPACE:48:13: in <toplevel>
Repository rule http_archive defined at:
  /home2/kinal.mehta/.cache/bazel/_bazel_kinal.mehta/776ac33cd29ba70c2d6d5bfa82a6d2d6/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: SHA256 (https://github.com/pybind/pybind11/archive/master.zip) = 209fb4cf4a8cdd48c47cf185d2a00361567e4b873fda79e7d99d4c3ee14ea4b0
DEBUG: Rule 'pybind11_archive' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "209fb4cf4a8cdd48c47cf185d2a00361567e4b873fda79e7d99d4c3ee14ea4b0"
DEBUG: Repository pybind11_archive instantiated at:
  /home2/kinal.mehta/marl/lab2d/WORKSPACE:144:13: in <toplevel>
Repository rule http_archive defined at:
  /home2/kinal.mehta/.cache/bazel/_bazel_kinal.mehta/776ac33cd29ba70c2d6d5bfa82a6d2d6/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: SHA256 (https://github.com/abseil/abseil-cpp/archive/master.zip) = 39758d90c106d3a6b79b6c7851a9379bb06c72283431e1396053c9c7bd267b54
DEBUG: Rule 'com_google_absl' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "39758d90c106d3a6b79b6c7851a9379bb06c72283431e1396053c9c7bd267b54"
DEBUG: Repository com_google_absl instantiated at:
  /home2/kinal.mehta/marl/lab2d/WORKSPACE:36:13: in <toplevel>
Repository rule http_archive defined at:
  /home2/kinal.mehta/.cache/bazel/_bazel_kinal.mehta/776ac33cd29ba70c2d6d5bfa82a6d2d6/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: Analyzed target //dmlab2d:dmlab2d_wheel (75 packages loaded, 1631 targets configured).
INFO: Found 1 target...
ERROR: /home2/kinal.mehta/marl/lab2d/dmlab2d/lib/util/BUILD:37:11: Compiling dmlab2d/lib/util/file_reader.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 23 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 23 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from dmlab2d/lib/util/file_reader.cc:17:0:
./dmlab2d/lib/util/file_reader.h:24:19: error: expected '{' before '::' token
 namespace deepmind::lab2d::util {
                   ^
./dmlab2d/lib/util/file_reader.h:24:21: error: 'lab2d' in namespace '::' does not name a type
 namespace deepmind::lab2d::util {
                     ^
dmlab2d/lib/util/file_reader.cc:23:19: error: expected '{' before '::' token
 namespace deepmind::lab2d::util {
                   ^
dmlab2d/lib/util/file_reader.cc:23:21: error: 'lab2d' in namespace '::' does not name a type
 namespace deepmind::lab2d::util {
                     ^
dmlab2d/lib/util/file_reader.cc:47:1: error: expected '}' at end of input
 }  // namespace deepmind::lab2d::util
 ^
dmlab2d/lib/util/file_reader.cc:47:1: error: expected '}' at end of input
Target //dmlab2d:dmlab2d_wheel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 18.492s, Critical Path: 1.04s
INFO: 46 processes: 41 internal, 5 linux-sandbox.
FAILED: Build did NOT complete successfully

Could this be because of the older Ubuntu version? Any solution to this problem?

Your code seems to fail to compile, so I take it the bit about pip and wheels is not actually the real issue?

Looks like your compiler isn't in C++17 mode. Make sure you have a sufficiently modern C++ compiler.

Got it, default on ubuntu 16.04 was gcc 5 and g++ 5. Solved it by using conda variants of the compilers with bazel 5.0 from conda.
Thank you