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

fix: Adds support for Apple silicon compilation #194

Merged
merged 4 commits into from
Mar 14, 2024

Conversation

gto90
Copy link
Member

@gto90 gto90 commented Mar 12, 2024

This PR cherry picks the Apple Silicon support added by the following Bitcoin PR: bitcoin/bitcoin#21851

Additionally, the PR updates to the latest version of the Boost library to resolve compilation errors due to deprecated Boost calls.

This resolves issue #111

@gto90 gto90 added the bug Something isn't working label Mar 12, 2024
@gto90 gto90 self-assigned this Mar 12, 2024
@ghost
Copy link

ghost commented Mar 12, 2024

Screenshot from 2024-03-12 23-48-54
sha256_hash=cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454 is correct.

Copy link

@JaredTate JaredTate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. Great work man! This is really helpful.

I can't fully test this as I don't have Apple Silicon. But I can tell you I can still compile on my intel Mac, all the way to make deploy and the dmg so this doesn't brick the rest of us cave dwellers still running i series intels living in the stone age.

Screenshot 2024-03-12 at 4 50 44 PM

@JaredTate
Copy link

Screenshot from 2024-03-12 23-48-54 sha256_hash=cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454 is correct.

Great verification step!

$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$(subst _,.,$($(package)_version))/source/
$(package)_file_name=boost_$($(package)_version).tar.bz2
$(package)_sha256_hash=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee
$(package)_sha256_hash=cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454

Matches!

@ghost
Copy link

ghost commented Mar 12, 2024

ACK. Great work man! This is really helpful.

I can't fully test this as I don't have Apple Silicon. But I can tell you I can still compile on my intel Mac, all the way to make deploy and the dmg so this doesn't brick the rest of us cave dwellers still running i series intels living in the stone age.

Screenshot 2024-03-12 at 4 50 44 PM

I don't have Apple Silicon to. but good on Linux.

Screenshot from 2024-03-13 00-32-09

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @gto90 !!

@saltedlolly
Copy link

saltedlolly commented Mar 13, 2024

Nice work @gto90! I have an M1 Mac. I have been waiting for this. I will try and test this today.

Will this also help with Guix builds on Silicon Macs?

@saltedlolly
Copy link

Screenshot 2024-03-13 at 11 30 14 pm

I'm getting some error though it could well be me doing something wrong.

I should be clear here that I really have no idea what I am doing - I have little experience compiling, but I can copy paste commands even if I don't really understand what they do.

@JaredTate
Copy link

Screenshot 2024-03-13 at 11 30 14 pm

I'm getting some error though it could well be me doing something wrong.

I should be clear here that I really have no idea what I am doing - I have little experience compiling, but I can copy paste commands even if I don't really understand what they do.

Have you installed all the deps and followed the process here?

https://github.com/DigiByte-Core/digibyte/blob/develop/doc/build-osx.md

Roughly:
Xcode tool 1st

xcode-select --install

Homebrew

brew install automake libtool boost pkg-config libevent python

More deps

brew install berkeley-db@4 sqlite qt@5 qrencode miniupnpc libnatpmp librsvg

For Testing and MAke Deploy

pip3 install ds_store mac_alias
pip3 install digibyte_scrypt

Compile steps after you cloned repo

  ./autogen.sh
  ./configure
  make

You can add -j and the number of processors to compile faster. So with 8 cores, you can:

  make -j 8

Finally to make the dmg you:

make deploy

@gto90
Copy link
Member Author

gto90 commented Mar 14, 2024

Nice work @gto90! I have an M1 Mac. I have been waiting for this. I will try and test this today.

Will this also help with Guix builds on Silicon Macs?

I have not yet tried the Guix build process but this is a necessary first step.

@gto90
Copy link
Member Author

gto90 commented Mar 14, 2024

Screenshot 2024-03-13 at 11 30 14 pm

I'm getting some error though it could well be me doing something wrong.

I should be clear here that I really have no idea what I am doing - I have little experience compiling, but I can copy paste commands even if I don't really understand what they do.

@saltedlolly , can you try the following steps for me?

  1. cd depends && make HOST=arm64-apple-darwin -j6
  2. cd .. && ./autogen.sh && CONFIG_SITE=$PWD/depends/arm64-apple-darwin/share/config.site ./configure
  3. make -j6

That should get you going.

@JaredTate is correct though that you need to get the latest version of Xcode and Xcode tools installed. I didn't follow the macos build docs though because it's a pain to get the right dependencies installed. The depends directory makes dealing with dependencies painless.

@saltedlolly
Copy link

saltedlolly commented Mar 14, 2024

@gto90 I followed your steps and it compiled without error which is great! Thanks for the pointers. 🚀

However, on launch it froze on this screen for several minutes:
Screenshot 2024-03-14 at 12 24 25 pm

I force quit and restarted and on the second attempt it froze again but then continued after a minute or two:
Screenshot 2024-03-14 at 12 32 55 pm

Maybe it would have got there on its own had I waited but it seems there is an issue there. It does not pause like that in 7.17.3 as far as I rememeber. Perhaps this issue is not specifically related to being on Apple Silicon?

Also, while it IS syncing (currently at 28%), I do have a permanent spinning beach ball and the force quit dialog says the app is not responding. That doesn't seem normal.

@ghost
Copy link

ghost commented Mar 14, 2024

@saltedlolly And @gto90 Nice work!

saltedlolly "However, on launch it froze on this screen for several minutes:"

This is a problem that already exist before this pr.
When i start digibyte core. without pr 194. it also give me problems. / crashes ( 12900k 96gb ram )
Screencast from 2024-03-14 15-08-43.webm
&&
issue 164
&&
issue 191

Copy link
Member

@ycagel ycagel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cACK. Great job everyone. Thanks @gto90 for submitting this PR.

@ycagel ycagel merged commit d486a8d into develop Mar 14, 2024
1 of 4 checks passed
JaredTate added a commit to JaredTate/digibyte that referenced this pull request Mar 28, 2024
…feature/appl-silicon-support"

This reverts commit d486a8d, reversing
changes made to d4089cc.
JaredTate added a commit to JaredTate/digibyte that referenced this pull request Mar 28, 2024
…feature/appl-silicon-support"

This reverts commit d486a8d, reversing
changes made to d4089cc.
JaredTate added a commit to JaredTate/digibyte that referenced this pull request Mar 29, 2024
More Windows No Likey

More Windows No Like

Windows No Like

More GUIX Test Fix

Test Win Fix

More win Fix

Test Win Fix

More GUIX Test Changes

More Fixes Apple Silicone

More Tuple Fun

More CONTROL_FLOW Tuple Fun

Test Tuple Fix

Lief Parse

Test Pixie & Define get_arch

Update README.md

Revert Part "Merge pull request DigiByte-Core#194 from DigiByte-Core/feature/appl-silicon-support"

This reverts commit d486a8d, reversing
changes made to d4089cc.
JaredTate added a commit to JaredTate/digibyte that referenced this pull request Apr 1, 2024
…re/feature/appl-silicon-support""

This reverts commit 042b18acf45808082dfb48cc7ef01ea3bfc92039.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants