Add OpenVINO support
This commit is contained in:
parent
776abc3c91
commit
5c140c14d4
6 changed files with 100 additions and 2 deletions
23
sys/build.rs
23
sys/build.rs
|
|
@ -7,6 +7,26 @@ use std::env;
|
|||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
// Fail-fast test for OpenVINO
|
||||
#[cfg(feature = "openvino")]
|
||||
if let Ok(openvino_dir) = env::var("OpenVINO_DIR") {
|
||||
// see if we can find OpenVINOConfig.cmake
|
||||
let openvino_config_path = PathBuf::from(&openvino_dir).join("OpenVINOConfig.cmake");
|
||||
if !openvino_config_path.exists() {
|
||||
panic!(
|
||||
"Couldn't find OpenVINOConfig.cmake in OpenVINO_DIR. Please set it to the path where `OpenVINOConfig.cmake` can be found.\n\
|
||||
On Arch Linux, if you installed the AUR package, this path is `/opt/intel/openvino/runtime/cmake/`.\n\
|
||||
Note the `/cmake/` at the end of the path."
|
||||
);
|
||||
}
|
||||
} else {
|
||||
panic!(
|
||||
"Couldn't find the OpenVINO_DIR environment variable. Please set it to the path where `OpenVINOConfig.cmake` can be found.\n\
|
||||
On Arch Linux, if you installed the AUR package, this path is `/opt/intel/openvino/runtime/cmake/`."
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
let target = env::var("TARGET").unwrap();
|
||||
// Link C++ standard library
|
||||
if let Some(cpp_stdlib) = get_cpp_link_stdlib(&target) {
|
||||
|
|
@ -112,6 +132,9 @@ fn main() {
|
|||
#[cfg(feature = "opencl")]
|
||||
cmd.arg("-DWHISPER_CLBLAST=ON");
|
||||
|
||||
#[cfg(feature = "openvino")]
|
||||
cmd.arg("-DWHISPER_OPENVINO=1");
|
||||
|
||||
cmd.arg("-DCMAKE_POSITION_INDEPENDENT_CODE=ON");
|
||||
|
||||
let code = cmd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue