Skip to content

Commit

Permalink
Merge pull request #108 from gkobeaga/openblas-v0.3.25
Browse files Browse the repository at this point in the history
OpenBLAS v0.3.25 & Extended Target Support & Build Fixes
  • Loading branch information
termoshtt authored Jan 20, 2024
2 parents 7f8b2cd + 9ea52b8 commit e3b0f0b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 3 deletions.
75 changes: 74 additions & 1 deletion openblas-build/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ pub enum Target {
HASWELL,
SKYLAKEX,
ATOM,
COOPERLAKE,
SAPPHIRERAPIDS,

// X86/X86_64 AMD
ATHLON,
Expand Down Expand Up @@ -58,6 +60,7 @@ pub enum Target {
POWER7,
POWER8,
POWER9,
POWER10,
PPCG4,
PPC970,
PPC970MP,
Expand All @@ -71,6 +74,7 @@ pub enum Target {
MIPS24K,

// MIPS64
MIPS64_GENERIC,
SICORTEX,
LOONGSON3A,
LOONGSON3B,
Expand Down Expand Up @@ -98,17 +102,46 @@ pub enum Target {
CORTEXA57,
CORTEXA72,
CORTEXA73,
CORTEXA510,
CORTEXA710,
CORTEXX1,
CORTEXX2,
NEOVERSEN1,
NEOVERSEV1,
NEOVERSEN2,
CORTEXA55,
EMAG8180,
FALKOR,
THUNDERX,
THUNDERX2T99,
TSV110,
THUNDERX3T110,
VORTEX,
A64FX,
ARMV8SVE,
FT2000,

// System Z
ZARCH_GENERIC,
Z13,
Z14,

// RISC-V 64:
RISCV64_GENERIC,
C910V,

// LOONGARCH64:
LOONGSONGENERIC,
LOONGSON3R5,
LOONGSON2K1000,

// Elbrus E2000:
E2K,

// Alpha
EV4,
EV5,
EV6,
}

impl FromStr for Target {
Expand All @@ -132,6 +165,8 @@ impl FromStr for Target {
"haswell" => Self::HASWELL,
"skylakex" => Self::SKYLAKEX,
"atom" => Self::ATOM,
"cooperlake" => Self::COOPERLAKE,
"sapphirerapids" => Self::SAPPHIRERAPIDS,

// X86/X86_64 AMD
"athlon" => Self::ATHLON,
Expand Down Expand Up @@ -159,6 +194,7 @@ impl FromStr for Target {
"power7" => Self::POWER7,
"power8" => Self::POWER8,
"power9" => Self::POWER9,
"power10" => Self::POWER10,
"ppcg4" => Self::PPCG4,
"ppc970" => Self::PPC970,
"ppc970mp" => Self::PPC970MP,
Expand All @@ -172,6 +208,7 @@ impl FromStr for Target {
"mips24k" => Self::MIPS24K,

// MIPS64
"mips64_generic" => Self::MIPS64_GENERIC,
"sicortex" => Self::SICORTEX,
"loongson3a" => Self::LOONGSON3A,
"loongson3b" => Self::LOONGSON3B,
Expand Down Expand Up @@ -199,18 +236,47 @@ impl FromStr for Target {
"cortexa57" => Self::CORTEXA57,
"cortexa72" => Self::CORTEXA72,
"cortexa73" => Self::CORTEXA73,
"cortexa510" => Self::CORTEXA510,
"cortexa710" => Self::CORTEXA710,
"cortexx1" => Self::CORTEXX1,
"cortexx2" => Self::CORTEXX2,
"neoversen1" => Self::NEOVERSEN1,
"neoversev1" => Self::NEOVERSEV1,
"neoversen2" => Self::NEOVERSEN2,
"cortexa55" => Self::CORTEXA55,
"emag8180" => Self::EMAG8180,
"falkor" => Self::FALKOR,
"thunderx" => Self::THUNDERX,
"thunderx2t99" => Self::THUNDERX2T99,
"tsv110" => Self::TSV110,
"thunderx3t110" => Self::THUNDERX3T110,
"vortex" => Self::VORTEX,
"a64fx" => Self::A64FX,
"armv8sve" => Self::ARMV8SVE,
"ft2000" => Self::FT2000,

// System Z
"zarch_generic" => Self::ZARCH_GENERIC,
"z13" => Self::Z13,
"z14" => Self::Z14,

// RISC-V 64:
"riscv64_generic" => Self::RISCV64_GENERIC,
"c910v" => Self::C910V,

// LOONGARCH64:
"loongsongeneric" => Self::LOONGSONGENERIC,
"loongson3r5" => Self::LOONGSON3R5,
"loongson2k1000" => Self::LOONGSON2K1000,

// Elbrus E2000:
"e2k" => Self::E2K,

// Alpha
"ev4" => Self::EV4,
"ev5" => Self::EV5,
"ev6" => Self::EV6,

_ => {
return Err(Error::UnsupportedTarget {
target: s.to_string(),
Expand Down Expand Up @@ -293,6 +359,13 @@ impl Configure {
if let Some(target) = self.target.as_ref() {
args.push(format!("TARGET={:?}", target))
}

for name in ["CC", "FC", "HOSTCC"] {
if let Ok(value) = std::env::var(format!("OPENBLAS_{}", name)) {
args.push(format!("{}={}", name, value));
}
}

args
}

Expand Down Expand Up @@ -394,7 +467,7 @@ impl Configure {
.stdout(out)
.stderr(err)
.args(&self.make_args())
.args(["libs", "netlib", "shared"])
.args(["all"])
.env_remove("TARGET")
.check_call()
{
Expand Down
2 changes: 1 addition & 1 deletion openblas-build/src/download.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Result;
use std::path::{Path, PathBuf};

const OPENBLAS_VERSION: &str = "0.3.21";
const OPENBLAS_VERSION: &str = "0.3.25";

pub fn openblas_source_url() -> String {
format!(
Expand Down
2 changes: 1 addition & 1 deletion openblas-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ fn build() {

let output = PathBuf::from(env::var("OUT_DIR").unwrap().replace(r"\", "/"));
let mut make = Command::new("make");
make.args(&["libs", "netlib", "shared"])
make.args(&["all"])
.arg(format!("BINARY={}", binary()))
.arg(format!(
"{}_CBLAS=1",
Expand Down

0 comments on commit e3b0f0b

Please sign in to comment.