Skip to content

Commit

Permalink
Merge branch 'master' into cross-compile-new
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirreke authored Feb 16, 2024
2 parents cd2d277 + e1fd795 commit 6a4009d
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 108 deletions.
36 changes: 18 additions & 18 deletions .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 All @@ -22,20 +22,20 @@ jobs:
env:
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v1
with:
submodules: 'recursive'
- name: Install gfortran by apt
run: |
apt update
apt install -y gfortran
- name: Common minor tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=openblas-build/Cargo.toml
- name: Build test
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.test_target }} --manifest-path=openblas-build/Cargo.toml -- --ignored
- uses: actions/checkout@v1
with:
submodules: "recursive"
- name: Install gfortran by apt
run: |
apt update
apt install -y gfortran
- name: Common minor tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=openblas-build/Cargo.toml
- name: Build test
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.test_target }} --manifest-path=openblas-build/Cargo.toml -- --ignored
142 changes: 71 additions & 71 deletions .github/workflows/openblas-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,50 @@ jobs:
- x64-windows-static
- x64-windows-static-md
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v2
with:
path: ./vcpkg
key: vcpkg-openblas
- name: Install vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git --depth 1
cd vcpkg
./bootstrap-vcpkg.bat
- name: Install OpenBLAS by vcpkg
run: |
./vcpkg/vcpkg.exe install openblas:${{ matrix.triple }}
- uses: actions/checkout@v1
- uses: actions/cache@v2
with:
path: ./vcpkg
key: vcpkg-openblas
- name: Install vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git --depth 1
cd vcpkg
./bootstrap-vcpkg.bat
- name: Install OpenBLAS by vcpkg
run: |
./vcpkg/vcpkg.exe install openblas:${{ matrix.triple }}
- uses: actions-rs/cargo@v1
name: Test features=system
with:
command: test
args: --features=system --manifest-path=openblas-src/Cargo.toml
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
if: ${{ matrix.triple == 'x64-windows' }}
- uses: actions-rs/cargo@v1
name: Test features=system
with:
command: test
args: --features=system --manifest-path=openblas-src/Cargo.toml
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
if: ${{ matrix.triple == 'x64-windows' }}

- uses: actions-rs/cargo@v1
name: Test features=system,static
with:
command: test
args: --features=system,static --manifest-path=openblas-src/Cargo.toml
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
if: ${{ matrix.triple == 'x64-windows-static-md' }}
- uses: actions-rs/cargo@v1
name: Test features=system,static
with:
command: test
args: --features=system,static --manifest-path=openblas-src/Cargo.toml
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
if: ${{ matrix.triple == 'x64-windows-static-md' }}

- uses: actions-rs/cargo@v1
name: Test features=system,static with crt-static
with:
command: test
args: --features=system,static --manifest-path=openblas-src/Cargo.toml
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
RUSTFLAGS: "-C target-feature=+crt-static"
if: ${{ matrix.triple == 'x64-windows-static' }}
- uses: actions-rs/cargo@v1
name: Test features=system,static with crt-static
with:
command: test
args: --features=system,static --manifest-path=openblas-src/Cargo.toml
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
RUSTFLAGS: "-C target-feature=+crt-static"
if: ${{ matrix.triple == 'x64-windows-static' }}

macos:
runs-on: macos-11
runs-on: macos-14
strategy:
fail-fast: false
matrix:
Expand All @@ -70,22 +70,22 @@ jobs:
- static
- system
steps:
- uses: actions/checkout@v1
with:
submodules: 'recursive'
- name: Install OpenBLAS by homebrew
run: |
brew install openblas
if: ${{ contains(matrix.feature, 'system') }}
- uses: actions-rs/cargo@v1
with:
command: test
args: >
--features=${{ matrix.feature }}
--manifest-path=openblas-src/Cargo.toml
- uses: actions/checkout@v1
with:
submodules: "recursive"
- name: Install OpenBLAS by homebrew
run: |
brew install openblas
if: ${{ contains(matrix.feature, 'system') }}
- uses: actions-rs/cargo@v1
with:
command: test
args: >
--features=${{ matrix.feature }}
--manifest-path=openblas-src/Cargo.toml
linux:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
container:
image: rust
strategy:
Expand All @@ -96,21 +96,21 @@ jobs:
- static
- system
steps:
- uses: actions/checkout@v1
with:
submodules: 'recursive'
- name: Install gfortran by apt
run: |
apt update
apt install -y gfortran
- name: Install OpenBLAS by apt
run: |
apt update
apt install -y libopenblas-dev
if: ${{ contains(matrix.feature, 'system') }}
- uses: actions-rs/cargo@v1
with:
command: test
args: >
--features=${{ matrix.feature }}
--manifest-path=openblas-src/Cargo.toml
- uses: actions/checkout@v1
with:
submodules: "recursive"
- name: Install gfortran by apt
run: |
apt update
apt install -y gfortran
- name: Install OpenBLAS by apt
run: |
apt update
apt install -y libopenblas-dev
if: ${{ contains(matrix.feature, 'system') }}
- uses: actions-rs/cargo@v1
with:
command: test
args: >
--features=${{ matrix.feature }}
--manifest-path=openblas-src/Cargo.toml
22 changes: 11 additions & 11 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ jobs:
check-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- uses: actions/checkout@v1
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

