Skip to content
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

OpenBLAS v0.3.25 & Extended Target Support & Build Fixes #108

Merged
merged 5 commits into from
Jan 20, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/openblas-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
linux:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand Down
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
Loading