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

compilation succeeded, but the on_load function failed on my macbook pro (Big Sur) with apple M1 chip #87

Closed
zhangzhen opened this issue Dec 2, 2021 · 3 comments

Comments

@zhangzhen
Copy link

zhangzhen commented Dec 2, 2021

How can I solve this issue?
Error messages printed on the console where livebook is started:

10:03:43.111 [warn] The on_load function for module Elixir.Explorer.PolarsBackend.Native returned:
{:error,
{:load_failed,
'Failed to load NIF library: 'dlopen(/Users/zhangzh/Library/Caches/mix/installs/elixir-1.12.3-erts-12.1/c8c0b2eb20455bd67cc55fc3c3acd0de/_build/prod/lib/explorer/priv/native/libexplorer.so, 2): no suitable image found. Did find:\n\t/Users/zhangzh/Library/Caches/mix/installs/elixir-1.12.3-erts-12.1/c8c0b2eb20455bd67cc55fc3c3acd0de/_build/prod/lib/explorer/priv/native/libexplorer.so: mach-o, but wrong architecture\n\t/Users/zhangzh/Library/Caches/mix/installs/elixir-1.12.3-erts-12.1/c8c0b2eb20455bd67cc55fc3c3acd0de/_build/prod/lib/explorer/priv/native/libexplorer.so: stat() failed with errno=35''}}

=========

➜  ~ file /Users/zhangzh/test/my_app/_build/dev/lib/explorer/priv/native/libexplorer.so
/Users/zhangzh/test/my_app/_build/dev/lib/explorer/priv/native/libexplorer.so: Mach-O 64-bit dynamically linked shared library x86_64

elixir: 1.12.3-otp-24
erlang: 24.1
rustc: 1.56.1 (59eed8a2a 2021-11-01)

@josevalim
Copy link
Member

I assume you are using Apple M1 or similar? The error says that one of the libraries used by Explorer is x86_64, but it doesn't say which one. Given it is dynamically linked, it is most likely a system library. You could try to use otool to debug it:

$ otool -L /Users/zhangzh/test/my_app/_build/dev/lib/explorer/priv/native/libexplorer.so

Also try otool with no arguments to see other flags available.

@zhangzhen
Copy link
Author

@josevalim re-installing rust solved this issue. Apple M1 macbook I'm using was transferred from my old Intel macbook.

@josevalim
Copy link
Member

Fantastic!

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

2 participants