diff --git a/.github/workflows/intel-mkl.yml b/.github/workflows/intel-mkl.yml new file mode 100644 index 00000000..9b150ff8 --- /dev/null +++ b/.github/workflows/intel-mkl.yml @@ -0,0 +1,43 @@ +name: intel-mkl + +on: + push: + branches: + - master + pull_request: {} + +jobs: + windows: + strategy: + fail-fast: false + matrix: + feature: + - intel-mkl-static + runs-on: windows-2019 + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/cargo@v1 + with: + command: test + args: > + --manifest-path=ndarray-linalg/Cargo.toml + --no-default-features + --features=${{ matrix.feature }} + + linux: + strategy: + fail-fast: false + matrix: + feature: + - intel-mkl-static + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/cargo@v1 + name: cargo test + with: + command: test + args: > + --manifest-path=ndarray-linalg/Cargo.toml + --no-default-features + --features=${{ matrix.feature }} diff --git a/.github/workflows/ndarray-linalg.yml b/.github/workflows/ndarray-linalg.yml deleted file mode 100644 index f613eb38..00000000 --- a/.github/workflows/ndarray-linalg.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: ndarray-linalg - -on: - push: - branches: - - master - pull_request: {} - -jobs: - windows: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v1 - - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=ndarray-linalg/Cargo.toml --features=intel-mkl --no-default-features - - macos: - runs-on: macos-10.15 - strategy: - fail-fast: false - matrix: - feature: - - intel-mkl - steps: - - uses: actions/checkout@v1 - - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=ndarray-linalg/Cargo.toml --features=${{ matrix.feature }} --no-default-features --all-targets - - linux: - runs-on: ubuntu-18.04 - strategy: - fail-fast: false - matrix: - feature: - - netlib - - openblas - - intel-mkl - steps: - - uses: actions/checkout@v1 - - name: apt-install gfortran - run: | - sudo apt update - sudo apt install -y gfortran - if: ${{ matrix.feature != 'intel-mkl' }} - - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=ndarray-linalg/Cargo.toml --features=${{ matrix.feature }} --no-default-features --all-targets diff --git a/.github/workflows/netlib.yml b/.github/workflows/netlib.yml new file mode 100644 index 00000000..f278f0ca --- /dev/null +++ b/.github/workflows/netlib.yml @@ -0,0 +1,29 @@ +name: netlib + +on: + push: + branches: + - master + pull_request: {} + +jobs: + linux: + strategy: + fail-fast: false + matrix: + feature: + - static + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - name: apt install gfortran + run: | + sudo apt update + sudo apt install -y gfortran + - uses: actions-rs/cargo@v1 + with: + command: test + args: > + --manifest-path=ndarray-linalg/Cargo.toml + --no-default-features + --features=netlib-${{ matrix.feature }} diff --git a/.github/workflows/openblas.yml b/.github/workflows/openblas.yml new file mode 100644 index 00000000..40d28b80 --- /dev/null +++ b/.github/workflows/openblas.yml @@ -0,0 +1,35 @@ +name: openblas + +on: + push: + branches: + - master + pull_request: {} + +jobs: + linux: + strategy: + fail-fast: false + matrix: + feature: + - system + - static + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - name: apt install gfortran + run: | + sudo apt update + sudo apt install -y gfortran + - name: apt install openblas + run: | + sudo apt update + sudo apt install -y libopenblas-dev + if: ${{ matrix.feature == 'system' }} + - uses: actions-rs/cargo@v1 + with: + command: test + args: > + --manifest-path=ndarray-linalg/Cargo.toml + --no-default-features + --features=openblas-${{ matrix.feature }} diff --git a/lax/Cargo.toml b/lax/Cargo.toml index 84604074..574cadf8 100644 --- a/lax/Cargo.toml +++ b/lax/Cargo.toml @@ -5,10 +5,20 @@ authors = ["Toshiki Teramura "] edition = "2018" [features] -default = [] -intel-mkl = ["lapack-src/intel-mkl", "blas-src/intel-mkl"] -netlib = ["lapack-src/netlib", "blas-src/netlib"] -openblas = ["lapack-src/openblas", "blas-src/openblas"] +default = [] + +netlib = ["netlib-static"] +openblas = ["openblas-static"] +intel-mkl = ["intel-mkl-static"] + +netlib-static = ["netlib-src/static"] +netlib-system = ["netlib-src/system"] + +openblas-static = ["openblas-src/static"] +openblas-system = ["openblas-src/system"] + +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" @@ -16,16 +26,19 @@ cauchy = "0.2.0" num-traits = "0.2" lapack = "0.16.0" -[dependencies.blas-src] -version = "0.6.1" +[dependencies.intel-mkl-src] +version = "0.6.0" default-features = false +optional = true -[dependencies.lapack-src] -version = "0.6.0" +[dependencies.netlib-src] +version = "0.8.0" +optional = true +features = ["cblas"] default-features = false [dependencies.openblas-src] version = "0.9.0" -default-features = false -features = ["static"] optional = true +default-features = false +features = ["cblas"] diff --git a/lax/src/lib.rs b/lax/src/lib.rs index 5d1fb0eb..51efffd1 100644 --- a/lax/src/lib.rs +++ b/lax/src/lib.rs @@ -59,8 +59,14 @@ //! [svddc]: svddck/trait.SVDDC_.html#tymethod.svddc //! [least_squares]: least_squares/trait.LeastSquaresSvdDivideConquer_.html#tymethod.least_squares -extern crate blas_src; -extern crate lapack_src; +#[cfg(any(feature = "intel-mkl-system", feature = "intel-mkl-static"))] +extern crate intel_mkl_src as _src; + +#[cfg(any(feature = "openblas-system", feature = "openblas-static"))] +extern crate openblas_src as _src; + +#[cfg(any(feature = "netlib-system", feature = "netlib-static"))] +extern crate netlib_src as _src; pub mod cholesky; pub mod eig; diff --git a/ndarray-linalg/Cargo.toml b/ndarray-linalg/Cargo.toml index 717a6d09..81438327 100644 --- a/ndarray-linalg/Cargo.toml +++ b/ndarray-linalg/Cargo.toml @@ -14,9 +14,19 @@ categories = ["algorithms", "science"] [features] default = [] -intel-mkl = ["lax/intel-mkl"] + netlib = ["lax/netlib"] openblas = ["lax/openblas"] +intel-mkl = ["lax/intel-mkl"] + +netlib-static = ["lax/netlib-static"] +netlib-system = ["lax/netlib-system"] + +openblas-static = ["lax/openblas-static"] +openblas-system = ["lax/openblas-system"] + +intel-mkl-static = ["lax/intel-mkl-static"] +intel-mkl-system = ["lax/intel-mkl-system"] [dependencies] cauchy = "0.2.2" diff --git a/ndarray-linalg/src/lib.rs b/ndarray-linalg/src/lib.rs index 0a22591f..33fbacef 100644 --- a/ndarray-linalg/src/lib.rs +++ b/ndarray-linalg/src/lib.rs @@ -47,7 +47,6 @@ #[macro_use] extern crate ndarray; - extern crate lax as lapack; pub mod assert;