Skip to content

Commit 391f36f

Browse files
committed
Drop -march=native for macos
It's unclear, but this could be related to the error: external/boringssl/src/crypto/cpu_aarch64_apple.c:56:2: error: "NEON and crypto extensions should be statically available."
1 parent 508a5d1 commit 391f36f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tensorflow-sys/build.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,15 @@ fn build_from_src() {
381381
"".to_string()
382382
};
383383
run("bazel", |command| {
384-
command
384+
let mut cmd = command
385385
.current_dir(&source)
386386
.arg("build")
387387
.arg(format!("--jobs={}", get!("NUM_JOBS")))
388-
.arg("--compilation_mode=opt")
389-
.arg("--copt=-march=native")
390-
.args(bazel_args_string.split_whitespace())
391-
.arg(&target)
388+
.arg("--compilation_mode=opt");
389+
if target_os() != "macos" {
390+
cmd = cmd.arg("--copt=-march=native");
391+
}
392+
cmd.args(bazel_args_string.split_whitespace()).arg(&target)
392393
});
393394
let framework_target_bazel_bin = source.join("bazel-bin").join(framework_target_path);
394395
log!(

0 commit comments

Comments
 (0)