Skip to content

Commit 42779dc

Browse files
authored
Merge pull request #204 from rust-ndarray/static-srcs
Link LAPACK statically
2 parents 34f7b99 + f977c5c commit 42779dc

File tree

8 files changed

+149
-66
lines changed

8 files changed

+149
-66
lines changed

.github/workflows/intel-mkl.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: intel-mkl
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request: {}
8+
9+
jobs:
10+
windows:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
feature:
15+
- intel-mkl-static
16+
runs-on: windows-2019
17+
steps:
18+
- uses: actions/checkout@v1
19+
- uses: actions-rs/cargo@v1
20+
with:
21+
command: test
22+
args: >
23+
--manifest-path=ndarray-linalg/Cargo.toml
24+
--no-default-features
25+
--features=${{ matrix.feature }}
26+
27+
linux:
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
feature:
32+
- intel-mkl-static
33+
runs-on: ubuntu-18.04
34+
steps:
35+
- uses: actions/checkout@v1
36+
- uses: actions-rs/cargo@v1
37+
name: cargo test
38+
with:
39+
command: test
40+
args: >
41+
--manifest-path=ndarray-linalg/Cargo.toml
42+
--no-default-features
43+
--features=${{ matrix.feature }}

.github/workflows/ndarray-linalg.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/netlib.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: netlib
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request: {}
8+
9+
jobs:
10+
linux:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
feature:
15+
- static
16+
runs-on: ubuntu-18.04
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: apt install gfortran
20+
run: |
21+
sudo apt update
22+
sudo apt install -y gfortran
23+
- uses: actions-rs/cargo@v1
24+
with:
25+
command: test
26+
args: >
27+
--manifest-path=ndarray-linalg/Cargo.toml
28+
--no-default-features
29+
--features=netlib-${{ matrix.feature }}

.github/workflows/openblas.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: openblas
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request: {}
8+
9+
jobs:
10+
linux:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
feature:
15+
- system
16+
- static
17+
runs-on: ubuntu-18.04
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: apt install gfortran
21+
run: |
22+
sudo apt update
23+
sudo apt install -y gfortran
24+
- name: apt install openblas
25+
run: |
26+
sudo apt update
27+
sudo apt install -y libopenblas-dev
28+
if: ${{ matrix.feature == 'system' }}
29+
- uses: actions-rs/cargo@v1
30+
with:
31+
command: test
32+
args: >
33+
--manifest-path=ndarray-linalg/Cargo.toml
34+
--no-default-features
35+
--features=openblas-${{ matrix.feature }}

lax/Cargo.toml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,40 @@ authors = ["Toshiki Teramura <[email protected]>"]
55
edition = "2018"
66

77
[features]
8-
default = []
9-
intel-mkl = ["lapack-src/intel-mkl", "blas-src/intel-mkl"]
10-
netlib = ["lapack-src/netlib", "blas-src/netlib"]
11-
openblas = ["lapack-src/openblas", "blas-src/openblas"]
8+
default = []
9+
10+
netlib = ["netlib-static"]
11+
openblas = ["openblas-static"]
12+
intel-mkl = ["intel-mkl-static"]
13+
14+
netlib-static = ["netlib-src/static"]
15+
netlib-system = ["netlib-src/system"]
16+
17+
openblas-static = ["openblas-src/static"]
18+
openblas-system = ["openblas-src/system"]
19+
20+
intel-mkl-static = ["intel-mkl-src/mkl-static-lp64-seq", "intel-mkl-src/download"]
21+
intel-mkl-system = ["intel-mkl-src/mkl-dynamic-lp64-seq"]
1222

1323
[dependencies]
1424
thiserror = "1.0"
1525
cauchy = "0.2.0"
1626
num-traits = "0.2"
1727
lapack = "0.16.0"
1828

19-
[dependencies.blas-src]
20-
version = "0.6.1"
29+
[dependencies.intel-mkl-src]
30+
version = "0.6.0"
2131
default-features = false
32+
optional = true
2233

23-
[dependencies.lapack-src]
24-
version = "0.6.0"
34+
[dependencies.netlib-src]
35+
version = "0.8.0"
36+
optional = true
37+
features = ["cblas"]
2538
default-features = false
2639

2740
[dependencies.openblas-src]
2841
version = "0.9.0"
29-
default-features = false
30-
features = ["static"]
3142
optional = true
43+
default-features = false
44+
features = ["cblas"]

lax/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,14 @@
5959
//! [svddc]: svddck/trait.SVDDC_.html#tymethod.svddc
6060
//! [least_squares]: least_squares/trait.LeastSquaresSvdDivideConquer_.html#tymethod.least_squares
6161
62-
extern crate blas_src;
63-
extern crate lapack_src;
62+
#[cfg(any(feature = "intel-mkl-system", feature = "intel-mkl-static"))]
63+
extern crate intel_mkl_src as _src;
64+
65+
#[cfg(any(feature = "openblas-system", feature = "openblas-static"))]
66+
extern crate openblas_src as _src;
67+
68+
#[cfg(any(feature = "netlib-system", feature = "netlib-static"))]
69+
extern crate netlib_src as _src;
6470

6571
pub mod cholesky;
6672
pub mod eig;

ndarray-linalg/Cargo.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,19 @@ categories = ["algorithms", "science"]
1414

1515
[features]
1616
default = []
17-
intel-mkl = ["lax/intel-mkl"]
17+
1818
netlib = ["lax/netlib"]
1919
openblas = ["lax/openblas"]
20+
intel-mkl = ["lax/intel-mkl"]
21+
22+
netlib-static = ["lax/netlib-static"]
23+
netlib-system = ["lax/netlib-system"]
24+
25+
openblas-static = ["lax/openblas-static"]
26+
openblas-system = ["lax/openblas-system"]
27+
28+
intel-mkl-static = ["lax/intel-mkl-static"]
29+
intel-mkl-system = ["lax/intel-mkl-system"]
2030

2131
[dependencies]
2232
cauchy = "0.2.2"

ndarray-linalg/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747

4848
#[macro_use]
4949
extern crate ndarray;
50-
5150
extern crate lax as lapack;
5251

5352
pub mod assert;

0 commit comments

Comments
 (0)