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'
|
2011-10-16 20:26:54 +00:00
|
|
|
url 'http://www.fftw.org/fftw-3.3.tar.gz'
|
|
|
|
md5 '0728ab3ec0ebb06631ab3b80a5c3d130'
|
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
|
|
|
|
args << "--disable-fortran" if `/usr/bin/which gfortran`.chomp.empty?
|
|
|
|
|
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
|
|
|
#wtf file?
|
2010-08-08 17:20:15 +00:00
|
|
|
(info+'dir').unlink
|
2009-06-04 18:21:19 +00:00
|
|
|
end
|
2010-04-11 14:08:07 +00:00
|
|
|
end
|