Skip to content

Commit

Permalink
Don't require -march=native when compiling accelerate
Browse files Browse the repository at this point in the history
We still use it when compiling runtime kernels, but those are
machine-local anyway.
  • Loading branch information
tomsmeding committed Nov 30, 2024
1 parent 6c85447 commit a57f1e1
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions accelerate.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -643,17 +643,22 @@ library
build-depends:
unix

-- We assume only SSE2 to make Accelerate widely compatible; Windows 8
-- assumes SSE2. However, we tune for native, see the next block.
if !arch(aarch64)
cc-options: -march=sse2
cxx-options: -march=sse2
ghc-options: -optc=-march=sse2
if impl(ghc >= 8.10)
ghc-options: -optcxx=-march=sse2

-- https://stackoverflow.com/questions/65966969/why-does-march-native-not-work-on-apple-m1
if !(os(darwin) && arch(aarch64))
cc-options:
-march=native
cxx-options:
-march=native
ghc-options:
-optc=-march=native
cc-options: -mtune=native
cxx-options: -mtune=native
ghc-options: -optc=-mtune=native
if impl(ghc >= 8.10)
ghc-options:
-optcxx=-march=native
ghc-options: -optcxx=-mtune=native

-- Don't add the extensions list here. Instead, place individual LANGUAGE
-- pragmas in the files that require a specific extension. This means the
Expand Down

0 comments on commit a57f1e1

Please sign in to comment.