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

Error after installing quill on M1 mac #88

Open
tomburgerch opened this issue Dec 5, 2021 · 13 comments
Open

Error after installing quill on M1 mac #88

tomburgerch opened this issue Dec 5, 2021 · 13 comments

Comments

@tomburgerch
Copy link

I'm on an M1 mac and I've downloaded the latest release. After making the binary executable ('sudo chmod +x quill-macos-x86_64'), I get the following error when I try to run quill:

dyld: Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib
  Referenced from: /Users/[...]/./quill-macos-x86_64
  Reason: image not found
zsh: abort      ./quill-macos-x86_64

I have openssl installed via brew and it's at the following version:

 % openssl
OpenSSL> version
LibreSSL 2.8.3

Could someone help me get quill to run?

@chmllr
Copy link
Member

chmllr commented Dec 5, 2021

Hi Cedric, I remember that it must be the openssl version referenced by the build. Please try to install 1.1:

brew install openssl@1.1

Also, if I'm not mistaken if you see LibreSSL then this is not the version you installed with homebrew, but the one distributed with macOS. Here's how the path to the binary looks like on my machine:

$ which openssl
/usr/local/opt/openssl@1.1/bin/openssl

@tomburgerch
Copy link
Author

Thank you Christian, I've installed version 1.1 and I followed the instructions to make OpenSSL the default version and also expose it to compilers. It seems it's now pointing to the right version of OpenSSL:

% which openssl
/opt/homebrew/opt/openssl@1.1/bin/openssl
% openssl version
OpenSSL 1.1.1l  24 Aug 2021

But I still can't execute Quill:

% ./quill-macos-x86_64
dyld: Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib
  Referenced from: /Users/[...]/./quill-macos-x86_64
  Reason: image not found
zsh: abort      ./quill-macos-x86_64

Any idea what this may be due to?

@chmllr
Copy link
Member

chmllr commented Dec 6, 2021

Is this file actually available on your file system: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib ?

@tomburgerch
Copy link
Author

tomburgerch commented Dec 7, 2021 via email

@tomburgerch
Copy link
Author

Update: I've created a symlink so that what's inside homebrew/opt/ can be found within /usr/local/opt.

However now I'm getting this error:

cedricwaldburger@dubai dfinity % ./quill-macos-x86_64
dyld: Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib
  Referenced from: /Users/[...]/dfinity/./quill-macos-x86_64
  Reason: no suitable image found.  Did find:
	/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib: mach-o, but wrong architecture
	/opt/homebrew/Cellar/openssl@1.1/1.1.1l_1/lib/libssl.1.1.dylib: mach-o, but wrong architecture
zsh: abort      ./quill-macos-x86_64

I'm doing this on an M1 Mac - is there a workaround to get it running?

@chmllr
Copy link
Member

chmllr commented Dec 7, 2021

Yeah, this is what I suspected: homebrew on M1 is apparently using a different file structure.
Another question: Are you're running the mac build as a normal binary? You actually need to run it in an emulated mode, since it's not compiled for the M1 architecture. I have no further suggestions at that point as I have no M1 machine and no experience in this field. I just know that people get very complex Intel apps running, so it can't be that hard.

I know that @dprats has some experience. Diego, did you get quill running on M1?

@tomburgerch
Copy link
Author

Thank you for the insights. I've messaged Diego. Before I go through too much trouble to get quill to work on my M1 - do you know if quill supports identities (as needed to manage ECT neurons)?

@chmllr
Copy link
Member

chmllr commented Dec 8, 2021

Sorry I do not know anything about ECTs. @jwiegley @timohanke are you able to answer this question, guys?

@dubecker
Copy link

Has there been any progress on this issue? I am facing exactly the same problem when trying to run quill on Mac M1.

@tomburgerch
Copy link
Author

I got mine to work by using a Rosetta (emulated) shell. However, I tried installing for a community member as well and kept running into issues there.

@davidhq
Copy link

davidhq commented Dec 22, 2022

I also cannot compile or use released binary on my M1 MacBook.... with Rosetta or normal.

I don't use homebrew, use nix instead... maybe that's an additional factor... but this is the first time some package wouldn't work because it's installed via nix instead of homebrew... this worked flawlessly always.

Maybe I try to install homebrew and see if quill works at all then... if not, then it seems that M1 users are out of luck with quill... which I think it's a pretty big issue, only getting bigger.

@davidhq
Copy link

davidhq commented Dec 22, 2022

errors (normal arm64 architecture, no Rosetta):

~/Downloads$ ./quill-macos-x86_64
dyld[85097]: Library not loaded: '/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib'
  Referenced from: '/Users/david/Downloads/quill-macos-x86_64'
  Reason: tried: '/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib' (no such file), '/usr/local/lib/libssl.1.1.dylib' (no such file), '/usr/lib/libssl.1.1.dylib' (no such file)
Abort trap: 6

This is kind of expected since I don't have /usr/local/opt (this is usually provided by homebrew), my openssl package is elsewhere (via nix).

When I create a symlink like this:

/usr/local/opt/openssl@1.1 -> /nix/store/11zigh0h3y7ipmd75rv1ywrsm2f68nrm-openssl-1.1.1n

I get

~/Downloads$ ./quill-macos-x86_64
dyld[84412]: Library not loaded: '/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib'
  Referenced from: '/Users/david/Downloads/quill-macos-x86_64'
  Reason: tried: '/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/usr/local/lib/libssl.1.1.dylib' (no such file), '/usr/lib/libssl.1.1.dylib' (no such file), '/nix/store/11zigh0h3y7ipmd75rv1ywrsm2f68nrm-openssl-1.1.1n/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/usr/local/lib/libssl.1.1.dylib' (no such file), '/usr/lib/libssl.1.1.dylib' (no such file)
Abort trap: 6

Which is again expected since quill release for macos seems to only be compiled for i386.

When I try to compile myself I get this:

cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  run pkg_config fail: "`\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"` did not exit successfully: exit status: 1\nerror: could not find system library 'openssl' required by the 'openssl-sys' crate\n\n--- stderr\nPackage openssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `openssl.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'openssl' found\n"

  --- stderr
  thread 'main' panicked at '

  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = aarch64-apple-darwin
  $TARGET = aarch64-apple-darwin
  openssl-sys = 0.9.74

  ', /Users/david/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.74/build/find_normal.rs:191:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
make: *** [release] Error 101

This could be because it is hardcoded too tightly with homebrew or something else is going on, I tried setting OPENSSL_DIR as well but no luck... maybe it finds the right path but then subfolders there are different (inside my openssl@1.1 directory mimicking homebrew but actually nix).

Looks like that the only path would be homebrew+rosetta but not sure if I'd screw up my setup by installing homebrew and if it would then be easy to remove .. I don't want it on my system for longer than one day and also have to be sure it's entirely gone afterwards... 💡 I just remembered I have another older MacBook where I can probably run quill... will try tomorrow.

I hope this report was somewhat useful and that others who do use homebrew can provide info it it's possible to get it running at least within Rosetta... and then maybe in some time developers can make all of this work on M1 independent on how openssl is installed (homebrew, nix etc.). If nobody can make it work on M1 currently then probably this issue has to get a bit more priority because it's quite important for the entire developer ecosystem for this to be working on arm64 architecture.... since vast majority of other things are now working with no issues.

thank you!

@adamspofford-dfinity
Copy link
Contributor

Is this still an issue with latest quill?

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

5 participants