diff options
Diffstat (limited to 'ox-arrays.cabal')
-rw-r--r-- | ox-arrays.cabal | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ox-arrays.cabal b/ox-arrays.cabal index 1253956..19a61ab 100644 --- a/ox-arrays.cabal +++ b/ox-arrays.cabal @@ -17,6 +17,16 @@ flag trace-wrappers default: False manual: True +flag nonportable-simd + description: + Assume the binary will be run on the same CPU as where it is built. Setting + this flag causes `-march=native` to be passed to the C compiler when + compiling arithmetic operations. The result is generally much faster + arithmetic operations, but the executable is much less portable to + different computers. + default: False + manual: True + library exposed-modules: Data.Array.Mixed.Internal.Arith @@ -53,7 +63,9 @@ library c-sources: cbits/arith.c cc-options: -O3 -Wall -Wextra -std=c99 - if arch(x86_64) || arch(i386) + if flag(nonportable-simd) + cc-options: -march=native + elif arch(x86_64) || arch(i386) -- hmatrix assumes sse2, so we can too cc-options: -msse2 |