Open vikranthkeerthipati opened 1 year ago
Hey thanks for sharing! The Rust bindings are extremely new/experimental and I haven't had the chance to try on a M1 mac yet. Those flags seem right, the MacOS x64_64 and Linux builds also require similar flags.
Will try it out on my M1 and will update the docs when needed.
If you're tired to constantly defining RUSTFLAGS
as a variable, consider moving it to a build.rs
file:
For reference I got my app to compile using the following:
fn main() {
if cfg!(target_os = "macos") {
println!("cargo:rustc-link-arg=-Wl,-undefined,dynamic_lookup,-lomp,-L/opt/homebrew/opt/libomp/lib");
} else if cfg!(target_os = "linux") {
println!("cargo:rustc-link-arg=-Wl,-undefined,dynamic_lookup,-lstdc++");
}
}
After installing libomp via brew
Not sure if anyone else on apple silicon is facing issues, but for the rust crate I had to manually add
RUSTFLAGS="-L/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/llvm/lib -lblas -llapack"
in order for the linker to work properly.Curious if this is a result of my local setup or an issue that others on silicon were facing for the rust crate