2019-10-22 04:07:58 +00:00
|
|
|
class Onnxruntime < Formula
|
|
|
|
desc "Cross-platform, high performance scoring engine for ML models"
|
|
|
|
homepage "https://github.com/microsoft/onnxruntime"
|
|
|
|
url "https://github.com/microsoft/onnxruntime.git",
|
2019-11-26 01:07:37 +00:00
|
|
|
:revision => "b783805f957c88f97b2b4398e2ace138fbdf831b"
|
|
|
|
version "1.0.0"
|
2019-10-22 04:07:58 +00:00
|
|
|
|
2019-11-26 00:47:39 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2019-11-26 03:22:28 +00:00
|
|
|
sha256 "1d6f94a87818b90686f8de273d9498c053c96fb0563b4946b9d7334ae4a06446" => :catalina
|
|
|
|
sha256 "b0e197272aad07a88f86daf4907ed8799342cd317da7adb105832f2674ac176f" => :mojave
|
|
|
|
sha256 "a7328414d688e4d82f97d9fae55268c369db64cafd4c3a75203c616321441c17" => :high_sierra
|
2019-11-26 00:47:39 +00:00
|
|
|
end
|
|
|
|
|
2019-10-22 04:07:58 +00:00
|
|
|
depends_on "cmake" => :build
|
|
|
|
depends_on "python" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
mkdir "build" do
|
|
|
|
system "cmake", "../cmake", "-Donnxruntime_BUILD_SHARED_LIB=ON", *std_cmake_args
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<~EOS
|
|
|
|
#include <onnxruntime/core/session/onnxruntime_c_api.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
int main()
|
|
|
|
{
|
2019-11-26 01:07:37 +00:00
|
|
|
printf("%s\\n", OrtGetApiBase()->GetVersionString());
|
2019-10-22 04:07:58 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cc, "-I#{include}", "-L#{lib}", "-lonnxruntime",
|
|
|
|
testpath/"test.c", "-o", testpath/"test"
|
|
|
|
assert_equal version, shell_output("./test").strip
|
|
|
|
end
|
|
|
|
end
|