Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.14.1のORTを対象にし、$ORT_RUST_STRATEGYのデフォルトをdownload #2

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions rust/onnxruntime-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -71,9 +71,9 @@ fn generate_bindings(include_dir: &Path) {
];

let path = include_dir
.join("onnxruntime")
.join("core")
.join("session")
//.join("onnxruntime")
//.join("core")
//.join("session")
qryxip marked this conversation as resolved.
Show resolved Hide resolved
.join("onnxruntime_c_api.h");

// The bindgen::Builder is the main entry point
Expand Down Expand Up @@ -401,7 +401,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) => {
Expand All @@ -411,7 +411,10 @@ fn prepare_libort_dir() -> PathBuf {
);
}
}),
Ok("compile") | Err(_) => 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),
}
}
Expand Down