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

Barretenberg does not cross compile for Apple Mac builds based on toolchain selected #1841

Closed
kevaundray opened this issue Aug 28, 2023 · 0 comments · Fixed by #1837
Closed
Labels
C-bb.js Component: bb.js - wrapping bberg in js

Comments

@kevaundray
Copy link
Contributor

Problem

Mac's are able to cross compile from x86_64 to arm64. So if you are running an x86, you can cross compile to arm and vice versa. This is useful for the CI where arm builds are in beta.

Our current toolchain files, however do not set the appropriate flags to allow us to cross compile, this means that even if you select the aarch64 toolchain, you will be compiling for x86_64 if your Mac is x86_64.

Solution

Set the appropriate flags to the compiler when the toolchain is set. For arm it is:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch arm64") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch arm64")

Note

The fact that the arm build was building for x86_64 was spotted by @kobyhallx

@kevaundray kevaundray added the C-bb.js Component: bb.js - wrapping bberg in js label Aug 28, 2023
@github-project-automation github-project-automation bot moved this to Todo in A3 Aug 28, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Aug 28, 2023
ludamad pushed a commit that referenced this issue Sep 3, 2023
When fixing #1841
the flags were put in the cmake toolchains file for circuits which does
not get inherited by the barretenberg toolchain files.
AztecBot pushed a commit to AztecProtocol/barretenberg that referenced this issue Sep 3, 2023
When fixing AztecProtocol/aztec-packages#1841
the flags were put in the cmake toolchains file for circuits which does
not get inherited by the barretenberg toolchain files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bb.js Component: bb.js - wrapping bberg in js
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant