Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ready for release 0.13.0 #262

Merged
merged 13 commits into from
Feb 20, 2021
50 changes: 33 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,53 @@
Unreleased (will be 0.13.0)
==========================
Unreleased
-----------

0.13.0 - 20 Feb 2021
=====================

https://github.com/rust-ndarray/ndarray-linalg/milestone/5

Updated dependencies
---------------------
- ndarray 0.14 https://github.com/rust-ndarray/ndarray-linalg/pull/258
- cauchy 0.3.0 (num-complex 0.3.1, rand 0.7.3), lapack 0.17.0 https://github.com/rust-ndarray/ndarray-linalg/pull/260

### optional dependencies

- openblas-src 0.10.2 https://github.com/rust-ndarray/ndarray-linalg/pull/253
- intel-mkl-src 0.6.0 https://github.com/rust-ndarray/ndarray-linalg/pull/204

Added
------
- Split out `ndarray_linalg::lapack` as "lax" crate https://github.com/rust-ndarray/ndarray-linalg/pull/207
- cargo-workspace https://github.com/rust-ndarray/ndarray-linalg/pull/209

Changed
--------
- Dual license, MIT or Apache-2.0 License https://github.com/rust-ndarray/ndarray-linalg/pull/262
- Revise tests for least-square problem https://github.com/rust-ndarray/ndarray-linalg/pull/227
- New features for static linking https://github.com/rust-ndarray/ndarray-linalg/pull/204
- intel-mkl-src 0.6.0+mkl2020.1
- Drop LAPACKE dependence https://github.com/rust-ndarray/ndarray-linalg/pull/206
- Cholesky https://github.com/rust-ndarray/ndarray-linalg/pull/225
- Eigenvalue for general matrix https://github.com/rust-ndarray/ndarray-linalg/pull/212
- Eigenvalue for symmetric/Hermitian matrix https://github.com/rust-ndarray/ndarray-linalg/pull/217
- least squares problem https://github.com/rust-ndarray/ndarray-linalg/pull/220
- QR decomposition https://github.com/rust-ndarray/ndarray-linalg/pull/224
- LU decomposition https://github.com/rust-ndarray/ndarray-linalg/pull/213
- LDL decomposition https://github.com/rust-ndarray/ndarray-linalg/pull/216
- SVD https://github.com/rust-ndarray/ndarray-linalg/pull/218
- SVD divid-and-conquer https://github.com/rust-ndarray/ndarray-linalg/pull/219
- Tridiagonal https://github.com/rust-ndarray/ndarray-linalg/pull/235
- Named struct for `MatrixLayout` https://github.com/rust-ndarray/ndarray-linalg/pull/211
- Support static link to LAPACK backend https://github.com/rust-ndarray/ndarray-linalg/pull/204
- Drop LAPACKE dependence, and rewrite them in Rust (see below) https://github.com/rust-ndarray/ndarray-linalg/pull/206
- Named record like `C { row: i32, lda: i32 }` instead of enum for `MatrixLayout` https://github.com/rust-ndarray/ndarray-linalg/pull/211
- Split LAPACK error into computational failure and invalid values https://github.com/rust-ndarray/ndarray-linalg/pull/210
- Use thiserror crate https://github.com/rust-ndarray/ndarray-linalg/pull/208
- Fix for clippy, and add CI check https://github.com/rust-ndarray/ndarray-linalg/pull/205

### LAPACKE rewrite

- Cholesky https://github.com/rust-ndarray/ndarray-linalg/pull/225
- Eigenvalue for general matrix https://github.com/rust-ndarray/ndarray-linalg/pull/212
- Eigenvalue for symmetric/Hermitian matrix https://github.com/rust-ndarray/ndarray-linalg/pull/217
- least squares problem https://github.com/rust-ndarray/ndarray-linalg/pull/220
- QR decomposition https://github.com/rust-ndarray/ndarray-linalg/pull/224
- LU decomposition https://github.com/rust-ndarray/ndarray-linalg/pull/213
- LDL decomposition https://github.com/rust-ndarray/ndarray-linalg/pull/216
- SVD https://github.com/rust-ndarray/ndarray-linalg/pull/218
- SVD divid-and-conquer https://github.com/rust-ndarray/ndarray-linalg/pull/219
- Tridiagonal https://github.com/rust-ndarray/ndarray-linalg/pull/235

Maintenance
-----------
- Coverage report using codecov https://github.com/rust-ndarray/ndarray-linalg/pull/215
- Fix for clippy, and add CI check https://github.com/rust-ndarray/ndarray-linalg/pull/205

0.12.1 - 28 June 2020
======================
Expand Down
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

49 changes: 49 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# License

The project is dual licensed under the terms of the Apache License, Version 2.0,
and the MIT License. You may obtain copies of the two licenses at

* https://www.apache.org/licenses/LICENSE-2.0 and
* https://opensource.org/licenses/MIT, respectively.

The following two notices apply to every file of the project.

## The Apache License

```
Copyright 2016 The ndarray-linalg Developers

Licensed under the Apache License, Version 2.0 (the “License”); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
```

## The MIT License

```
Copyright 2016 The ndarray-linalg Developers

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
85 changes: 51 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ndarray-linalg
[![Crate](http://meritbadge.herokuapp.com/ndarray-linalg)](https://crates.io/crates/ndarray-linalg)
[![docs.rs](https://docs.rs/ndarray-linalg/badge.svg)](https://docs.rs/ndarray-linalg)

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

Examples
---------
Expand All @@ -22,34 +22,45 @@ and run all tests of ndarray-linalg with OpenBLAS
cargo test --features=openblas
```

