google-deepmind / lab

A customisable 3D platform for agent-based AI research
Other
7.06k stars 1.36k forks source link

Build fails with message about C++14 being required even with a C++14-capable compiler #241

Closed gspr closed 1 year ago

gspr commented 1 year ago

I don't know if the latest git head is supposed to work at any time, but the tagged releases are unusable due to broken checksums(!), so git head it is (2e17923bb2fd727cc179dd4a23f9781ec7a6f363). GCC 10.2 should be plenty C++-14 capable, but the build attempts fail with

ERROR: /home/user/.cache/bazel/_bazel_user/40a2381252150da40396219c05ce7670/external/com_google_absl/absl/hash/BUILD.bazel:150:11: Compiling absl/hash/internal/low_level_hash.cc failed: (Exit 1): gcc failed: error executing command (from target @com_google_absl//absl/hash:low_level_hash) 
  (cd /home/user/.cache/bazel/_bazel_user/40a2381252150da40396219c05ce7670/sandbox/processwrapper-sandbox/415/execroot/org_deepmind_lab && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PWD=/proc/self/cwd \
  /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 -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-opt/bin/external/com_google_absl/absl/hash/_objs/low_level_hash/low_level_hash.pic.d '-frandom-seed=bazel-out/k8-opt/bin/external/com_google_absl/absl/hash/_objs/low_level_hash/low_level_hash.pic.o' -fPIC -iquote external/com_google_absl -iquote bazel-out/k8-opt/bin/external/com_google_absl -Wall -Wextra -Wcast-qual -Wconversion-null -Wformat-security -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wundef -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -DNOMINMAX -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_absl/absl/hash/internal/low_level_hash.cc -o bazel-out/k8-opt/bin/external/com_google_absl/absl/hash/_objs/low_level_hash/low_level_hash.pic.o)
# Configuration: 9c8d3e90f17daf8d5c6ed4cdca7ecedb3c834be8857725de5836a6c054b593db
# Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/com_google_absl/absl/base/config.h:86,
                 from external/com_google_absl/absl/hash/internal/low_level_hash.h:31,
                 from external/com_google_absl/absl/hash/internal/low_level_hash.cc:15:
external/com_google_absl/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
   79 | #error "C++ versions less than C++14 are not supported."
      |  ^~~~~
Target //:deepmind_lab.so failed to build

As we can see, something somewhere sets the -std=c++0x compiler flag, but I'm unable to find where due to not knowing Bazel.

tkoeppe commented 1 year ago

DeepMind Lab was made to require only C++11. But Abseil has since dropped support for C++11. We aren't setting any language flags explicitly, but you can add your own .bazelrc file yourself if you like, similar to https://github.com/deepmind/lab/blob/2e17923bb2fd727cc179dd4a23f9781ec7a6f363/.precommit.bazelrc#L6 or to https://github.com/deepmind/lab2d/blob/main/.bazelrc (but set --std=c++14 or c++17).

(We should probably update the precommit-bazelrc file here so that the GitHub tests continue working.)

gspr commented 1 year ago

Thanks, that's most helpful.