Skip to content

Drop download feature #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 3 additions & 59 deletions .github/workflows/intel-mkl-sys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,6 @@ on:
pull_request: {}

jobs:
windows:
strategy:
fail-fast: false
matrix:
feature:
- mkl-static-lp64-seq
- mkl-static-ilp64-seq
- mkl-dynamic-lp64-seq
- mkl-dynamic-ilp64-seq
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
profile: minimal
default: true
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: >
--manifest-path=intel-mkl-sys/Cargo.toml
--no-default-features
--features=${{ matrix.feature }},download

macos:
strategy:
fail-fast: false
matrix:
feature:
- mkl-dynamic-lp64-iomp
- mkl-dynamic-lp64-seq
- mkl-dynamic-ilp64-iomp
- mkl-dynamic-ilp64-seq
runs-on: macos-10.15
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
profile: minimal
default: true
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: >
--manifest-path=intel-mkl-sys/Cargo.toml
--no-default-features
--features=${{ matrix.feature }},download

linux:
strategy:
fail-fast: false
Expand All @@ -73,18 +21,14 @@ jobs:
- mkl-dynamic-ilp64-iomp
- mkl-dynamic-ilp64-seq
runs-on: ubuntu-22.04
container:
image: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.56.0
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
profile: minimal
default: true
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: >
--manifest-path=intel-mkl-sys/Cargo.toml
--no-default-features
--features=${{ matrix.feature }},download
--features=${{ matrix.feature }}
32 changes: 22 additions & 10 deletions .github/workflows/intel-mkl-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,36 @@ jobs:
profile: minimal
default: true
override: true
- uses: actions-rs/cargo@v1
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=intel-mkl-tool/Cargo.toml
name: cargo-test
- uses: actions-rs/cargo@v1
- name: cargo test with no-default-features
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=intel-mkl-tool/Cargo.toml --no-default-features
name: cargo-test no-default-features
args: >
--manifest-path=intel-mkl-tool/Cargo.toml
--no-default-features

docker:
runs-on: ubuntu-22.04
seek:
strategy:
fail-fast: false
matrix:
target: ["test", "package", "seek", "seek-ubuntu", "seek-centos"]
image:
- mkl-rust
- mkl-ubuntu
- mkl-centos
runs-on: ubuntu-22.04
container:
image: ghcr.io/rust-math/intel-mkl-src/${{ matrix.image }}:1.56.0
steps:
- uses: actions/checkout@v1
- name: Test with mkl-rust container
run: make -C intel-mkl-tool ${{ matrix.target }}
- name: cargo run -- seek
uses: actions-rs/cargo@v1
with:
command: run
args: >
--manifest-path=intel-mkl-tool/Cargo.toml
-- seek
18 changes: 4 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,21 @@ on:
jobs:
check-format:
runs-on: ubuntu-22.04
container:
image: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.56.0
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
profile: minimal
components: rustfmt
default: true
override: true
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

