Skip to content

Commit ddcdc56

Browse files
authored
Linux arm64へのビルドを追加 (#13)
* linux-aarch64用ビルドに向けた変更 * linux-aarch64用コンパイラの追加 * Automated generate bindings for aarch64-unknown-linux-gnu * c_char-aarch64-linuxのものに置き換え Co-authored-by: haru3me <[email protected]>
1 parent 2116f6e commit ddcdc56

File tree

8 files changed

+6598
-17
lines changed

8 files changed

+6598
-17
lines changed

.github/actions/auto_gen_bind_pr/action.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ runs:
1414
shell: bash
1515
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
1616
id: extract_branch
17+
- name: Install cross compiler for aarch64
18+
if: inputs.triple == 'aarch64-unknown-linux-gnu'
19+
shell: bash
20+
run: |
21+
sudo apt update
22+
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
1723
- uses: actions-rs/toolchain@v1
1824
with:
1925
toolchain: stable

.github/workflows/gen_bind.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
include:
1414
- os: ubuntu-latest
1515
triple: x86_64-unknown-linux-gnu
16+
- os: ubuntu-latest
17+
triple: aarch64-unknown-linux-gnu
1618
- os: windows-latest
1719
triple: x86_64-pc-windows-msvc
1820
- os: windows-latest

onnxruntime-sys/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ impl OnnxPrebuiltArchive for Triplet {
435435
Cow::from(format!("{}-{}", self.os.as_onnx_str(), "x64"))
436436
}
437437
(Os::Windows, Architecture::X86, Accelerator::None)
438-
| (Os::MacOs, Architecture::X86_64, Accelerator::None) => Cow::from(format!(
438+
| (Os::MacOs, Architecture::X86_64, Accelerator::None)
439+
| (Os::Linux, Architecture::Arm64, Accelerator::None) => Cow::from(format!(
439440
"{}-{}",
440441
self.os.as_onnx_str(),
441442
self.arch.as_onnx_str()

onnxruntime-sys/src/generated/bindings.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ include!(concat!(
44
"/src/generated/linux/x86_64/bindings.rs"
55
));
66

7+
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
8+
include!(concat!(
9+
env!("CARGO_MANIFEST_DIR"),
10+
"/src/generated/linux/aarch64/bindings.rs"
11+
));
12+
713
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
814
include!(concat!(
915
env!("CARGO_MANIFEST_DIR"),

0 commit comments

Comments
 (0)