-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
unable to use anchor on arm #95
Comments
The issue is suspected to be in the idl parsing at the moment, since
|
Related solana-labs/solana#16072 |
Labeling as blocked. Solana toolchain binaries don't run on M1 according to the linked issue above. |
Recently addressed on the solana end solana-labs/solana#16346. |
Most of the solana toolchain seems to be working now quite well on a m1. I managed to compile examples with anchor and deploy them to a local-test-validator using |
Note that I don't own an M1 and so don't plan on directly addressing this myself--though I'm happy to closely work with and help anyone that decides to take on this issue. |
@mschneider Solana v1.7 fixes most (if not all) of the M1 compatibility issues in my testing. If you want to get anchor to work on M1 you can manually update the cargo dependencies to 1.7 and build it from source. So far it's been working a treat for me the last few days. Happy to help if you have any issues. |
How did you install 1.7? From source or via solana-install?
…On Tue 8. Jun 2021 at 10:57, Tristan F ***@***.***> wrote:
@mschneider <https://github.com/mschneider> Solana v1.7 fixes most (if
not all) of the M1 compatibility issues in my testing. If you want to get
anchor to work on M1 you can manually update the cargo dependencies to 1.7
and build it from source. So far it's been working a treat for me the last
few days. Happy to help if you have any issues.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABDF7HN4QG32ZCGJ2XEXUTTRYVTXANCNFSM4YJZRX3Q>
.
|
@mschneider you can try using anchor git dependencies in your Cargo.toml pointing at this branch #368. And install the 1.7.1 solana cli. Once I confirm the 1.7 toolchain is ready for mainnet, I'll merge that PR and publish a release. |
@mschneider pretty much what @armaniferrante said, just update the package dependencies in the respective Cargo.toml files and you can install the latest solana-cli using |
A few caveats: 1.7.1's solana-test-validator crashes for me on launch
Here is what I did instead to bring one up:
|
Next I installed solana and the anchor-cli locally:
I also used
|
@mschneider does |
Yes it does, looks like you have issues with your home brew installation.
…On Wed 9. Jun 2021 at 14:32, NorbertBodziony ***@***.***> wrote:
@mschneider <https://github.com/mschneider> does solana-test-validator
works for you ? I am getting
solana-test-validator dyld: Library not loaded: ***@***.***
/lib/libssl.1.1.dylib
Maybe thats why it fails ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABDF7GXAHIKV2NPU5UMZPTTR6XTJANCNFSM4YJZRX3Q>
.
|
@NorbertBodziony I had that error too, running |
#368 has been working great for me on M1. Appreciate it! |
Managed to make it work. #368 + custom solana-test-validator build from 1.7.1 solana branch |
Addressed by #368. Please re-open if there are still problems. |
@NorbertBodziony I'm facing the same issue with Solana v1.7.9. Not sure how to use #368 for solving the issue. Can you please help? |
I would stick to 1.7.1 at least it works for me. |
I have switched to solana v1.7.1. The installation is valid as I can run basic commands like
like you mentioned you had gotten. |
The problem is that when I run:
Also getting an error at this point, running M1 Mac in Rosetta terminal, Solana CLI version [1] 17452 illegal hardware instruction solana-test-validator Update: Following the instructions here, but not running https://docs.solana.com/cli/install-solana-cli-tools#build-from-source Then go to
This will install the
Replace $PROJECT_ROOT with your Solana project folder. |
@dabit3 Nice. I ended up switching to my Linux machine and found no issues there. |
@dabit3 how did you build it from source on m1? I'm not having any luck here, on neither 1.7.1 nor 1.7.11 |
Figured it out, my issue was very dumb. It's depending on To fix the SSL error, symlink it manually:
|
Was beating my head against a wall trying to build from source, ended up running into the same problem as @dvcrn. This comment in the cargo-install-all.sh needs to be emphasised:
|
I was able to build from source and start a local test validator, thanks to @dabit3, but I can't run the example hello world program ( https://github.com/solana-labs/example-helloworld/blob/master/README.md ) When I run: I get this error: |
@sandrocan which directory are you running |
@dabit3 |
You should be running So
|
That makes sense. Sorry I've been really confused after trying to get the validator to run. Will try that now. Thanks for your quick response and help @dabit3 ! Much appreciated! |
Slight elaboration and change on instructional provided by @dabit3 (which is how I figured this out, so thank you very much for posting this):installed on ARM64 terminal. To verify this type "arch" in the terminal. If it says i386 it's Rosetta Build from source allows you functionality for both solana-test-validator and allows one to utilize the anchor environment to build and test. You can use cargo build and cargo test but that will not populate the target/idl with the proper artifacts needed.
In the below instructions, Go to sdk/cargo-build-bpf from the $ cargo install --path . Verify the path created by opening a separate terminal and navigating to ~/.cargo/bin. List the contents of bin with: $ ln -l. You will either see SDK or cargo-build-bpf. On my Mac M1 chip running Monterey, I found the path to end with the latter. So, On an apple M1 chip the cargo-build-bpf program is installed to the path ~/.cargo/bin/cargo-build-bpf. This will allow you to run commands like $ anchor build successfully in your local project root once you create a symlink from it to the path in your Solana source code/bin/sdk folder. In a separate terminal navigate to ~/.cargo/bin and create a symlink to the sdk folder in the $ ln -s solana-1.9.2/bin/sdk ~/.cargo/bin/cargo-build-bpf Replace |
Hey @ScottLozano Followed the same steps as you mentioned for installing it on my Macbook air m1 chip. Getting this error when I run Can you please help? :) My setup: rustc/cargo - v 1.60.0 Followed the exact method you mentioned, including the symlink creation |
@mdhrumil
If you did the first two, possibly it's that you need to link a different path in the symlink? I see yours is through Documents. Mine is installed at root user, so: /Users/scott/.cargo/bin/ I can then see ($ls -l) this symlink which I created: cargo-build-bpf -> solana-1.9.2/bin/sdk and I have the solana-1.9.2 on my Desktop Let me know if that helps. |
That’s great!
Sent from ProtonMail for iOS
…On Wed, May 4, 2022 at 3:18 PM, Dhrumil Mayur Mehta ***@***.***> wrote:
Hey ***@***.***(https://github.com/ScottLozano)
I tried this again and somehow it worked. Have tried it multiple times before but used to get stuck due to some or the other issues mentioned in this thread. Glad it worked this time.
[Screen Shot 2022-05-04 at 7 46 39 PM](https://user-images.githubusercontent.com/36199749/166700764-73ca0c6b-8ce5-42bb-bb1c-a38baec7ffb8.png)
—
Reply to this email directly, [view it on GitHub](#95 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ATGQYV4BPT2UXTX6LIVJOEDVIKBJZANCNFSM4YJZRX3Q).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Description
When trying to use anchor on a m1 based mac I get the below error:
Not sure if this is because of a dependency but its odd because rust is emulated to use x86 instructions.
The text was updated successfully, but these errors were encountered: