Skip to content

Commit e1da718

Browse files
authored
Merge pull request #10 from Rufflewind/master
Add feature flag for tmglib
2 parents cd7c206 + 84a98a0 commit e1da718

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ exclude = [
2424
]
2525

2626
[features]
27-
default = ["cblas", "lapacke"]
27+
default = ["cblas", "lapacke", "tmg"]
2828

2929
cblas = []
3030
lapacke = []
3131
static = []
3232
system = []
33+
tmg = []
3334

3435
[build-dependencies]
3536
cmake = "0.1"

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ The following Cargo features are supported:
88

99
* `cblas` to build CBLAS (enabled by default),
1010
* `lapacke` to build LAPACKE (enabled by default),
11-
* `static` to link to Netlib statically, and
12-
* `system` to skip building the bundled Netlib.
11+
* `static` to link to Netlib statically,
12+
* `system` to skip building the bundled Netlib, and
13+
* `tmg` to build LAPACKE Test Matrix Generator (enabled by default).
1314

1415
## Contribution
1516

build.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ fn main() {
1616
};
1717
let cblas = feature!("CBLAS");
1818
let lapacke = feature!("LAPACKE");
19+
let tmg = feature!("TMG");
1920
if !feature!("SYSTEM") {
2021
suffix = "-netlib";
2122
let output = Config::new("source")
2223
.define("BUILD_TESTING", "OFF")
2324
.define("BUILD_SHARED_LIBS", switch!(kind == "dylib"))
2425
.define("CBLAS", switch!(cblas))
25-
.define("LAPACKE_WITH_TMG", switch!(lapacke))
26+
.define("LAPACKE_WITH_TMG", switch!(lapacke && tmg))
2627
.define("CMAKE_INSTALL_LIBDIR", "lib")
2728
.build();
2829
let output = output.join("lib");
@@ -38,7 +39,9 @@ fn main() {
3839
}
3940
if lapacke {
4041
println!("cargo:rustc-link-lib={}=lapacke", kind);
41-
println!("cargo:rustc-link-lib={}=tmglib", kind);
42+
if tmg {
43+
println!("cargo:rustc-link-lib={}=tmglib", kind);
44+
}
4245
}
4346
}
4447

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
//!
77
//! * `cblas` to build CBLAS (enabled by default),
88
//! * `lapacke` to build LAPACKE (enabled by default),
9-
//! * `static` to link to Netlib statically, and
10-
//! * `system` to skip building the bundled Netlib.
9+
//! * `static` to link to Netlib statically,
10+
//! * `system` to skip building the bundled Netlib, and
11+
//! * `tmg` to build LAPACKE Test Matrix Generator (enabled by default).
1112
//!
1213
//! [blas]: https://en.wikipedia.org/wiki/BLAS
1314
//! [lapack]: https://en.wikipedia.org/wiki/LAPACK

0 commit comments

Comments
 (0)