From 4913e20b5d4048a3047fc9eadae9d89829811c2a Mon Sep 17 00:00:00 2001 From: arizhih Date: Mon, 14 Oct 2024 15:28:28 +0200 Subject: [PATCH] Explicitly link to libomp on MacOS --- sys/build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/build.rs b/sys/build.rs index 1f904a9..8c064b6 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -92,6 +92,9 @@ fn main() { { if target.contains("gnu") { println!("cargo:rustc-link-lib=gomp"); + } else if target.contains("apple") { + println!("cargo:rustc-link-lib=omp"); + println!("cargo:rustc-link-search=/opt/homebrew/opt/libomp/lib"); } } @@ -232,7 +235,7 @@ fn main() { let destination = config.build(); - add_link_search_path(&out.join("lib")).unwrap(); + add_link_search_path(&out.join("build")).unwrap(); println!("cargo:rustc-link-search=native={}", destination.display()); println!("cargo:rustc-link-lib=static=whisper");