diff --git a/CHANGELOG.md b/CHANGELOG.md index c438fff1..d15ccf81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,21 @@ -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 @@ -10,28 +23,31 @@ Added 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 ====================== diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 793cc93b..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Toshiki Teramura - -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. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..55150e4b --- /dev/null +++ b/LICENSE.md @@ -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. +``` diff --git a/README.md b/README.md index d9fba45e..4478dca3 100644 --- a/README.md +++ b/README.md @@ -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 --------- @@ -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 @@ -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 ------------------------------ @@ -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. + diff --git a/lax/Cargo.toml b/lax/Cargo.toml index c222d66f..812ad126 100644 --- a/lax/Cargo.toml +++ b/lax/Cargo.toml @@ -4,6 +4,14 @@ version = "0.1.0" authors = ["Toshiki Teramura "] 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 = [] @@ -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" @@ -42,3 +50,6 @@ version = "0.10.2" optional = true default-features = false features = ["cblas"] + +[package.metadata.release] +no-dev-version = true diff --git a/lax/README.md b/lax/README.md new file mode 100644 index 00000000..ed563735 --- /dev/null +++ b/lax/README.md @@ -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 diff --git a/ndarray-linalg/Cargo.toml b/ndarray-linalg/Cargo.toml index f4b8e4d1..63fa3e86 100644 --- a/ndarray-linalg/Cargo.toml +++ b/ndarray-linalg/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ndarray-linalg" -version = "0.13.0-alpha.0" +version = "0.13.0" authors = ["Toshiki Teramura "] edition = "2018" @@ -8,8 +8,8 @@ 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] @@ -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