example-helloworld: solana-test-validator Library not loaded error

m1 chip macOS 11.3.1 node version v14.16.1

when start solana-test-validator

dyld: Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib
  Referenced from: /Users/123/.local/share/solana/install/active_release/bin/solana-test-validator
  Reason: image not found
zsh: abort      solana-test-validator

google searched this thread: https://stackoverflow.com/questions/59006602/dyld-library-not-loaded-usr-local-opt-openssl-lib-libssl-1-0-0-dylib

but can’t switch openssl vserion

Error: Unknown command: switch

tried different node versions tried reinstall xcode and brew with no luck

which openssl
/usr/bin/openssl
cd /usr/local/opt/openssl@1.1
cd: no such file or directory: /usr/local/opt/openssl@1.1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 34 (3 by maintainers)

Most upvoted comments

I get that this is an M1 problem, but literally anyone doing default install is going to be presented with this issue. I’m not sure why this is being closed.

Further, Rosetta was always designed to be a work around/temporary. Rosetta isn’t even supported in all regions - https://9to5mac.com/2021/03/02/apple-may-disable-rosetta-2-on-m1-macs-in-some-regions-macos-11-3-code-suggests/

I get that this is not the top priority, but it makes it quite difficult to support the Solana ecosystem.

@Mihail-Madzharov

Is someone working on fix for M1?

You can try with this guide of jaso from discord (https://discord.com/channels/428295358100013066/517163444747894795/884262811260289054):

I ran into trouble trying to build solana binaries with Apple M1 chip so I will post what made it work for me here (and anyone can always DM me if you run into trouble):

  1. Make sure you install rosetta and then install homebrew with a shell that is using rosetta: https://5balloons.info/correct-way-to-install-and-use-homebrew-on-m1-macs/
  2. Make sure you also install rust/cargo/rustup inside that rosetta shell as well bc it will target x86_64 instead of aarch64
  3. then install solana by following the “Build From Source” at the bottom of: https://docs.solana.com/cli/install-solana-cli-tools you may run into an issue with openssl, if you do, then brew install openssl (once again inside the rosetta shell)

Someone needs to start working on full M1 compatibility, Apple is only making those from now on. It makes no sense to rely on Roseta today unless it is a temporary workaround (no one confirmed it is the case).

I can confirm this error on Mac M1. Even after linking the right library the message I get is

Referenced from: /Users/mohitkumar/.local/share/solana/install/active_release/bin/solana-test-validator 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.1k/lib/libssl.1.1.dylib: mach-o, but wrong architecture

It looks like M1 is not supported right now. can you guys put instructions on how to compile for M1 ?

You can set your config URL to https://api.devnet.solana.com solana config set --url https://api.devnet.solana.com

@jstarry Not sure why you closed this issue. A valid solution was not provided and it seems this will become evermore problematic as Apple will only be producing laptops with M1 chips.

The macos release binaries are not suitable for M1 silicon in any configuration as they are built for x86_64 arch with AVX and AVX2 extensions available. Building them from scratch under Rosetta is the workaround for now. See https://github.com/solana-labs/solana/blob/master/README.md#building