2014-11-29 09:33:37 +00:00
|
|
|
class Ffts < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "C library that computes the discrete Fourier transform"
|
2014-11-29 09:33:37 +00:00
|
|
|
homepage "http://anthonix.com/ffts/"
|
|
|
|
url "http://anthonix.com/ffts/releases/ffts-0.7.tar.gz"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "6362e498e5aa241661cfe9060153076b78e300a5d3c365997ba6ac2f637df3ff"
|
2015-10-05 13:49:42 +00:00
|
|
|
head "https://github.com/anthonix/ffts.git"
|
2014-11-29 09:33:37 +00:00
|
|
|
|
2014-11-29 11:21:39 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-11-19 15:45:31 +00:00
|
|
|
sha256 "1f5247eaac6427f34ac4ad8155fd29841d4adea671f21b264c679d2adbdb22ef" => :yosemite
|
|
|
|
sha256 "f22fd4ecf695fe69df9177f68e2d880fcdc5c37201ded5d29c39760de3b787db" => :mavericks
|
|
|
|
sha256 "9057a22063635a12c8645f1a63f282d548df2dabd9e67114f3036e2a43cf2836" => :mountain_lion
|
2014-11-29 11:21:39 +00:00
|
|
|
end
|
|
|
|
|
2014-11-29 09:33:37 +00:00
|
|
|
def install
|
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--enable-sse",
|
|
|
|
"--enable-single"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
|
|
#include <ffts/ffts.h>
|
|
|
|
#define align(x) __attribute__((aligned(x)))
|
|
|
|
int main(void) {
|
|
|
|
const size_t n = 8;
|
|
|
|
float align(32) input[n] = {0.0, };
|
|
|
|
float align(32) output[n];
|
|
|
|
ffts_plan_t* plan = ffts_init_1d(n, 1);
|
|
|
|
ffts_execute(plan, input, output);
|
|
|
|
ffts_free(plan);
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cc, "test.c", "-lffts", "-o", "test"
|
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|