clippy:
runs-on: ubuntu-22.04
container:
image: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.56.0
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: "1.56.0"
profile: minimal
components: clippy
default: true
override: true
- uses: actions-rs/cargo@v1
with:
command: clippy
1 change: 1 addition & 0 deletions docker/mkl-rust.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ RUN sed -i "s/MKLROOT/prefix/g" ${PKG_CONFIG_PATH}/*.pc
# Setup basic rust development tools
WORKDIR /src
RUN cargo install cargo-tarpaulin
RUN rustup component add rustfmt clippy
3 changes: 0 additions & 3 deletions intel-mkl-src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ mkl-dynamic-lp64-seq = []
mkl-dynamic-ilp64-iomp = []
mkl-dynamic-ilp64-seq = []

# Enable downloading from AWS S3 when system MKL not found
download = ["intel-mkl-tool/archive"]

[build-dependencies]
anyhow = "1.0.58"
intel-mkl-tool = { version = "0.3.0", path = "../intel-mkl-tool", default-features = false }
5 changes: 1 addition & 4 deletions intel-mkl-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keywords = ["ffi"]
license = "MIT"

[features]
default = ["download", "mkl-static-ilp64-seq"]
default = ["mkl-static-ilp64-seq"]

# MKL config
# https://software.intel.com/content/www/us/en/develop/articles/intel-math-kernel-library-intel-mkl-and-pkg-config-tool.html
Expand All @@ -25,9 +25,6 @@ mkl-dynamic-lp64-seq = ["intel-mkl-src/mkl-dynamic-lp64-seq"]
mkl-dynamic-ilp64-iomp = ["intel-mkl-src/mkl-dynamic-ilp64-iomp"]
mkl-dynamic-ilp64-seq = ["intel-mkl-src/mkl-dynamic-ilp64-seq"]

# Enable downloading from AWS S3 when not found
download = ["intel-mkl-src/download"]

[dependencies]
intel-mkl-src = { path = "../intel-mkl-src", version = "0.7.0", default-features = false }

Expand Down
8 changes: 1 addition & 7 deletions intel-mkl-tool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ license = "MIT"

[features]
default = ["cli"]
archive = ["curl", "tar", "zstd"]
cli = ["structopt", "archive"]
cli = ["structopt"]

[dependencies]
anyhow = "1.0.58"
Expand All @@ -22,11 +21,6 @@ dirs = "4.0.0"
glob = "0.3.0"
pkg-config = "0.3.25"

# archive
curl = { version = "0.4.44", optional = true }
tar = { version = "0.4.38", optional = true }
zstd = { version = "0.11.2", optional = true }

# CLI
structopt = { version = "0.3.26", optional = true }

Expand Down
19 changes: 0 additions & 19 deletions intel-mkl-tool/Makefile

This file was deleted.

56 changes: 0 additions & 56 deletions intel-mkl-tool/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,49 +1,18 @@
use anyhow::{bail, Result};
use intel_mkl_tool::*;
use std::{env, path::PathBuf, str::FromStr};
use structopt::StructOpt;

/// CLI tool for intel-mkl crate
#[derive(Debug, StructOpt)]
enum Opt {
/// Download Intel-MKL library
Download {
/// Archive name, e.g. "mkl-static-lp64-iomp". Download all archives if None
#[structopt(long = "name")]
name: Option<String>,
/// Install destination
#[structopt(short = "o", long = "path")]
path: PathBuf,
},

/// Seek Intel-MKL library
Seek {},

/// Package Intel MKL libraries into an archive
Package {
#[structopt(long = "name")]
name: Option<String>,
#[structopt(short = "o", long = "path")]
path: Option<PathBuf>,
},
}

fn main() -> Result<()> {
let opt = Opt::from_args();

match opt {
Opt::Download { name, path } => {
if let Some(name) = name {
let cfg = Config::from_str(&name)?;
cfg.download(&path.join(cfg.to_string()))?;
} else {
for cfg in Config::possibles() {
println!("Download archive {:<22} into {}", cfg, path.display());
cfg.download(&path.join(cfg.to_string()))?;
}
}
}

Opt::Seek {} => {
let available = Entry::available();
if available.is_empty() {
Expand All @@ -60,31 +29,6 @@ fn main() -> Result<()> {
}
}
}

Opt::Package { name, path } => {
let path = path.unwrap_or(env::current_dir().unwrap());
if let Some(name) = name {
let cfg = Config::from_str(&name)?;
let entry = Entry::from_config(cfg)?;
let path = if let Ok(version) = entry.version() {
path.join(format!("{}.{}", version.0, version.1))
} else {
path
};
let package = entry.package(&path)?;
println!("Pacakge created: {}", package.display());
} else {
for entry in Entry::available() {
let path = if let Ok(version) = entry.version() {
path.join(format!("{}.{}", version.0, version.1))
} else {
path.clone()
};
let package = entry.package(&path)?;
println!("Pacakge created: {}", package.display());
}
}
}
}
Ok(())
}
Loading