From 28d57ba2d41637e47740452af4d9efe5c60c00bb Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sat, 25 Mar 2023 12:28:06 +0900 Subject: [PATCH 1/4] =?UTF-8?q?1.14.1=E3=81=AEORT=E3=82=92=E5=AF=BE?= =?UTF-8?q?=E8=B1=A1=E3=81=AB=E3=81=97=E3=80=81`$ORT=5FRUST=5FSTRATEGY`?= =?UTF-8?q?=E3=81=AE=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88=E3=82=92?= =?UTF-8?q?`download`=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rust/onnxruntime-sys/build.rs | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/rust/onnxruntime-sys/build.rs b/rust/onnxruntime-sys/build.rs index 82d1e4278015c..a4068694da478 100644 --- a/rust/onnxruntime-sys/build.rs +++ b/rust/onnxruntime-sys/build.rs @@ -13,7 +13,7 @@ use std::{ /// WARNING: If version is changed, bindings for all platforms will have to be re-generated. /// To do so, run this: /// cargo build --package onnxruntime-sys --features generate-bindings -const ORT_VERSION: &str = include_str!("../../VERSION_NUMBER"); +const ORT_VERSION: &str = "1.14.1"; /// Base Url from which to download pre-built releases/ const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/releases/download"; @@ -58,23 +58,9 @@ fn main() { } fn generate_bindings(include_dir: &Path) { - let clang_args = &[ - format!("-I{}", include_dir.display()), - format!( - "-I{}", - include_dir - .join("onnxruntime") - .join("core") - .join("session") - .display() - ), - ]; - - let path = include_dir - .join("onnxruntime") - .join("core") - .join("session") - .join("onnxruntime_c_api.h"); + let clang_args = &[format!("-I{}", include_dir.display())]; + + let path = include_dir.join("onnxruntime_c_api.h"); // The bindgen::Builder is the main entry point // to bindgen, and lets you build up options for @@ -401,7 +387,7 @@ fn prepare_libort_dir() -> PathBuf { strategy.as_ref().map_or_else(|_| "unknown", String::as_str) ); match strategy.as_ref().map(String::as_str) { - Ok("download") => prepare_libort_dir_prebuilt(), + Ok("download") | Err(_) => prepare_libort_dir_prebuilt(), Ok("system") => PathBuf::from(match env::var(ORT_RUST_ENV_SYSTEM_LIB_LOCATION) { Ok(p) => p, Err(e) => { @@ -411,7 +397,7 @@ fn prepare_libort_dir() -> PathBuf { ); } }), - Ok("compile") | Err(_) => prepare_libort_dir_compiled(), + Ok("compile") => prepare_libort_dir_compiled(), _ => panic!("Unknown value for {:?}", ORT_RUST_ENV_STRATEGY), } } From 0a4d7a5eb635def8e644ec2690028a3d6075fd14 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Tue, 28 Mar 2023 03:10:22 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E7=8A=B6=E6=85=8B=E3=81=A7=E5=85=83?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E6=AE=8B=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rust/onnxruntime-sys/build.rs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/rust/onnxruntime-sys/build.rs b/rust/onnxruntime-sys/build.rs index a4068694da478..61f5e814c0bfc 100644 --- a/rust/onnxruntime-sys/build.rs +++ b/rust/onnxruntime-sys/build.rs @@ -58,9 +58,23 @@ fn main() { } fn generate_bindings(include_dir: &Path) { - let clang_args = &[format!("-I{}", include_dir.display())]; - - let path = include_dir.join("onnxruntime_c_api.h"); + let clang_args = &[ + format!("-I{}", include_dir.display()), + //format!( + // "-I{}", + // include_dir + // .join("onnxruntime") + // .join("core") + // .join("session") + // .display() + //), + ]; + + let path = include_dir + //.join("onnxruntime") + //.join("core") + //.join("session") + .join("onnxruntime_c_api.h"); // The bindgen::Builder is the main entry point // to bindgen, and lets you build up options for From f18a7479b20ea327cd9745b3f9ab10b77e99b6ee Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Fri, 7 Apr 2023 02:31:11 +0900 Subject: [PATCH 3/4] =?UTF-8?q?`clang=5Fargs`=E3=82=92=E5=85=83=E3=81=AB?= =?UTF-8?q?=E6=88=BB=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rust/onnxruntime-sys/build.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rust/onnxruntime-sys/build.rs b/rust/onnxruntime-sys/build.rs index 61f5e814c0bfc..ebaa027903e5f 100644 --- a/rust/onnxruntime-sys/build.rs +++ b/rust/onnxruntime-sys/build.rs @@ -60,14 +60,14 @@ fn main() { fn generate_bindings(include_dir: &Path) { let clang_args = &[ format!("-I{}", include_dir.display()), - //format!( - // "-I{}", - // include_dir - // .join("onnxruntime") - // .join("core") - // .join("session") - // .display() - //), + format!( + "-I{}", + include_dir + .join("onnxruntime") + .join("core") + .join("session") + .display() + ), ]; let path = include_dir From 620f4a0c594fecf52a5cfca0acb05a38b392ddc7 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Fri, 7 Apr 2023 02:38:45 +0900 Subject: [PATCH 4/4] =?UTF-8?q?`ORT=5FRUST=5FSTRATEGY=3Dcompile`=E3=82=92?= =?UTF-8?q?=E7=A6=81=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rust/onnxruntime-sys/build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust/onnxruntime-sys/build.rs b/rust/onnxruntime-sys/build.rs index ebaa027903e5f..c503e48664786 100644 --- a/rust/onnxruntime-sys/build.rs +++ b/rust/onnxruntime-sys/build.rs @@ -411,7 +411,10 @@ fn prepare_libort_dir() -> PathBuf { ); } }), - Ok("compile") => prepare_libort_dir_compiled(), + Ok("compile") => panic!( + "`ORT_RUST_STRATEGY=compile` is currently unavailable. See \ + https://github.com/VOICEVOX/onnxruntime/pull/2#discussion_r1150638175", + ), _ => panic!("Unknown value for {:?}", ORT_RUST_ENV_STRATEGY), } }