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
|
|
|
|
sha256 "69ffc1316e0b4fce904bc5acf5e23fa39de324c5701dfd0cf0424950c62550fc" => :catalina
|
|
|
|
sha256 "6c6bf1cc7f0a9f3409426830c6fb4d7cbf8647335874f1ceccf50c5997687e7e" => :mojave
|
|
|
|
sha256 "46d0fbaab6f4a01e31ac8ea751128fbf6b68ce96133de6acf5ae02e18d33554a" => :high_sierra
|
|
|
|
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
|