Skip to content

Commit 83715b9

Browse files
committed
Migrate to lapacke library, drop linking Cargo features
Also bumped version to 0.8
1 parent 29c4228 commit 83715b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+176
-95
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ Cargo.lock
1010

1111
# cargo fmt
1212
*.bk
13+
14+
# IntelliJ Rust
15+
.idea
16+
*.iml

Cargo.toml

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
[workspace]
2+
members = ["lapacke-provider", "integration-tests"]
3+
14
[package]
25
name = "ndarray-linalg"
3-
version = "0.7.1"
6+
version = "0.8.0"
47
authors = ["Toshiki Teramura <[email protected]>"]
58

69
description = "Linear algebra package for rust-ndarray using LAPACK"
@@ -11,40 +14,17 @@ license = "MIT"
1114
readme = "README.md"
1215
categories = ["algorithms", "science"]
1316

14-
[features]
15-
default = ["openblas-static"]
16-
openblas-shared = ["lapack/openblas"]
17-
openblas-static = ["lapack/openblas", "openblas-src/static"]
18-
openblas-system = ["lapack/openblas", "openblas-src/system"]
19-
netlib-shared = ["lapack/netlib"]
20-
netlib-static = ["lapack/netlib", "netlib-src/static"]
21-
netlib-system = ["lapack/netlib", "netlib-src/system"]
22-
intel-mkl = ["intel-mkl-src"]
23-
2417
[dependencies]
2518
rand = "0.3"
2619
derive-new = "0.5"
2720
procedurals = "0.2"
2821
num-traits = "0.1"
29-
num-complex = "0.1"
30-
lapack = { version = "0.13", default-features = false }
31-
lapack-sys = { version = "0.11", default-features = false }
22+
num-complex = { version = "0.1", default-features = false }
23+
lapacke = "0.1.4"
3224

3325
[dependencies.ndarray]
3426
version = "0.10"
3527
default-features = false
3628

37-
[dependencies.openblas-src]
38-
version = "0.5.3"
39-
default-features = false
40-
optional = true
41-
42-
[dependencies.netlib-src]
43-
version = "0.7.0"
44-
default-features = false
45-
optional = true
46-
47-
[dependencies.intel-mkl-src]
48-
version = "0.2.5"
49-
default-features = false
50-
optional = true
29+
[dev-dependencies]
30+
lapacke-provider = { path = "lapacke-provider", features = ["openblas-src"] }

README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,38 @@ Dependencies
1010
-------------
1111

1212
- [bluss/rust-ndarray](https://github.com/bluss/rust-ndarray)
13-
- [stainless-steel/lapack](https://github.com/stainless-steel/lapack)
13+
- [blas-lapack-rs/lapacke](https://github.com/blas-lapack-rs/lapacke)
1414

1515
and more (See Cargo.toml).
1616

17-
Feature flags
18-
--------------
17+
Choosing LAPACKE implementation
18+
--------------------------------
19+
20+
For the sake of linking flexibility, you must provide LAPACKE implementation (as an `extern crate`) yourself.
21+
Currently three LAPACKE implementations are supported and tested:
1922

2023
- [OpenBLAS](https://github.com/cmr/openblas-src)
21-
- `openblas-static`: use OpenBLAS with static link (default)
22-
- `openblas-shared`: use OpenBLAS with shared link
23-
- `openblas-system`: use system OpenBLAS (experimental)
2424
- [Netlib](https://github.com/cmr/netlib-src)
25-
- `netlib-static`: use Netlib with static link (default)
26-
- `netlib-shared`: use Netlib with shared link
27-
- `netlib-system`: use system Netlib (experimental)
2825
- [Intel MKL](https://github.com/termoshtt/rust-intel-mkl) (non-free license, see the linked page)
29-
- `intel-mkl`: use Intel MKL shared link (experimental)
26+
27+
You should link a LAPACKE implementation to a final crate (like binary executable or dylib) only, not to a Rust library.
28+
Example:
29+
30+
`Cargo.toml`:
31+
```toml
32+
[depencdencies]
33+
ndarray = "0.10"
34+
ndarray-linalg = "0.8"
35+
openblas-src = "0.5" # or another backend of your choice
36+
37+
```
38+
39+
`main.rs`:
40+
```rust
41+
extern crate ndarray;
42+
extern crate ndarray_linalg;
43+
extern crate openblas_src; // or another backend of your choice
44+
```
3045

3146
Examples
3247
---------

examples/eigh.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
extern crate ndarray;
33
extern crate ndarray_linalg;
4+
extern crate lapacke_provider;
45

56
use ndarray::*;
67
use ndarray_linalg::*;

examples/solve.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
extern crate ndarray;
33
extern crate ndarray_linalg;
4+
extern crate lapacke_provider;
45

56
use ndarray::*;
67
use ndarray_linalg::*;

examples/solveh.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
extern crate ndarray;
33
extern crate ndarray_linalg;
4+
extern crate lapacke_provider;
45

56
use ndarray::*;
67
use ndarray_linalg::*;

integration-tests/Cargo.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "integration-tests"
3+
version = "0.1.0"
4+
authors = ["Alexander Bulaev <[email protected]>"]
5+
description = "Support crate for testing ndarray-linalg"
6+
publish = false
7+
8+
[features]
9+
default = ["openblas-src"]
10+
openblas-src = ["lapacke-provider/openblas-src"]
11+
netlib-src = ["lapacke-provider/netlib-src"]
12+
intel-mkl-src = ["lapacke-provider/intel-mkl-src"]
13+
14+
[dependencies]
15+
lapacke-provider = { path = "../lapacke-provider" }
16+
17+
[dev-dependencies]
18+
ndarray = { version = "*", default-features = false }
19+
ndarray-linalg = { path = ".." }
20+
num-traits = "*"

integration-tests/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extern crate lapacke_provider;

tests/assert.rs renamed to integration-tests/tests/assert.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
extern crate ndarray;
33
#[macro_use]
44
extern crate ndarray_linalg;
5+
extern crate lapacke_provider;
56

67
#[test]
78
fn assert() {

tests/cholesky.rs renamed to integration-tests/tests/cholesky.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
extern crate ndarray;
33
#[macro_use]
44
extern crate ndarray_linalg;
5+
extern crate lapacke_provider;
56

67
use ndarray::*;
78
use ndarray_linalg::*;

0 commit comments

Comments
 (0)