@@ -4,30 +4,32 @@ ndarray-linalg
44[ ![ docs.rs] ( https://docs.rs/ndarray-linalg/badge.svg )] ( https://docs.rs/ndarray-linalg )
55[ ![ wercker status] ( https://app.wercker.com/status/f04aeba682ea6e79577e15bd946344a5/s/master " wercker status ")] ( https://app.wercker.com/project/byKey/f04aeba682ea6e79577e15bd946344a5 )
66
7- Linear algebra package for Rust.
7+ Linear algebra package for Rust with [ rust-ndarray ] ( https://github.com/bluss/rust-ndarray ) .
88
9- Dependencies
10- -------------
9+ LAPACKE Backend
10+ ----------------
1111
12- - [ bluss/rust-ndarray] ( https://github.com/bluss/rust-ndarray )
13- - [ blas-lapack-rs/lapacke] ( https://github.com/blas-lapack-rs/lapacke )
14-
15- and more (See Cargo.toml).
16-
17- Choosing LAPACKE implementation
18- --------------------------------
19-
20- For the sake of linking flexibility, you must provide LAPACKE implementation (as an ` extern crate ` ) yourself.
2112Currently three LAPACKE implementations are supported and tested:
2213
2314- [ OpenBLAS] ( https://github.com/cmr/openblas-src )
2415- [ Netlib] ( https://github.com/cmr/netlib-src )
2516- [ Intel MKL] ( https://github.com/termoshtt/rust-intel-mkl ) (non-free license, see the linked page)
2617
18+ There are two ways to link LAPACKE backend:
19+
20+ ### backend features (recommended)
21+ There are three features corresponding to the backend implementations (` openblas ` / ` netlib ` / ` intel-mkl ` ):
22+
23+ ``` toml
24+ [depencdencies ]
25+ ndarray = " 0.10"
26+ ndarray-linalg = { version = " 0.8" , features = [" openblas" ] }
27+ ```
28+
29+ ### link backend crate manually
30+ For the sake of linking flexibility, you can provide LAPACKE implementation (as an ` extern crate ` ) yourself.
2731You should link a LAPACKE implementation to a final crate (like binary executable or dylib) only, not to a Rust library.
28- Example:
2932
30- ` Cargo.toml ` :
3133``` toml
3234[depencdencies ]
3335ndarray = " 0.10"
@@ -36,13 +38,25 @@ openblas-src = "0.5" # or another backend of your choice
3638
3739```
3840
39- ` main.rs ` :
41+ You must add ` extern crate ` to your code in this case:
42+
4043``` rust
4144extern crate ndarray;
4245extern crate ndarray_linalg;
4346extern crate openblas_src; // or another backend of your choice
4447```
4548
49+ ### For librarian
50+ If you creating a library depending on this crate, we encourage you not to link any backend for flexibility:
51+
52+ ``` toml
53+ [depencdencies ]
54+ ndarray = " 0.10"
55+ ndarray-linalg = { version = " 0.8" , default-features = false }
56+ ```
57+
58+ However, if you hope simplicity instead of the flexibility, you can link your favorite backend in the way described above.
59+
4660Examples
4761---------
4862See [ examples] ( https://github.com/termoshtt/ndarray-linalg/tree/master/examples ) directory.
0 commit comments