BLAS/LAPACK Backend
-------------------
Backend Features
-----------------

Three BLAS/LAPACK implementations are supported:
There are three LAPACK source crates:

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

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

```toml
[dependencies]
ndarray = "0.13"
ndarray-linalg = { version = "0.12", features = ["openblas"] }
ndarray = "0.14"
ndarray-linalg = { version = "0.13", features = ["openblas-static"] }
```

### Tested Environments
Supported features are following:

|Backend | Linux | Windows | macOS |
|:--------|:-----:|:-------:|:-----:|
|OpenBLAS |✔️ |- |- |
|Netlib |✔️ |- |- |
|Intel MKL|✔️ |✔️ |✔️ |
| Feature | Link type | Requirements | Description |
|:-----------------|:---------------|:--------------------|:-----------------------------------------------------------------------------------------------|
| openblas-static | static | gcc, gfortran, make | Build OpenBLAS in your project, and link it statically |
| openblas-system | dynamic/static | libopenblas-dev | Seek OpenBLAS in system, and link it |
| netlib-static | static | gfortran, make | Same as openblas-static except for using reference LAPACK |
| netlib-system | dynamic/static | liblapack-dev | Same as openblas-system except for using reference LAPACK |
| intel-mkl-static | static | (pkg-config) | Seek static library of Intel MKL from system, or download if not found, and link it statically |
| intel-mkl-system | dynamic | (pkg-config) | Seek shared library of Intel MKL from system, and link it dynamically |

- You must use **just one** feature of them.
- `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.
- Requirements notices:
- `gcc` and `gfortran` can be another compiler, e.g. `icc` and `ifort`.
- `libopenblas-dev` is package name in Debian, Ubuntu, and other derived distributions.
There are several binary packages of OpenBLAS, i.e. `libopenblas-{openmp,pthread,serial}-dev`.
It can be other names in other distributions, e.g. Fedora, ArchLinux, and so on.
- `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.

### For library developer

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

```toml
Expand All @@ -58,25 +69,21 @@ ndarray = "0.13"
ndarray-linalg = "0.12"
```

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

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

```
Tested Environments
--------------------

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

```rust
extern crate ndarray;
extern crate ndarray_linalg;
extern crate openblas_src; // or another backend of your choice
```
|Backend | Linux | Windows | macOS |
|:--------|:-----:|:-------:|:-----:|
|OpenBLAS |✔️ |- |- |
|Netlib |✔️ |- |- |
|Intel MKL|✔️ |✔️ |✔️ |

Generate document with KaTeX
------------------------------
Expand All @@ -96,3 +103,13 @@ rustdocflags = ["--html-in-header", "katex-header.html"]
```

But, be sure that this works only for `--no-deps`. `cargo doc` will fail with this `.cargo/config`.

License
--------

**CAUTION** Be sure that if you use `intel-mkl-src` backend, you have to accept [Intel Simplified Software License](https://software.intel.com/content/www/us/en/develop/articles/end-user-license-agreement.html)
in addition to the MIT-License or Apache-2.0 License.

Dual-licensed to be compatible with the Rust project.
Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 or the MIT license http://opensource.org/licenses/MIT, at your option.

17 changes: 14 additions & 3 deletions lax/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ version = "0.1.0"
authors = ["Toshiki Teramura <[email protected]>"]
edition = "2018"

description = "LAPACK wrapper without ndarray"
documentation = "https://docs.rs/lax/"
repository = "https://github.com/rust-ndarray/ndarray-linalg"
keywords = ["lapack", "matrix"]
license = "MIT OR Apache-2.0"
readme = "README.md"
categories = ["algorithms", "science"]

[features]
default = []

Expand All @@ -21,10 +29,10 @@ intel-mkl-static = ["intel-mkl-src/mkl-static-lp64-seq", "intel-mkl-src/download
intel-mkl-system = ["intel-mkl-src/mkl-dynamic-lp64-seq"]

[dependencies]
thiserror = "1.0"
thiserror = "1.0.23"
cauchy = "0.3.0"
num-traits = "0.2"
lapack = { version = "0.17.0", git = "http://github.com/blas-lapack-rs/lapack" }
num-traits = "0.2.14"
lapack = "0.17.0"

[dependencies.intel-mkl-src]
version = "0.6.0"
Expand All @@ -42,3 +50,6 @@ version = "0.10.2"
optional = true
default-features = false
features = ["cblas"]

[package.metadata.release]
no-dev-version = true
8 changes: 8 additions & 0 deletions lax/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Linear Algebra eXtension (LAX)
===============================

ndarray-free safe Rust wrapper for LAPACK FFI for implementing ndarray-linalg crate.
This crate responsibles for

- Linking to LAPACK shared/static libraries
- Dispatching to LAPACK routines based on scalar types by using `Lapack` trait
9 changes: 6 additions & 3 deletions ndarray-linalg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "ndarray-linalg"
version = "0.13.0-alpha.0"
version = "0.13.0"
authors = ["Toshiki Teramura <[email protected]>"]
edition = "2018"

description = "Linear algebra package for rust-ndarray using LAPACK"
documentation = "https://docs.rs/ndarray-linalg/"
repository = "https://github.com/rust-ndarray/ndarray-linalg"
keywords = ["ndarray", "lapack", "matrix"]
license = "MIT"
readme = "README.md"
license = "MIT OR Apache-2.0"
readme = "../README.md"
categories = ["algorithms", "science"]

[features]
Expand Down Expand Up @@ -81,3 +81,6 @@ harness = false

[package.metadata.docs.rs]
rustdoc-args = ["--html-in-header", "katex-header.html"]

[package.metadata.release]
no-dev-version = true