google-deepmind / lab

A customisable 3D platform for agent-based AI research

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bazel Build Error: no such target '@platforms//cpu:wasm32': target 'wasm32' not declared in package 'cpu'

Alvinosaur opened this issue · comments

Hi,

I'm running on Ubuntu 18.04 and have already downloaded the dependencies for Ubuntu
However, when running the build command bazel build -c opt //:deepmind_lab.so or any other bazel run command, I get the following error output:

(venv) alvin@alvin:~/research/github/16824/project/representation-exploration/deepmind-lab$ bazel build -c opt //:deepmind_lab.so
ERROR: /home/alvin/.cache/bazel/_bazel_alvin/cb0427cb60a7996d760eba5f25e35181/external/com_google_absl/absl/BUILD.bazel:84:1: 
no such target '@platforms//cpu:wasm32': target 'wasm32' not declared in package 'cpu' defined by /home/alvin/.cache/bazel/_bazel_alvin/cb0427cb60a7996d760eba5f25e35181/external/platforms/cpu/BUILD and referenced by '@com_google_absl//absl:platforms_wasm32'
ERROR: While resolving configuration keys for @com_google_absl//absl:wasm_3: Analysis failed
ERROR: While resolving configuration keys for @com_google_absl//absl/base:base: Analysis failed
ERROR: Analysis of target '//:deepmind_lab.so' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.179s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 7 targets configured)
    Fetching @glib_archive; fetching

After reading this debugging guide on Bazel (https://docs.bazel.build/versions/0.24.0/tutorial/cc-toolchain-config.html), I tried and failed to find where the @platform package is defined in one of the multiple BUILD files. The cpu package doesn't seem to be specific to this repository either, so I tried reinstalling Bazel, but this also didn't help.

Bazel is currently at version 5.1.0. Are you still using version 0.24? Could you please try again with a more recent version?

That resolved the original issue. I was using bazel 3.1.0, and after upgrading to 5.1.0, the error disappeared.
I got more errors similar to

INFO: Analyzed target //:deepmind_lab.so (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: .../BUILD:951:10: Linking libdmlab_headless_hw.so failed: (Exit 1): gcc failed: error executing command 
....
/usr/bin/ld.gold: error: cannot find -lEGL
/usr/bin/ld.gold: error: cannot find -lGL
bazel-out/k8-opt/bin/external/lua_archive/_objs/lua/loslib.pic.o:loslib.c:function os_tmpname: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
collect2: error: ld returned 1 exit status
Target //:deepmind_lab.so failed to build
INFO: Elapsed time: 0.829s, Critical Path: 0.39s
INFO: 7 processes: 7 internal.
FAILED: Build did NOT complete successfully

Following (https://askubuntu.com/a/616076 and #178), I created the symlinks for libGL.so.1 -> libEGL.so and libEGL.so.1 -> libGL.so and this fixed the error.

I honestly just chose libGL.so.1 and libEGL.so.1 because they looked the most similar. Is this alright to do?

The GL libraries should be installed as part of your video driver I believe. EGL is a separate library and should be available as something like libegl-dev. (It dispatches to the video driver eventually.)