From 67924ca473d1b17140bc7bd3d04fed3a779608d3 Mon Sep 17 00:00:00 2001 From: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com> Date: Thu, 1 Aug 2024 16:24:44 +0300 Subject: [PATCH] fix: link openblas path correctly --- sys/build.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/build.rs b/sys/build.rs index 9e0b7a1..50f6877 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -37,7 +37,17 @@ fn main() { } #[cfg(feature = "openblas")] { - println!("cargo:rustc-link-lib=openblas"); + if let Ok(openblas_path) = env::var("OPENBLAS_PATH") { + println!( + "cargo::rustc-link-search={}", + PathBuf::from(openblas_path).join("lib").display() + ); + } + if cfg!(windows) { + println!("cargo:rustc-link-lib=libopenblas"); + } else { + println!("cargo:rustc-link-lib=openblas"); + } } #[cfg(feature = "cuda")] {