2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-06-04 18:21:19 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Fftw < Formula
|
2010-07-01 19:37:36 +00:00
|
|
|
homepage 'http://www.fftw.org'
|
2012-05-06 16:56:02 +00:00
|
|
|
url 'http://www.fftw.org/fftw-3.3.2.tar.gz'
|
|
|
|
md5 '6977ee770ed68c85698c7168ffa6e178'
|
2009-06-04 18:21:19 +00:00
|
|
|
|
|
|
|
def install
|
2010-07-01 19:37:36 +00:00
|
|
|
args = ["--enable-shared",
|
|
|
|
"--disable-debug",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--enable-threads",
|
|
|
|
"--disable-dependency-tracking"]
|
|
|
|
|
|
|
|
# check for gfortran
|
2012-03-03 23:50:27 +00:00
|
|
|
args << "--disable-fortran" unless which 'gfortran'
|
2010-07-01 19:37:36 +00:00
|
|
|
|
2010-04-11 14:08:07 +00:00
|
|
|
# single precision
|
|
|
|
# enable-sse only works with single
|
2010-07-01 19:37:36 +00:00
|
|
|
system "./configure", "--enable-single",
|
2009-08-07 14:41:43 +00:00
|
|
|
"--enable-sse",
|
2010-07-01 19:37:36 +00:00
|
|
|
*args
|
2009-06-04 18:21:19 +00:00
|
|
|
system "make install"
|
2009-08-07 14:41:43 +00:00
|
|
|
|
2010-04-11 14:08:07 +00:00
|
|
|
# clean up so we can compile the double precision variant
|
|
|
|
system "make clean"
|
|
|
|
|
|
|
|
# double precision
|
|
|
|
# enable-sse2 only works with double precision (default)
|
2010-08-08 17:20:15 +00:00
|
|
|
system "./configure", "--enable-sse2", *args
|
2010-04-11 14:08:07 +00:00
|
|
|
system "make install"
|
|
|
|
|
|
|
|
# clean up so we can compile the long-double precision variant
|
|
|
|
system "make clean"
|
|
|
|
|
|
|
|
# long-double precision
|
2010-07-01 19:37:36 +00:00
|
|
|
# no SIMD optimization available
|
2010-08-08 17:20:15 +00:00
|
|
|
system "./configure", "--enable-long-double", *args
|
2010-04-11 14:08:07 +00:00
|
|
|
system "make install"
|
2009-06-04 18:21:19 +00:00
|
|
|
end
|
2010-04-11 14:08:07 +00:00
|
|
|
end
|