google-deepmind / lab2d

A customisable 2D platform for agent-based AI research

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

building on m1

akbir opened this issue · comments

Hi guys, cross-post from MeltingPot

Running, as suggested by MeltingPot readme, bazel build -c opt --define=lua=5_1 --verbose_failures //dmlab2d:dmlab2d_wheel --sandbox_debug, I get the following error message:

Seems like the bazel build is still trying to use luajit.
Appreciate this is very in the weeds - any help with Bazel is very appreciated or if you could provide your m1 specific wheels that'd be super helpful!

INFO: Analyzed target //dmlab2d:dmlab2d_wheel (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_akbirkhan/683a2f238f2fee5ed6a000bb83905b18/external/luajit_archive/BUILD.bazel:187:10: Compiling src/host/buildvm.c [for host] failed: (Aborted): sandbox-exec failed: error executing command
  (cd /private/var/tmp/_bazel_akbirkhan/683a2f238f2fee5ed6a000bb83905b18/sandbox/darwin-sandbox/68/execroot/org_deepmind_lab2d && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=12.1 \
    DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
    PATH=/Users/akbirkhan/lab2d/venv/bin:/opt/homebrew/opt/openjdk/bin:/Users/akbirkhan/miniforge3/condabin:/Users/akbirkhan/.pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin \
    SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk \
    TMPDIR=/var/folders/y9/rn_jfyp116vghh2czk_zrsyh0000gr/T/ \
    XCODE_VERSION_OVERRIDE=13.2.1.13C100 \
    ZERO_AR_DATE=1 \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_akbirkhan/683a2f238f2fee5ed6a000bb83905b18/sandbox/darwin-sandbox/68/sandbox.sb /var/tmp/_bazel_akbirkhan/install/aea2566887193b2d7f5a5c3a673ef137/process-wrapper '--timeout=0' '--kill_delay=15' external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG '-DNS_BLOCK_ASSERTIONS=1' 'DEBUG_PREFIX_MAP_PWD=.' -iquote external/luajit_archive -iquote bazel-out/host/bin/external/luajit_archive -iquote external/bazel_tools -iquote bazel-out/host/bin/external/bazel_tools -isystem external/luajit_archive/src -isystem bazel-out/host/bin/external/luajit_archive/src -isystem external/luajit_archive/src/host -isystem bazel-out/host/bin/external/luajit_archive/src/host -MD -MF bazel-out/host/bin/external/luajit_archive/_objs/buildvm/buildvm.d '-frandom-seed=bazel-out/host/bin/external/luajit_archive/_objs/buildvm/buildvm.o' -isysroot __BAZEL_XCODE_SDKROOT__ -F__BAZEL_XCODE_SDKROOT__/System/Library/Frameworks -F__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/MacOSX.platform/Developer/Library/Frameworks '-mmacosx-version-min=12.1' -no-canonical-prefixes -pthread -g0 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -target arm64-apple-macosx -c external/luajit_archive/src/host/buildvm.c -o bazel-out/host/bin/external/luajit_archive/_objs/buildvm/buildvm.o)
external/luajit_archive/src/host/buildvm.c:63:10: fatal error: '../dynasm/dasm_arm64.h' file not found
#include "../dynasm/dasm_arm64.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Error in child process '/usr/bin/xcrun'. 1
Target //dmlab2d:dmlab2d_wheel failed to build
INFO: Elapsed time: 0.451s, Critical Path: 0.32s
INFO: 9 processes: 9 internal.
FAILED: Build did NOT complete successfully

i got this to work using bazel build --config=lua5_2 --verbose_failures //dmlab2d:dmlab2d_wheel

We changed the way the configurable flag works a while ago, so now you need to use the new flag. See the .bazelrc file for how it's spelled (--config=lua5_2 activates the flag). Both Lua 5.1 and 5.2 should work on Mac.

thank you for clarifying!