Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #426 from Sanctum-AI/m1-build-fix
Browse files Browse the repository at this point in the history
Fix build on macos m1
  • Loading branch information
philpax authored Sep 18, 2023
2 parents c6630d4 + 8558220 commit 84800b0
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions crates/ggml/sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,11 @@ fn main() {
}
"aarch64" => {
if compiler.is_like_clang() || compiler.is_like_gnu() {
if std::env::var("HOST") == std::env::var("TARGET") {
if target_os == "macos" {
build.flag("-mcpu=apple-m1");
build.flag("-mfpu=neon");
} else if std::env::var("HOST") == std::env::var("TARGET") {
build.flag("-mcpu=native");
} else {
#[allow(clippy::single_match)]
match target_os.as_str() {
"macos" => {
build.flag("-mcpu=apple-m1");
build.flag("-mfpu=neon");
}
_ => {}
}
}
build.flag("-pthread");
}
Expand Down

0 comments on commit 84800b0

Please sign in to comment.