Skip to content

Commit

Permalink
fix(sys): allow overriding dynamic linking with cuda/tensorrt
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Nov 7, 2024
1 parent 8a16adb commit e220795
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ort-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,9 @@ fn static_link_prerequisites(using_pyke_libs: bool) {
}

fn prefer_dynamic_linking() -> bool {
// If the cuda or tensorrt features are enabled, we need to use dynamic linking.
if cfg!(feature = "cuda") || cfg!(feature = "tensorrt") {
return true;
}

match env::var(ORT_ENV_PREFER_DYNAMIC_LINK) {
Ok(val) => val == "1" || val.to_lowercase() == "true",
Err(_) => false
Err(_) => cfg!(feature = "cuda") || cfg!(feature = "tensorrt")
}
}

Expand Down

0 comments on commit e220795

Please sign in to comment.