Skip to content

Commit

Permalink
Merge pull request #204 from rust-ndarray/static-srcs
Browse files Browse the repository at this point in the history
Link LAPACK statically
  • Loading branch information
termoshtt authored Jul 27, 2020
2 parents 34f7b99 + f977c5c commit 42779dc
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 66 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/intel-mkl.yml
Original file line number Diff line number Diff line change
@@ -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 }}
52 changes: 0 additions & 52 deletions .github/workflows/ndarray-linalg.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/netlib.yml
Original file line number Diff line number Diff line change
@@ -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 }}
35 changes: 35 additions & 0 deletions .github/workflows/openblas.yml
Original file line number Diff line number Diff line change
@@ -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 }}
33 changes: 23 additions & 10 deletions lax/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,40 @@ authors = ["Toshiki Teramura <toshiki.teramura@gmail.com>"]
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"
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"]
10 changes: 8 additions & 2 deletions lax/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 11 additions & 1 deletion ndarray-linalg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion ndarray-linalg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@

#[macro_use]
extern crate ndarray;

extern crate lax as lapack;

pub mod assert;
Expand Down

0 comments on commit 42779dc

Please sign in to comment.