2013-11-21 18:56:12 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Pocl < Formula
|
|
|
|
homepage 'http://pocl.sourceforge.net'
|
2014-02-03 18:40:40 +00:00
|
|
|
url 'http://pocl.sourceforge.net/downloads/pocl-0.9.tar.gz'
|
|
|
|
sha1 'd6e30f3120c7952dec9004db1db91a11d08c7b74'
|
2013-11-21 18:56:12 +00:00
|
|
|
|
|
|
|
depends_on 'pkg-config' => :build
|
|
|
|
depends_on 'hwloc'
|
|
|
|
depends_on 'llvm' => 'with-clang'
|
|
|
|
depends_on :libltdl
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.j1
|
|
|
|
system "./configure", "--disable-debug",
|
|
|
|
"--enable-direct-linkage",
|
|
|
|
"--disable-icd",
|
|
|
|
"--enable-testsuites=",
|
|
|
|
"--prefix=#{prefix}"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/'foo.cl').write <<-EOS.undent
|
|
|
|
kernel void foo(int *in, int *out) {
|
|
|
|
int i = get_global_id(0);
|
|
|
|
out[i] = in[i];
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system "#{bin}/pocl-standalone -h head.h -o foo.bc foo.cl"
|
|
|
|
system "\"#{Formula.factory('llvm').opt_prefix}/bin/llvm-dis\" < foo.bc | grep foo_workgroup"
|
2014-02-03 18:40:40 +00:00
|
|
|
system "pkg-config pocl --modversion | grep #{version}"
|
2013-11-21 18:56:12 +00:00
|
|
|
end
|
|
|
|
end
|