Skip to content

Add -mno-avx512f flag only if compiler supports this#8

Open
alexberndt wants to merge 1 commit intocentreborelli:masterfrom
20treeAI:optional-avx512f-flag
Open

Add -mno-avx512f flag only if compiler supports this#8
alexberndt wants to merge 1 commit intocentreborelli:masterfrom
20treeAI:optional-avx512f-flag

Conversation

@alexberndt
Copy link

@alexberndt alexberndt commented Aug 26, 2025

Mac M1/M2 CPUs do not support the -mno-avx512f compiler flag. This change will only add the -mno-avx512f flag if the compiler supports this.

Reproduce error

On Mac M1, running clang 17.0.0 attempting to build ransac==1.0.4

>> clang --version
Apple clang version 17.0.0 (clang-1700.0.13.3)
Target: arm64-apple-darwin24.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

then running pip install -e . yields

...
    mkdir -p lib
    cc -march=native -O3 -mno-avx512f -fPIC -shared -o lib/libransac.so c/ransac.c
    clang: error: unsupported option '-mno-avx512f' for target 'arm64-apple-darwin24.5.0'
    make: *** [Makefile:29: lib/libransac.so] Error 1
...

@alexberndt
Copy link
Author

@carlodef , any thoughts on this? Happy to address any comments you may have.

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

Successfully merging this pull request may close these issues.

1 participant