Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirreke committed Nov 29, 2024
1 parent 6a5af00 commit dd80d86
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions openblas-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fn main() {
}

/// Build OpenBLAS using openblas-build crate
#[cfg(target_os = "linux")]
// #[cfg(target_os = "linux")]
fn build() {
println!("cargo:rerun-if-env-changed=OPENBLAS_TARGET");
println!("cargo:rerun-if-env-changed=OPENBLAS_CC");
Expand Down Expand Up @@ -212,39 +212,39 @@ fn build() {
}
}

#[cfg(not(target_os = "linux"))]
fn build() {
use std::fs;
// #[cfg(not(target_os = "linux"))]
// fn build() {
// use std::fs;

let output = PathBuf::from(env::var("OUT_DIR").unwrap());
let mut make = Command::new("make");
make.args(&["all"])
.arg(format!("BINARY={}", binary()))
.env_remove("TARGET");
// let output = PathBuf::from(env::var("OUT_DIR").unwrap());
// let mut make = Command::new("make");
// make.args(&["all"])
// .arg(format!("BINARY={}", binary()))
// .env_remove("TARGET");

let source = output.join(format!("source_123"));
// let source = output.join(format!("source_123"));

if !source.exists() {
let source_tmp = openblas_build::download(&output).unwrap();
fs::rename(&source_tmp, &source).unwrap();
}
// if !source.exists() {
// let source_tmp = openblas_build::download(&output).unwrap();
// fs::rename(&source_tmp, &source).unwrap();
// }

run(&mut make.current_dir(&source));
run(Command::new("make")
.arg("install")
.arg(format!("PREFIX={}", source.display()))
.current_dir(&source)
.env_remove("TARGET"));
println!(
"cargo:rustc-link-search={}",
source.join("lib").display(),
);

fn binary() -> &'static str {
if cfg!(target_pointer_width = "32") {
"32"
} else {
"64"
}
}
}
// run(&mut make.current_dir(&source));
// run(Command::new("make")
// .arg("install")
// .arg(format!("PREFIX={}", source.display()))
// .current_dir(&source)
// .env_remove("TARGET"));
// println!(
// "cargo:rustc-link-search={}",
// source.join("lib").display(),
// );

// fn binary() -> &'static str {
// if cfg!(target_pointer_width = "32") {
// "32"
// } else {
// "64"
// }
// }
// }

0 comments on commit dd80d86

Please sign in to comment.