clippy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
with:
submodules: 'true'
- uses: actions-rs/cargo@v1
with:
command: clippy
- uses: actions/checkout@v1
with:
submodules: "true"
- uses: actions-rs/cargo@v1
with:
command: clippy
2 changes: 1 addition & 1 deletion openblas-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openblas-build"
version = "0.10.8"
version = "0.10.9"
license = "Apache-2.0/MIT"
edition = "2018"
authors = ["Toshiki Teramura <[email protected]>"]
Expand Down
36 changes: 32 additions & 4 deletions openblas-build/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub enum Target {
HASWELL,
SKYLAKEX,
ATOM,
COOPERLAK,
COOPERLAKE,
SAPPHIRERAPIDS,

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

// MIPS64
MIPS64_GENERIC,
SICORTEX,
LOONGSON3A,
LOONGSON3B,
Expand Down Expand Up @@ -167,7 +169,7 @@ impl FromStr for Target {
"haswell" => Self::HASWELL,
"skylakex" => Self::SKYLAKEX,
"atom" => Self::ATOM,
"cooperlak" => Self::COOPERLAK,
"cooperlake" => Self::COOPERLAKE,
"sapphirerapids" => Self::SAPPHIRERAPIDS,

// X86/X86_64 AMD
Expand Down Expand Up @@ -196,6 +198,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 @@ -209,6 +212,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 @@ -254,7 +258,7 @@ impl FromStr for Target {
"a64fx" => Self::A64FX,
"armv8sve" => Self::ARMV8SVE,
"ft2000" => Self::FT2000,

// System Z
"zarch_generic" => Self::ZARCH_GENERIC,
"z13" => Self::Z13,
Expand All @@ -281,6 +285,23 @@ impl FromStr for Target {
"csky" => Self::CSKY,
"ck860fv" => Self::CK860FV,

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

Check warning on line 290 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (system)

unreachable pattern

Check warning on line 290 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows)

unreachable pattern

Check warning on line 290 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos

unreachable pattern

Check warning on line 290 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (static)

unreachable pattern

Check warning on line 290 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / clippy

unreachable pattern

Check warning on line 290 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows-static)

unreachable pattern

// LOONGARCH64:
"loongsongeneric" => Self::LOONGSONGENERIC,

Check warning on line 293 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (system)

unreachable pattern

Check warning on line 293 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows)

unreachable pattern

Check warning on line 293 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos

unreachable pattern

Check warning on line 293 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (static)

unreachable pattern

Check warning on line 293 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / clippy

unreachable pattern

Check warning on line 293 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows-static)

unreachable pattern
"loongson3r5" => Self::LOONGSON3R5,
"loongson2k1000" => Self::LOONGSON2K1000,

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

Check warning on line 298 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (system)

unreachable pattern

Check warning on line 298 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows)

unreachable pattern

Check warning on line 298 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos

unreachable pattern

Check warning on line 298 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (static)

unreachable pattern

Check warning on line 298 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / clippy

unreachable pattern

Check warning on line 298 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows-static)

unreachable pattern

// Alpha
"ev4" => Self::EV4,

Check warning on line 301 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (system)

unreachable pattern

Check warning on line 301 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows)

unreachable pattern

Check warning on line 301 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos

unreachable pattern

Check warning on line 301 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (static)

unreachable pattern

Check warning on line 301 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / clippy

unreachable pattern

Check warning on line 301 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows-static)

unreachable pattern
"ev5" => Self::EV5,

Check warning on line 302 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (system)

unreachable pattern

Check warning on line 302 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows)

unreachable pattern

Check warning on line 302 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos

unreachable pattern

Check warning on line 302 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (static)

unreachable pattern

Check warning on line 302 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / clippy

unreachable pattern

Check warning on line 302 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows-static)

unreachable pattern
"ev6" => Self::EV6,

Check warning on line 303 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (system)

unreachable pattern

Check warning on line 303 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows)

unreachable pattern

Check warning on line 303 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos

unreachable pattern

Check warning on line 303 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / macos (static)

unreachable pattern

Check warning on line 303 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / clippy

unreachable pattern

Check warning on line 303 in openblas-build/src/build.rs

View workflow job for this annotation

GitHub Actions / windows-msvc (x64-windows-static)

unreachable pattern

_ => {
return Err(Error::UnsupportedTarget {
target: s.to_string(),
Expand Down Expand Up @@ -387,6 +408,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 @@ -489,7 +517,7 @@ impl Configure {
.stderr(err)
.args(&self.make_args())
.args(&self.cross_compile_args()?)
.args(["libs", "netlib", "shared"])
.args(["all"])
.env_remove("TARGET")
.check_call()
{
Expand Down
1 change: 1 addition & 0 deletions openblas-build/src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::path::{Path, PathBuf};

const OPENBLAS_VERSION: &str = "csky-support";


pub fn openblas_source_url() -> String {
// format!(
// "https://github.com/OpenMathLib/OpenBLAS/releases/download/v{}/OpenBLAS-{}.tar.gz",
Expand Down
4 changes: 2 additions & 2 deletions openblas-src/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openblas-src"
version = "0.10.8"
version = "0.10.9"
license = "Apache-2.0/MIT"
edition = "2018"
authors = [
Expand Down Expand Up @@ -37,7 +37,7 @@ libc = "0.2"

[build-dependencies]
dirs = "5.0.1"
openblas-build = { version = "0.10.8", path = "../openblas-build" }
openblas-build = { version = "0.10.9", path = "../openblas-build" }

[target.'cfg(target_os="windows")'.build-dependencies]
vcpkg = "0.2"
2 changes: 1 addition & 1 deletion openblas-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,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 6a4009d

Please sign in to comment.