Skip to content

Commit 8862ae5

Browse files
authored
Merge pull request #92 from rust-math/seek-example
Executable for seeking MKL in system as an example
2 parents 9223712 + 724a1cd commit 8862ae5

File tree

6 files changed

+33
-48
lines changed

6 files changed

+33
-48
lines changed

.github/workflows/intel-mkl-tool.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request: {}
88

99
jobs:
10-
test:
10+
cargo-test:
1111
strategy:
1212
fail-fast: false
1313
matrix:
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/checkout@v1
2121
- uses: actions-rs/toolchain@v1
2222
with:
23-
toolchain: "1.56.0"
23+
toolchain: 1.61.0
2424
profile: minimal
2525
default: true
2626
override: true
@@ -29,27 +29,18 @@ jobs:
2929
with:
3030
command: test
3131
args: --manifest-path=intel-mkl-tool/Cargo.toml
32-
- name: cargo test with no-default-features
33-
uses: actions-rs/cargo@v1
34-
with:
35-
command: test
36-
args: >
37-
--manifest-path=intel-mkl-tool/Cargo.toml
38-
--no-default-features
3932

40-
test_pkg_config:
33+
seek:
4134
runs-on: ubuntu-22.04
4235
container:
4336
image: ghcr.io/rust-math/rust-mkl:1.62.1-2020.1
4437
steps:
4538
- uses: actions/checkout@v1
46-
- uses: actions-rs/cargo@v1
47-
name: Seek /opt/intel
39+
- name: Run seek example
40+
uses: actions-rs/cargo@v1
4841
with:
49-
command: test
42+
command: run
5043
args: >
5144
--manifest-path=intel-mkl-tool/Cargo.toml
52-
pkg_config
53-
--
54-
--ignored
55-
--show-output
45+
--release
46+
--example seek

intel-mkl-src/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.7.0+mkl2020.1"
44
authors = ["Toshiki Teramura <[email protected]>"]
55
edition = "2018"
66

7-
rust-version = "1.56.0" # MSRV is introduced
7+
rust-version = "1.61.0"
88

99
description = "Redistribution of Intel(R) MKL as a crate"
1010
repository = "https://github.com/rust-math/intel-mkl-src"

intel-mkl-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.2.0+mkl2020.1"
44
authors = ["Toshiki Teramura <[email protected]>"]
55
edition = "2018"
66

7-
rust-version = "1.56.0" # MSRV is introduced
7+
rust-version = "1.61.0"
88

99
description = "FFI for Intel(R) MKL"
1010
repository = "https://github.com/rust-math/intel-mkl-src"

intel-mkl-tool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "intel-mkl-tool"
33
version = "0.4.0"
44
authors = ["Toshiki Teramura <[email protected]>"]
55
edition = "2018"
6-
rust-version = "1.56.0" # MSRV is introduced
6+
rust-version = "1.61.0"
77

88
description = "CLI utility for redistributiing Intel(R) MKL"
99
repository = "https://github.com/rust-math/intel-mkl-src"

intel-mkl-tool/examples/seek.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
use intel_mkl_tool::*;
2+
use std::process::ExitCode;
3+
4+
fn main() -> ExitCode {
5+
let mut num_not_found = 0;
6+
for cfg in Config::possibles() {
7+
let lib = Library::new(cfg);
8+
print!(
9+
"{:>7} {:>5} {:>4}",
10+
cfg.link.to_string(),
11+
cfg.index_size.to_string(),
12+
cfg.parallel.to_string()
13+
);
14+
if let Ok(lib) = lib {
15+
println!(" {}", lib.library_dir.display());
16+
} else {
17+
num_not_found += 1;
18+
println!(" Not found");
19+
}
20+
}
21+
return ExitCode::from(num_not_found);
22+
}

intel-mkl-tool/src/entry.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -282,31 +282,3 @@ impl Library {
282282
Ok(())
283283
}
284284
}
285-
286-
#[cfg(test)]
287-
mod tests {
288-
use super::*;
289-
290-
/// Seek /opt/intel in Linux system
291-
#[ignore]
292-
#[test]
293-
fn seek_opt_intel() {
294-
for cfg in Config::possibles() {
295-
let lib = Library::seek_directory(cfg, "/opt/intel").unwrap().unwrap();
296-
dbg!(lib.version().unwrap());
297-
}
298-
}
299-
300-
#[ignore]
301-
#[test]
302-
fn pkg_config() {
303-
for cfg in Config::possibles() {
304-
// pkg-config will not work for `mkl-*-*-iomp` cases
305-
if cfg.parallel == Threading::OpenMP {
306-
continue;
307-
}
308-
let lib = Library::pkg_config(cfg).unwrap().unwrap();
309-
dbg!(lib.version().unwrap());
310-
}
311-
}
312-
}

0 commit comments

Comments
 (0)