forked from necromant2005/homebrew-boneyard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ffts.rb
32 lines (30 loc) · 1.03 KB
/
ffts.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class Ffts < Formula
desc "C library that computes the discrete Fourier transform"
homepage "http://anthonix.com/ffts/"
url "http://anthonix.com/ffts/releases/ffts-0.7.tar.gz"
sha256 "6362e498e5aa241661cfe9060153076b78e300a5d3c365997ba6ac2f637df3ff"
head "https://github.com/anthonix/ffts.git"
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