Skip to content

Commit

Permalink
Default to system installation for onnxruntime.
Browse files Browse the repository at this point in the history
  • Loading branch information
hgaiser committed Oct 26, 2023
1 parent 11fad98 commit ce51172
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions rust/onnxruntime-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,16 +402,18 @@ fn prepare_libort_dir() -> PathBuf {
);
match strategy.as_ref().map(String::as_str) {
Ok("download") => prepare_libort_dir_prebuilt(),
Ok("system") => PathBuf::from(match env::var(ORT_RUST_ENV_SYSTEM_LIB_LOCATION) {
Ok("compile") => prepare_libort_dir_compiled(),
Ok("system") | Err(_) => PathBuf::from(match env::var(ORT_RUST_ENV_SYSTEM_LIB_LOCATION) {
Ok(p) => p,
Err(e) => {
panic!(
"Could not get value of environment variable {:?}: {:?}",
ORT_RUST_ENV_SYSTEM_LIB_LOCATION, e
);
Err(_) => {
println!("No value set for '{}', defaulting to /usr", ORT_RUST_ENV_SYSTEM_LIB_LOCATION);
"/usr".to_string()
// panic!(
// "Could not get value of environment variable {:?}: {:?}",
// ORT_RUST_ENV_SYSTEM_LIB_LOCATION, e
// );
}
}),
Ok("compile") | Err(_) => prepare_libort_dir_compiled(),
_ => panic!("Unknown value for {:?}", ORT_RUST_ENV_STRATEGY),
}
}
Expand Down

0 comments on commit ce51172

Please sign in to comment.