aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXin Sun2013-11-06 21:36:05 +0800
committerJack Nagel2013-12-04 00:44:43 -0600
commitc8bdd80f89c0c8b5499bc3daac7c4b8ce04467b3 (patch)
tree45a94d30b98fdfc3c826b74bba6017f154c58c2a /Library
parent6647e4922533347cec7fb140818ecd0748209318 (diff)
downloadhomebrew-c8bdd80f89c0c8b5499bc3daac7c4b8ce04467b3.tar.bz2
FFTW: Enable AVX support with clang compiler
Closes #24023. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/fftw.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Formula/fftw.rb b/Library/Formula/fftw.rb
index 8db7679fa..e1b9bf677 100644
--- a/Library/Formula/fftw.rb
+++ b/Library/Formula/fftw.rb
@@ -15,22 +15,22 @@ class Fftw < Formula
"--prefix=#{prefix}",
"--enable-threads",
"--disable-dependency-tracking"]
+ simd_args = ["--enable-sse2"]
+ simd_args << "--enable-avx" if ENV.compiler == :clang and Hardware::CPU.avx? and !build.bottle?
args << "--disable-fortran" unless build.with? "fortran"
# single precision
- # enable-sse only works with single
- system "./configure", "--enable-single",
- "--enable-sse",
- *args
+ # enable-sse2 and enable-avx works for both single and double precision
+ system "./configure", "--enable-single", *(args + simd_args)
system "make install"
# clean up so we can compile the double precision variant
system "make clean"
# double precision
- # enable-sse2 only works with double precision (default)
- system "./configure", "--enable-sse2", *args
+ # enable-sse2 and enable-avx works for both single and double precision
+ system "./configure", *(args + simd_args)
system "make install"
# clean up so we can compile the long-double precision variant