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

-march=native not supported on Apple M1 #248

Open
Kurtjwest opened this issue Apr 26, 2023 · 3 comments
Open

-march=native not supported on Apple M1 #248

Kurtjwest opened this issue Apr 26, 2023 · 3 comments

Comments

@Kurtjwest
Copy link

When attempting to build from source on apple silicon, the error is returned:

the clang compiler does not support '-march=native'

This is fixed by changing -march=native to -mcpu=apple-m1 in the CMakeLists.txt file

@Thunderforge
Copy link
Collaborator

Thunderforge commented Apr 26, 2023

Is apple-m1 still the correct value if using an M2 processor?

@afritz1
Copy link
Owner

afritz1 commented Apr 27, 2023

I get that same error on my M1 Mac and I use that same change. It'd be good to detect in CMakeLists.txt if the system is Apple and ARM64.

Is apple-m1 still the correct value if using an M2 processor?

A quick search didn't reveal much, but -mcpu=apple-m1 should be okay until it becomes an issue. I think newer Clang versions allow -march=native.

@afritz1
Copy link
Owner

afritz1 commented Jul 25, 2024

I tried compiling again on my Mac and -march=native worked fine, not sure if this issue can be closed yet though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants