diff --git a/candle-onnx/Cargo.toml b/candle-onnx/Cargo.toml index ece43de3c5..7f0d600bb2 100644 --- a/candle-onnx/Cargo.toml +++ b/candle-onnx/Cargo.toml @@ -14,8 +14,9 @@ candle = { path = "../candle-core", package = "candle-core", version = "0.9.1" } candle-nn = { path = "../candle-nn", version = "0.9.1" } prost = "0.12.1" -[build-dependencies] -prost-build = "0.12.1" +# [build-dependencies] +# prost-build = "0.12.1" +# protobuf-src = "2.1.1" [dev-dependencies] anyhow = { version = "1", features = ["backtrace"] } diff --git a/candle-onnx/README.md b/candle-onnx/README.md index af25b16286..50280421ac 100644 --- a/candle-onnx/README.md +++ b/candle-onnx/README.md @@ -1,21 +1,3 @@ # candle-onnx This crate adds ONNX support to candle - -## FAQ - -#### Missing protoc installation when compiling candle-onnx - -The candle-onnx dependency prost-build no longer comes bundled with prost -binaries. This could cause the following error when attempting to compile -candle-onnx: - -``` -error: failed to run custom build command for `candle-onnx` -Caused by: // (...) - Could not find `protoc` installation and this build crate cannot proceed without this knowledge. -``` - -To fix this issue install protoc on your system and make it available in your -system `PATH`. See the [protoc -documentation](https://grpc.io/docs/protoc-installation/) for more information. diff --git a/candle-onnx/build.rs b/candle-onnx/build.rs index 79e7a39d7e..772e24fc0c 100644 --- a/candle-onnx/build.rs +++ b/candle-onnx/build.rs @@ -1,6 +1,7 @@ use std::io::Result; fn main() -> Result<()> { + std::env::set_var("PROTOC", protobuf_src::protoc()); prost_build::compile_protos(&["src/onnx.proto3"], &["src/"])?; Ok(()) } diff --git a/candle-onnx/src/lib.rs b/candle-onnx/src/lib.rs index efd6f7600f..abb387b4de 100644 --- a/candle-onnx/src/lib.rs +++ b/candle-onnx/src/lib.rs @@ -1,4 +1,5 @@ use candle::Result; +pub use prost; use prost::Message; pub mod onnx {