Skip to content

Commit 9748995

Browse files
authored
Added arm64 architecture (#7)
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
1 parent 68e11bb commit 9748995

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

whisper_onnxruntime_vendor/CMakeLists.txt

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
cmake_minimum_required(VERSION 3.8)
22
project(whisper_onnxruntime_vendor)
33

4+
# Determine the architecture
5+
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
6+
set(ARCHITECTURE "x64")
7+
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
8+
set(ARCHITECTURE "aarch64")
9+
else()
10+
message(FATAL_ERROR "Unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}")
11+
endif()
12+
413
# Set variables for the package
514
set(ONNXRUNTIME_VERSION "1.18.1") # Specify the desired ONNX Runtime version
6-
set(ONNXRUNTIME_URL "https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz")
15+
set(ONNXRUNTIME_URL "https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-${ARCHITECTURE}-${ONNXRUNTIME_VERSION}.tgz")
716

817
# ROS 2 package configuration
918
find_package(ament_cmake REQUIRED)
1019

1120
# Define a vendor package installation directory
12-
set(ONNXRUNTIME_INSTALL_DIR "${CMAKE_BINARY_DIR}/onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}")
21+
set(ONNXRUNTIME_INSTALL_DIR "${CMAKE_BINARY_DIR}/onnxruntime-linux-${ARCHITECTURE}-${ONNXRUNTIME_VERSION}")
1322

1423
# Add a custom target to download and extract the prebuilt ONNX Runtime
1524
find_program(CURL_EXECUTABLE curl REQUIRED)

0 commit comments

Comments
 (0)