Skip to content

Commit 83d04c0

Browse files
authored
Merge pull request #81 from rust-math/rewrite-tool-entry
Re-implement intel-mkl-tool
2 parents 7043596 + 2356b1a commit 83d04c0

File tree

8 files changed

+281
-395
lines changed

8 files changed

+281
-395
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- mkl-dynamic-ilp64-seq
2323
runs-on: ubuntu-22.04
2424
container:
25-
image: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.56.0
25+
image: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.56.0-1
2626
steps:
2727
- uses: actions/checkout@v1
2828
- uses: actions-rs/cargo@v1

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

+11-9
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os:
15-
- windows-2019
16-
- macos-10.15
15+
- windows-2022
16+
- macos-11
1717
- ubuntu-22.04
1818
runs-on: ${{ matrix.os }}
1919
steps:
@@ -37,23 +37,25 @@ jobs:
3737
--manifest-path=intel-mkl-tool/Cargo.toml
3838
--no-default-features
3939
40-
seek:
40+
test_pkg_config:
4141
strategy:
4242
fail-fast: false
4343
matrix:
4444
image:
4545
- mkl-rust
4646
- mkl-ubuntu
47-
- mkl-centos
4847
runs-on: ubuntu-22.04
4948
container:
50-
image: ghcr.io/rust-math/intel-mkl-src/${{ matrix.image }}:1.56.0
49+
image: ghcr.io/rust-math/intel-mkl-src/${{ matrix.image }}:1.56.0-1
5150
steps:
5251
- uses: actions/checkout@v1
53-
- name: cargo run -- seek
54-
uses: actions-rs/cargo@v1
52+
- uses: actions-rs/cargo@v1
53+
name: Seek /opt/intel
5554
with:
56-
command: run
55+
command: test
5756
args: >
5857
--manifest-path=intel-mkl-tool/Cargo.toml
59-
-- seek
58+
pkg_config
59+
--
60+
--ignored
61+
--show-output

.github/workflows/rust.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
check-format:
1111
runs-on: ubuntu-22.04
1212
container:
13-
image: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.56.0
13+
image: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.56.0-1
1414
steps:
1515
- uses: actions/checkout@v1
1616
- uses: actions-rs/cargo@v1
@@ -21,7 +21,7 @@ jobs:
2121
clippy:
2222
runs-on: ubuntu-22.04
2323
container:
24-
image: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.56.0
24+
image: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.56.0-1
2525
steps:
2626
- uses: actions/checkout@v1
2727
- uses: actions-rs/cargo@v1

intel-mkl-src/build.rs

+4-21
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
use anyhow::{bail, Result};
2626
use intel_mkl_tool::*;
27-
use std::{env, path::PathBuf, str::FromStr};
27+
use std::str::FromStr;
2828

2929
#[cfg(feature = "mkl-static-lp64-iomp")]
3030
const MKL_CONFIG: &str = "mkl-static-lp64-iomp";
@@ -45,26 +45,9 @@ const MKL_CONFIG: &str = "mkl-dynamic-ilp64-seq";
4545

4646
fn main() -> Result<()> {
4747
let cfg = Config::from_str(MKL_CONFIG).unwrap();
48-
49-
// already exists on system
50-
if let Ok(entry) = Entry::from_config(cfg) {
51-
entry.print_cargo_metadata();
48+
if let Ok(lib) = Library::new(cfg) {
49+
lib.print_cargo_metadata()?;
5250
return Ok(());
5351
}
54-
55-
// download if not found
56-
#[cfg(feature = "download")]
57-
{
58-
let path = PathBuf::from(env::var("OUT_DIR").unwrap());
59-
println!(
60-
r#"cargo:warning="Download Intel MKL archive into {}""#,
61-
path.display()
62-
);
63-
cfg.download(path)?;
64-
let entry = Entry::from_config(cfg).unwrap(); // must found
65-
entry.print_cargo_metadata();
66-
return Ok(());
67-
}
68-
69-
bail!("No MKL found, and download flag is off.");
52+
bail!("No MKL found");
7053
}

intel-mkl-tool/Cargo.toml

+2-17
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,12 @@ rust-version = "1.56.0" # MSRV is introduced
77

88
description = "CLI utility for redistributiing Intel(R) MKL"
99
repository = "https://github.com/rust-math/intel-mkl-src"
10-
keywords = ["cli"]
10+
keywords = []
1111
license = "MIT"
1212

13-
[features]
14-
default = ["cli"]
15-
cli = ["structopt"]
16-
1713
[dependencies]
1814
anyhow = "1.0.58"
19-
derive_more = "0.99.17"
20-
dirs = "4.0.0"
21-
glob = "0.3.0"
22-
pkg-config = "0.3.25"
23-
24-
# CLI
25-
structopt = { version = "0.3.26", optional = true }
15+
walkdir = "2.3.2"
2616

2717
[dev-dependencies]
2818
paste = "1.0.7"
29-
30-
[[bin]]
31-
name = "intel-mkl-tool"
32-
path = "src/cli.rs"
33-
required-features = ["cli"]

intel-mkl-tool/src/cli.rs

-34
This file was deleted.

0 commit comments

Comments
 (0)