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

build lab2d on m1 chip #13

Closed
akbir opened this issue Feb 17, 2022 · 4 comments
Closed

build lab2d on m1 chip #13

akbir opened this issue Feb 17, 2022 · 4 comments

Comments

@akbir
Copy link

akbir commented Feb 17, 2022

Hi guys, not sure if this issue should exist here or on lab2d - i'm happy to repost if necessary.

Running, as suggested by the 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.

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
@akbir akbir changed the title building on m1 chip build lab2d on m1 chip Feb 17, 2022
@akbir
Copy link
Author

akbir commented Feb 17, 2022

Got this to build using the following command!

bazel build --config=lua5_2 --verbose_failures //dmlab2d:dmlab2d_wheel

Can open a PR to fix in the README if authors are cool with this

@duenez
Copy link
Collaborator

duenez commented Feb 17, 2022

Thank you for the heads up! Yes, it seems one needs 5_2 for the m1. It should be fine, as lab2d is compatible with that Lua version. We will update the docs to fix this for others.

Good luck!

Edgar

copybara-service bot pushed a commit that referenced this issue Feb 17, 2022
… needed to successfully build lab2d on m1 chips. See: #13

PiperOrigin-RevId: 429342857
Change-Id: I8d758425b84a8b2ef640a867390837da798edec3
@duenez duenez closed this as completed Feb 18, 2022
@akbir
Copy link
Author

akbir commented Feb 19, 2022

hey @duenez - i think the problem was the arguments need to be passed through via --config as opposed to -c opt --define!

mentioned here: google-deepmind/lab2d#14 (comment)

@YetAnotherPolicy
Copy link

Hi, on my MacBook Prof M1, if you cannot build the wheel file, please uninstall lua and luajit by using brew. Then it can build the wheel file.

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