Skip to content

Commit 12e5e02

Browse files
committed
Move table to top README
1 parent 2bfa7cd commit 12e5e02

File tree

2 files changed

+36
-49
lines changed

2 files changed

+36
-49
lines changed

README.md

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ndarray-linalg
33
[![Crate](http://meritbadge.herokuapp.com/ndarray-linalg)](https://crates.io/crates/ndarray-linalg)
44
[![docs.rs](https://docs.rs/ndarray-linalg/badge.svg)](https://docs.rs/ndarray-linalg)
55

6-
Linear algebra package for Rust with [ndarray](https://github.com/bluss/ndarray) based on external LAPACK implementations.
6+
Linear algebra package for Rust with [ndarray](https://github.com/rust-ndarray/ndarray) based on external LAPACK implementations.
77

88
Examples
99
---------
@@ -22,34 +22,40 @@ and run all tests of ndarray-linalg with OpenBLAS
2222
cargo test --features=openblas
2323
```
2424

25-
BLAS/LAPACK Backend
26-
-------------------
25+
Backend Features
26+
-----------------
2727

28-
Three BLAS/LAPACK implementations are supported:
28+
There are three LAPACK source crates:
2929

30-
- [OpenBLAS](https://github.com/cmr/openblas-src)
31-
- needs `gfortran` (or other Fortran compiler)
32-
- [Netlib](https://github.com/cmr/netlib-src)
33-
- needs `cmake` and `gfortran`
34-
- [Intel MKL](https://github.com/termoshtt/rust-intel-mkl) (non-free license, see the linked page)
30+
- [openblas-src](https://github.com/blas-lapack-rs/openblas-src)
31+
- [netlib-src](https://github.com/blas-lapack-rs/netlib-src)
32+
- [intel-mkl-src](https://github.com/rust-math/rust-intel-mkl)
3533

36-
There are three features corresponding to the backend implementations (`openblas` / `netlib` / `intel-mkl`):
34+
`ndarray_linalg` must link **just one** of them for LAPACK FFI.
3735

3836
```toml
3937
[dependencies]
40-
ndarray = "0.13"
41-
ndarray-linalg = { version = "0.12", features = ["openblas"] }
38+
ndarray = "0.14"
39+
ndarray-linalg = { version = "0.13", features = ["openblas-static"] }
4240
```
4341

44-
### Tested Environments
42+
Supported features are following:
4543

46-
|Backend | Linux | Windows | macOS |
47-
|:--------|:-----:|:-------:|:-----:|
48-
|OpenBLAS |✔️ |- |- |
49-
|Netlib |✔️ |- |- |
50-
|Intel MKL|✔️ |✔️ |✔️ |
44+
| Feature | Link type | Requirements | Description |
45+
|:-----------------|:---------------|:--------------------|:-----------------------------------------------------------------------------------------------|
46+
| openblas-static | static | gcc, gfortran, make | Build OpenBLAS in your project, and link it statically |
47+
| openblas-system | dynamic/static | - | Seek OpenBLAS in system, and link it |
48+
| netlib-static | static | gfortran, make | Same as openblas-static except for using reference LAPACK |
49+
| netlib-system | dynamic/static | - | Same as openblas-system except for using reference LAPACK |
50+
| intel-mkl-static | static | (pkg-config) | Seek static library of Intel MKL from system, or download if not found, and link it statically |
51+
| intel-mkl-system | dynamic | (pkg-config) | Seek shared library of Intel MKL from system, and link it dynamically |
52+
53+
- You must use **just one** feature of them.
54+
- `dynamic/static` means it depends on what is found in the system. When the system has `/usr/lib/libopenblas.so`, it will be linked dynamically, and `/usr/lib/libopenblas.a` will be linked statically. Dynamic linking is prior to static linking.
55+
- `pkg-config` is used for searching Intel MKL packages in system, and it is optional. See [intel-mkl-src/README.md](https://github.com/rust-math/intel-mkl-src/blob/master/README.md#how-to-find-system-mkl-libraries) for detail.
56+
57+
### For library developer
5158

52-
### For librarian
5359
If you creating a library depending on this crate, we encourage you not to link any backend:
5460

5561
```toml
@@ -58,25 +64,21 @@ ndarray = "0.13"
5864
ndarray-linalg = "0.12"
5965
```
6066

61-
### Link backend crate manually
62-
For the sake of linking flexibility, you can provide LAPACKE implementation (as an `extern crate`) yourself.
63-
You should link a LAPACKE implementation to a final crate (like binary executable or dylib) only, not to a Rust library.
67+
The cargo's feature is additive. If your library (saying `lib1`) set a feature `openblas-static`,
68+
the application using `lib1` builds ndarray_linalg with `openblas-static` feature though they want to use `intel-mkl-static` backend.
6469

65-
```toml
66-
[dependencies]
67-
ndarray = "0.13"
68-
ndarray-linalg = "0.12"
69-
openblas-src = "0.7" # or another backend of your choice
70+
See [the cargo reference](https://doc.rust-lang.org/cargo/reference/features.html) for detail
7071

71-
```
72+
Tested Environments
73+
--------------------
7274

73-
You must add `extern crate` to your code in this case:
75+
Only x86_64 system is supported currently.
7476

75-
```rust
76-
extern crate ndarray;
77-
extern crate ndarray_linalg;
78-
extern crate openblas_src; // or another backend of your choice
79-
```
77+
|Backend | Linux | Windows | macOS |
78+
|:--------|:-----:|:-------:|:-----:|
79+
|OpenBLAS |✔️ |- |- |
80+
|Netlib |✔️ |- |- |
81+
|Intel MKL|✔️ |✔️ |✔️ |
8082

8183
Generate document with KaTeX
8284
------------------------------

lax/README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,3 @@ This crate responsibles for
77
- Linking to LAPACK shared/static libraries
88
- Dispatching to LAPACK routines based on scalar types by using `Lapack` trait
99

10-
Features
11-
---------
12-
13-
| Feature | Link type | Requirements | Description |
14-
|:-----------------|:---------------|:--------------------|:-----------------------------------------------------------------------------------------------|
15-
| openblas-static | static | gcc, gfortran, make | Build OpenBLAS in your project, and link it statically |
16-
| openblas-system | dynamic/static | - | Seek OpenBLAS in system, and link it |
17-
| netlib-static | static | gfortran, make | Same as openblas-static except for using reference LAPACK |
18-
| netlib-system | dynamic/static | - | Same as openblas-system except for using reference LAPACK |
19-
| intel-mkl-static | static | (pkg-config) | Seek static library of Intel MKL from system, or download if not found, and link it statically |
20-
| intel-mkl-system | dynamic | (pkg-config) | Seek shared library of Intel MKL from system, and link it dynamically |
21-
22-
- You must use **just one** feature of them.
23-
- `dynamic/static` means it depends on what is found in the system. When the system has `/usr/lib/libopenblas.so`, it will be linked dynamically, and `/usr/lib/libopenblas.a` will be linked statically. Dynamic linking is prior to static linking.
24-
- `pkg-config` is used for searching Intel MKL packages in system, and it is optional. See [intel-mkl-src/README.md](https://github.com/rust-math/intel-mkl-src/blob/master/README.md#how-to-find-system-mkl-libraries) for detail.

0 commit comments

Comments
 (0)