-
Notifications
You must be signed in to change notification settings - Fork 1.4k
add m1 support #385
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
add m1 support #385
Conversation
|
Tested succesfully on MacOS 12.4 ARM64. Thank you. |
| EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE ) | ||
|
|
||
| if (ARCHITECTURE MATCHES "arm64") | ||
| set(TON_ARCH "apple-m1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, it's not guaranteed if the architecture is arm64 then cpu is apple-m1. I think we should also check that CMAKE_SYSTEM_NAME equals Darwin.
CMakeLists.txt
Outdated
|
|
||
| if (ARCHITECTURE MATCHES "arm64") | ||
| set(TON_ARCH "apple-m1") | ||
| set(CMAKE_CXX_STANDARD 14) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this set necessary? I see this logic in line 194
CMakeLists.txt
Outdated
|
|
||
| if (TON_ARCH AND NOT MSVC) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${TON_ARCH}") | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=${TON_ARCH}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep -march flag for x86 arch. Source: https://stackoverflow.com/a/42722790/4253144
Tested on Apple M1 Max