Skip to content

Commit 3ca6bd2

Browse files
committed
Get OpenBLAS source from GitHub release
1 parent 36f8b92 commit 3ca6bd2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

openblas-src/OpenBLAS-0.3.21.tar.gz

-22.6 MB
Binary file not shown.

openblas-src/build.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use std::{env, path::*, process::Command};
22

3+
const OPENBLAS_SOURCE_URL: &str =
4+
"https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21.tar.gz";
35
const OPENBLAS_VERSION: &str = "0.3.21";
46

57
#[allow(unused)]
@@ -177,13 +179,10 @@ fn build() {
177179

178180
let source = output.join(format!("OpenBLAS-{}", OPENBLAS_VERSION));
179181
if !source.exists() {
180-
let crate_root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
181-
Command::new("tar")
182-
.arg("xf")
183-
.arg(crate_root.join(format!("OpenBLAS-{}.tar.gz", OPENBLAS_VERSION)))
184-
.current_dir(&output)
185-
.status()
186-
.expect("tar command not found");
182+
let buf = ureq::get(OPENBLAS_SOURCE_URL).call().unwrap().into_reader();
183+
let gz_stream = flate2::read::GzDecoder::new(buf);
184+
let mut ar = tar::Archive::new(gz_stream);
185+
ar.unpack(&output).unwrap();
187186
}
188187
let deliv = cfg.build(&source, &output).unwrap();
189188

0 commit comments

Comments
 (0)