homebrew-core/Formula/numactl.rb

34 lines
1019 B
Ruby

class Numactl < Formula
desc "NUMA support for Linux"
homepage "https://github.com/numactl/numactl"
url "https://github.com/numactl/numactl/releases/download/v2.0.14/numactl-2.0.14.tar.gz"
sha256 "826bd148c1b6231e1284e42a4db510207747484b112aee25ed6b1078756bcff6"
license all_of: ["GPL-2.0-only", "LGPL-2.1-only", :public_domain, :cannot_represent]
bottle do
sha256 cellar: :any_skip_relocation, x86_64_linux: "5684c37cc45e777cecb121708cbf2a18c879c4fdc31ad60d542d0c6f21fb3af8"
end
depends_on :linux
def install
system "./configure", *std_configure_args, "--disable-silent-rules"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <numa.h>
int main() {
if (numa_available() >= 0) {
struct bitmask *mask = numa_allocate_nodemask();
numa_free_nodemask(mask);
}
return 0;
}
EOS
system ENV.cc, "-I#{include}", "test.c", "-L#{lib}", "-lnuma", "-o", "test"
system "./test"
end
end