From 298b0312ef4257920a5e30ee992cb16e31a9f9fa Mon Sep 17 00:00:00 2001 From: Simpson Sun Date: Sat, 6 Apr 2013 11:45:59 +0800 Subject: [PATCH 1/2] fftw 3.3: enable AVX instruction set for SIMD speedup --- Library/Formula/fftw.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Library/Formula/fftw.rb b/Library/Formula/fftw.rb index cf419ec8074b..68988f971835 100644 --- a/Library/Formula/fftw.rb +++ b/Library/Formula/fftw.rb @@ -6,6 +6,7 @@ class Fftw < Formula sha1 '11487180928d05746d431ebe7a176b52fe205cf9' option "with-fortran", "Enable Fortran bindings" + option "without-avx", "Disable AVX instruction set for SIMD speedup" def install args = ["--enable-shared", @@ -14,6 +15,8 @@ def install "--enable-threads", "--disable-dependency-tracking"] + simd_args = ["--enable-sse2"] + simd_args << "--enable-avx" unless build.include? "without-avx" if build.include? "with-fortran" ENV.fortran else @@ -21,18 +24,16 @@ def install end # single precision - # enable-sse only works with single - system "./configure", "--enable-single", - "--enable-sse", - *args + # enable-sse2 works for both single and double precisions + 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 works for both single and double precisions + system "./configure", *(args + simd_args) system "make install" # clean up so we can compile the long-double precision variant From f72d92de1630706b545402faa7c6c4631c7d94cf Mon Sep 17 00:00:00 2001 From: Simpson Sun Date: Sat, 6 Apr 2013 11:54:22 +0800 Subject: [PATCH 2/2] enable gfortran graphite support for auto-vectorization in -O3 --- Library/Formula/gfortran.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Formula/gfortran.rb b/Library/Formula/gfortran.rb index 5347d83b1289..27bff701dedc 100644 --- a/Library/Formula/gfortran.rb +++ b/Library/Formula/gfortran.rb @@ -20,6 +20,8 @@ class Gfortran < Formula depends_on 'gmp' depends_on 'libmpc' depends_on 'mpfr' + depends_on 'isl' + depends_on 'cloog' # http://gcc.gnu.org/install/test.html depends_on 'dejagnu' if build.include? 'check' @@ -54,6 +56,8 @@ def install "--with-gmp=#{Formula.factory('gmp').opt_prefix}", "--with-mpfr=#{Formula.factory('mpfr').opt_prefix}", "--with-mpc=#{Formula.factory('libmpc').opt_prefix}", + "--with-isl=#{Formula.factory('isl').opt_prefix}", + "--with-cloog=#{Formula.factory('cloog').opt_prefix}", # ...we build the stage 1 gcc with clang (which is know to fail checks) "--enable-checking=release", "--disable-stage1-checking",