Skip to content

Commit

Permalink
Linux arm64へのビルドを追加 (#13)
Browse files Browse the repository at this point in the history
* linux-aarch64用ビルドに向けた変更

* linux-aarch64用コンパイラの追加

* Automated generate bindings for aarch64-unknown-linux-gnu

* c_char-aarch64-linuxのものに置き換え

Co-authored-by: haru3me <haru3me@users.noreply.github.com>
  • Loading branch information
haru3me and haru3me authored Dec 24, 2022
1 parent 2116f6e commit ddcdc56
Show file tree
Hide file tree
Showing 8 changed files with 6,598 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .github/actions/auto_gen_bind_pr/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ runs:
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Install cross compiler for aarch64
if: inputs.triple == 'aarch64-unknown-linux-gnu'
shell: bash
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/gen_bind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
include:
- os: ubuntu-latest
triple: x86_64-unknown-linux-gnu
- os: ubuntu-latest
triple: aarch64-unknown-linux-gnu
- os: windows-latest
triple: x86_64-pc-windows-msvc
- os: windows-latest
Expand Down
3 changes: 2 additions & 1 deletion onnxruntime-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ impl OnnxPrebuiltArchive for Triplet {
Cow::from(format!("{}-{}", self.os.as_onnx_str(), "x64"))
}
(Os::Windows, Architecture::X86, Accelerator::None)
| (Os::MacOs, Architecture::X86_64, Accelerator::None) => Cow::from(format!(
| (Os::MacOs, Architecture::X86_64, Accelerator::None)
| (Os::Linux, Architecture::Arm64, Accelerator::None) => Cow::from(format!(
"{}-{}",
self.os.as_onnx_str(),
self.arch.as_onnx_str()
Expand Down
6 changes: 6 additions & 0 deletions onnxruntime-sys/src/generated/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ include!(concat!(
"/src/generated/linux/x86_64/bindings.rs"
));

#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
include!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/src/generated/linux/aarch64/bindings.rs"
));

#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
include!(concat!(
env!("CARGO_MANIFEST_DIR"),
Expand Down
Loading

0 comments on commit ddcdc56

Please sign in to comment.