Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirreke committed Nov 29, 2024
1 parent 5956252 commit 71b6d4f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 133 deletions.
97 changes: 1 addition & 96 deletions .github/workflows/openblas-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,6 @@ on:
workflow_dispatch: {}

jobs:
windows-msvc:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
triple:
- x64-windows
- x64-windows-static
- x64-windows-static-md
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
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 }}
- name: Test features=system
run: cargo test --features=system --manifest-path=openblas-src/Cargo.toml
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
if: ${{ matrix.triple == 'x64-windows' }}

- name: Test features=system,static
run: cargo test --features=system,static --manifest-path=openblas-src/Cargo.toml
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
if: ${{ matrix.triple == 'x64-windows-static-md' }}

- name: Test features=system,static with crt-static
run: cargo test --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-14
strategy:
Expand All @@ -68,57 +26,4 @@ jobs:
brew install openblas
if: ${{ contains(matrix.feature, 'system') }}
- name: Test features=${{ matrix.feature }}
run: cargo test --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml

x86_64-unknown-linux-gnu:
runs-on: ubuntu-22.04
container:
image: rust
strategy:
fail-fast: false
matrix:
feature:
- ""
- static
- system
steps:
- uses: actions/checkout@v4
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') }}
- name: Test features=${{ matrix.feature }}
run: cargo test --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml

cross:
name: ${{matrix.target}} (${{matrix.feature}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
feature:
- ""
- static
- system
target:
- aarch64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
steps:
- uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: ${{matrix.target}}
- name: Install Cross
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Test features=${{ matrix.feature }}
run: cross test --target ${{matrix.target}} --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml
run: cargo test --features=${{ matrix.feature }} --manifest-path=openblas-src/Cargo.toml -vv
67 changes: 30 additions & 37 deletions openblas-build/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,43 +514,36 @@ impl Configure {
return Err(e);
}
}
#[cfg(target_os = "macos")]
if !self.no_shared {
let out =
fs::File::create(out_dir.join("out_install.log")).expect("Cannot create log file");
let err =
fs::File::create(out_dir.join("err_install.log")).expect("Cannot create log file");
match Command::new("make")
.arg("install")
.arg(format!("PREFIX={}", out_dir.display()))
.current_dir(out_dir)
.stdout(out)
.stderr(err)
.env_remove("TARGET")
.check_call()
{
Ok(_) => {}
Err(err @ Error::NonZeroExitStatus { .. }) => {
eprintln!(
"{}",
fs::read_to_string(out_dir.join("err_install.log"))
.expect("Cannot read log file")
);
return Err(err);
}
Err(e) => {
return Err(e);
}
}
println!("cargo:rustc-link-search={}", out_dir.join("lib").display(),);
}
let a = Command::new("ls")
.current_dir(out_dir.join("lib/"))
.output()
.unwrap()
.stdout;
let a = String::from_utf8(a).unwrap();
eprintln!("{}", a);
// #[cfg(target_os = "macos")]
// if !self.no_shared {
// let out =
// fs::File::create(out_dir.join("out_install.log")).expect("Cannot create log file");
// let err =
// fs::File::create(out_dir.join("err_install.log")).expect("Cannot create log file");
// match Command::new("make")
// .arg("install")
// .arg(format!("PREFIX={}", out_dir.display()))
// .current_dir(out_dir)
// .stdout(out)
// .stderr(err)
// .env_remove("TARGET")
// .check_call()
// {
// Ok(_) => {}
// Err(err @ Error::NonZeroExitStatus { .. }) => {
// eprintln!(
// "{}",
// fs::read_to_string(out_dir.join("err_install.log"))
// .expect("Cannot read log file")
// );
// return Err(err);
// }
// Err(e) => {
// return Err(e);
// }
// }
// println!("cargo:rustc-link-search={}", out_dir.join("lib").display(),);
// }

self.inspect(out_dir)
}
Expand Down

0 comments on commit 71b6d4f

Please sign in to comment.