Comments (5)
sure, here's a simple binary crate I used to test the expm routine I'm trying to get pulled in: basic M1 setup. Look at blas-src
in Cargo.toml
and build.rs
, that should be enough to get going on M1 mac.
from ndarray-linalg.
the built in apple framework for BLAS/LAPACK is Accelerate, ndarray and ndarray-linalg are both capable of using it (you may have to add a simple build.rs file but it's not too bad once you know the magic words). here is the blas_src page which is a good starting point, it links to the apple accelerate page.
source: not a maintainer, I use this library and have apple M1 laptop.
from ndarray-linalg.
Hello,
Can you provide an example how to prepare a build.rs only for MacOS? I saw that both ndarray and ndarray-linalg rely directly on openblas-src, intel-mkl-src et.al.
Thanks,
Jianshu
from ndarray-linalg.
that was a personal helper binary, I figured it'd be easier to point you to it so you could pull out the Cargo.toml
and the build.rs
files instead of putting them in a github comment
from ndarray-linalg.
Hello all,
Please help if you can, this crate: https://github.com/jean-pierreBoth/annembed
I tried your suggestion and use blas-src, accelerate as the backend, but it does not work, the 3 features, openblas-system is the only one that works on M1 (aarch63) platform. Can you please try at your end. The problem is with ndarray-linalg, ndarray can use accelerate as back end easily but I always have this error:
error: linking with cc
failed: exit status: 1
|
= note: LC_ALL="C" PATH="/Users/jianshuzhao/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/opt/homebrew/opt/llvm/bin:/Users/jianshuzhao/bin:/Users/jianshuzhao/.cargo/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-arch" "arm64" "/var/folders/r_/nxv9frrj1jqgpn0_k63qgcf00000gn/T/rustc8vx1ts/symbols.o" "/Users/jianshuzhao/annembed/target/release/deps/annembed-e1a28c0193cd19a4.annembed.d4b81043660c57ba-cgu.15.rcgu.o" "-L" "/Users/jianshuzhao/annembed/target/release/deps" "-L" "/Users/jianshuzhao/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/jianshuzhao/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-d1be01496bebb995.rlib" "-liconv" "-lSystem" "-lc" "-lm" "-L" "/Users/jianshuzhao/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/jianshuzhao/annembed/target/release/deps/annembed-e1a28c0193cd19a4" "-Wl,-dead_strip" "-nodefaultlibs"
= note: Undefined symbols for architecture arm64:
"cblas_sdot", referenced from:
ndarray::linalg::impl_linalg::$LT$impl$u20$ndarray..ArrayBase$LT$S$C$ndarray..dimension..dim..Dim$LT$$u5b$usize$u3b$$u20$1$u5d$$GT$$GT$$GT$::dot_impl::hc9d82004e6b67209 in annembed-e1a28c0193cd19a4.annembed.d4b81043660c57ba-cgu.15.rcgu.o
annembed::tools::svdapprox::orthogonalize_with_q::h6f5c603b187435d8 in annembed-e1a28c0193cd19a4.annembed.d4b81043660c57ba-cgu.15.rcgu.o
"_cblas_sgemm", referenced from:
ndarray::linalg::impl_linalg::mat_mul_impl::hc582838647e30f97 in annembed-e1a28c0193cd19a4.annembed.d4b81043660c57ba-cgu.15.rcgu.o
"_cblas_sgemv", referenced from:
annembed::tools::svdapprox::MatRepr$LT$F$GT$::mat_dot_vector::h9aa49b98bb2b9a83 in annembed-e1a28c0193cd19a4.annembed.d4b81043660c57ba-cgu.15.rcgu.o
"sgelqf", referenced from:
annembed::tools::svdapprox::do_qr::hd984509065202632 in annembed-e1a28c0193cd19a4.annembed.d4b81043660c57ba-cgu.15.rcgu.o
"sgesdd", referenced from:
_$LT$f32$u20$as$u20$lax..Lapack$GT$::svddc::h796bc8ee227c7814 in annembed-e1a28c0193cd19a4.annembed.d4b81043660c57ba-cgu.15.rcgu.o
"sorglq", referenced from:
annembed::tools::svdapprox::do_qr::hd984509065202632 in annembed-e1a28c0193cd19a4.annembed.d4b81043660c57ba-cgu.15.rcgu.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
here I have CC using both the default clang, or gcc installed via brew, none of them work.
Thanks,
Jianshu
from ndarray-linalg.
Related Issues (20)
- Deterministic testing HOT 1
- ARM clibs with u8 HOT 4
- Autovectorization on x86
- solve doesn't return the expected vector
- Add keyword #linear-agebra for cargo.io discovery
- LAPACK linker errors HOT 1
- accelerate framework support macOS HOT 12
- Link problem with intel-mkl on Windows when using both stats + linalg in a single project HOT 1
- How to install on OSX HOT 1
- Build fails on arm64 mac running linux. HOT 1
- Unnecessary trait bound
- Eigh eigenvectors are inverted
- `error LNK2019: unresolved external symbol zgtcon_` under Windows HOT 4
- Linking on Debian: libblas instead of libcblas
- Apple silicon compile error: "ld: Undefined symbols" HOT 1
- stop LAPACK least_squares from printing / verbose
- add function of cholesky update
- Rust 1.79 failed?
- ARM performance library support?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ndarray-linalg.