* [meta-arago][scarthgap/master][PATCH 0/4] Add ML frameworks
@ 2025-02-03 18:59 Andrew Davis
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 1/4] meta-arago-extras: Add recipe for arm-compute-library Andrew Davis
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Andrew Davis @ 2025-02-03 18:59 UTC (permalink / raw)
To: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago; +Cc: Andrew Davis
Hello all,
This series adds ACL, ArmNN, ONNX, and ONNX Runtime ML frameworks and
tools. It is a replacement for a couple previous series for the same
but now based on the latest scarthgap-wip.
Thanks,
Andrew
Andrew Davis (4):
meta-arago-extras: Add recipe for arm-compute-library
meta-arago-extras: Add recipe for Arm NN
meta-arago-extras: Add recipe for ONNX
meta-arago-extras: Add recipe for ONNX Runtime
...-indention-in-cmake-generator-script.patch | 130 ++++++++++++
...ENABLE_NEON-in-code-for-checking-NEO.patch | 114 ++++++++++
...ENABLE_SVE-in-code-for-checking-SVE-.patch | 197 ++++++++++++++++++
...rce-files-at-library-definition-time.patch | 167 +++++++++++++++
...ptions-for-SVE-SVE2-and-BF16-support.patch | 112 ++++++++++
...SVE2-support-to-be-disabled-in-CMake.patch | 91 ++++++++
.../0007-Allow-ARMv7-builds-using-CMake.patch | 86 ++++++++
...ymbol-error-when-building-TensorInfo.patch | 46 ++++
.../arm-compute-library_24.12.bb | 89 ++++++++
...01-Fix-type-casting-for-32bit-builds.patch | 40 ++++
.../recipes-devtools/armnn/armnn_24.11.bb | 70 +++++++
...age-Protobuf-before-checking-if-it-w.patch | 25 +++
...-export-internal-targets-directories.patch | 28 +++
.../recipes-framework/onnx/onnx_1.16.1.bb | 107 ++++++++++
...ble-permission-bit-from-source-files.patch | 72 +++++++
...-in-option-text-s-buildings-bindings.patch | 25 +++
...D_LIBRARY_PATH-to-search-path-when-n.patch | 32 +++
...MAKE_CXX_FLAGS-in-build-information-.patch | 31 +++
...ake-Print-out-result-of-find_package.patch | 37 ++++
.../onnxruntime/onnxruntime_1.20.1.bb | 155 ++++++++++++++
20 files changed, 1654 insertions(+)
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch
create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch
create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0002-Do-not-re-export-internal-targets-directories.patch
create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb
--
2.39.2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [meta-arago][scarthgap/master][PATCH 1/4] meta-arago-extras: Add recipe for arm-compute-library
2025-02-03 18:59 [meta-arago][scarthgap/master][PATCH 0/4] Add ML frameworks Andrew Davis
@ 2025-02-03 18:59 ` Andrew Davis
2025-02-05 20:07 ` Denys Dmytriyenko
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 2/4] meta-arago-extras: Add recipe for Arm NN Andrew Davis
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Andrew Davis @ 2025-02-03 18:59 UTC (permalink / raw)
To: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago; +Cc: Andrew Davis
The Compute Library is a collection of low-level machine learning
functions optimized for Arm. This will be used for ARMNN and
other machine learning applications and frameworks.
Signed-off-by: Andrew Davis <afd@ti.com>
---
...-indention-in-cmake-generator-script.patch | 130 ++++++++++++
...ENABLE_NEON-in-code-for-checking-NEO.patch | 114 ++++++++++
...ENABLE_SVE-in-code-for-checking-SVE-.patch | 197 ++++++++++++++++++
...rce-files-at-library-definition-time.patch | 167 +++++++++++++++
...ptions-for-SVE-SVE2-and-BF16-support.patch | 112 ++++++++++
...SVE2-support-to-be-disabled-in-CMake.patch | 91 ++++++++
.../0007-Allow-ARMv7-builds-using-CMake.patch | 86 ++++++++
...ymbol-error-when-building-TensorInfo.patch | 46 ++++
.../arm-compute-library_24.12.bb | 89 ++++++++
9 files changed, 1032 insertions(+)
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch
create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch
new file mode 100644
index 00000000..9e36d254
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch
@@ -0,0 +1,130 @@
+From 1e4c3016547b5f75e515d4b9a7202733c47f5a18 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Wed, 4 Dec 2024 14:46:17 -0600
+Subject: [PATCH] fix: Fix indention in cmake generator script
+
+All other items in these lists use tabs, the first couple
+lines should match. Switch them to tabs then regenerate
+the CMakeLists.txt file.
+
+While here fix the missing ending newline.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+Change-Id: Icab852fc43ae08e7858857881c996d233c835289
+---
+ scripts/generate_build_files.py | 27 ++++++++++++++-------------
+ src/CMakeLists.txt | 26 +++++++++++++-------------
+ 2 files changed, 27 insertions(+), 26 deletions(-)
+
+diff --git a/scripts/generate_build_files.py b/scripts/generate_build_files.py
+index f88cf1af44..52a8cc14da 100644
+--- a/scripts/generate_build_files.py
++++ b/scripts/generate_build_files.py
+@@ -168,28 +168,29 @@ def build_from_template_cmake(srcs_graph, srcs_sve, srcs_sve2, srcs_core):
+ template = f"""{get_template_header()}
+
+ target_sources(
+- arm_compute_graph
+- PRIVATE
+- {line_separator.join(srcs_graph)}
++ arm_compute_graph
++ PRIVATE
++ {line_separator.join(srcs_graph)}
+ )
+
+ target_sources(
+- arm_compute_sve
+- PRIVATE
+- {line_separator.join(srcs_sve)}
++ arm_compute_sve
++ PRIVATE
++ {line_separator.join(srcs_sve)}
+ )
+
+ target_sources(
+- arm_compute_sve2
+- PRIVATE
+- {line_separator.join(srcs_sve2)}
++ arm_compute_sve2
++ PRIVATE
++ {line_separator.join(srcs_sve2)}
+ )
+
+ target_sources(
+- arm_compute
+- PRIVATE
+- {line_separator.join(srcs_core)}
+-)"""
++ arm_compute
++ PRIVATE
++ {line_separator.join(srcs_core)}
++)
++"""
+ return template
+
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index ff3bed96df..f1b275532a 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -21,9 +21,9 @@
+ # SOFTWARE.
+
+ target_sources(
+- arm_compute_graph
+- PRIVATE
+- graph/DataLayerVisitor.cpp
++ arm_compute_graph
++ PRIVATE
++ graph/DataLayerVisitor.cpp
+ graph/Graph.cpp
+ graph/GraphBuilder.cpp
+ graph/GraphContext.cpp
+@@ -101,9 +101,9 @@ target_sources(
+ )
+
+ target_sources(
+- arm_compute_sve
+- PRIVATE
+- core/NEON/kernels/arm_conv/depthwise/interleaves/sve_s8q_3x3_dot.cpp
++ arm_compute_sve
++ PRIVATE
++ core/NEON/kernels/arm_conv/depthwise/interleaves/sve_s8q_3x3_dot.cpp
+ core/NEON/kernels/arm_conv/depthwise/interleaves/sve_u8q_3x3_dot.cpp
+ core/NEON/kernels/arm_conv/depthwise/kernels/sme2_fp16_nhwc_3x3_s1_output2x2_mla_depthfirst/generic_direct.cpp
+ core/NEON/kernels/arm_conv/depthwise/kernels/sme2_fp16_nhwc_3x3_s1_output2x2_mla_depthfirst/generic_indirect.cpp
+@@ -332,9 +332,9 @@ target_sources(
+ )
+
+ target_sources(
+- arm_compute_sve2
+- PRIVATE
+- cpu/kernels/activation/generic/sve2/lut.cpp
++ arm_compute_sve2
++ PRIVATE
++ cpu/kernels/activation/generic/sve2/lut.cpp
+ cpu/kernels/activation/generic/sve2/qasymm8.cpp
+ cpu/kernels/activation/generic/sve2/qasymm8_signed.cpp
+ cpu/kernels/activation/generic/sve2/qsymm16.cpp
+@@ -357,9 +357,9 @@ target_sources(
+ )
+
+ target_sources(
+- arm_compute
+- PRIVATE
+- c/AclContext.cpp
++ arm_compute
++ PRIVATE
++ c/AclContext.cpp
+ c/AclOperator.cpp
+ c/AclQueue.cpp
+ c/AclTensor.cpp
+@@ -1049,4 +1049,4 @@ target_sources(
+ runtime/experimental/operators/CpuSub.cpp
+ runtime/experimental/operators/CpuTranspose.cpp
+ runtime/experimental/operators/CpuWinogradConv2d.cpp
+-)
+\ No newline at end of file
++)
diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch
new file mode 100644
index 00000000..174327c5
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch
@@ -0,0 +1,114 @@
+From 4350c56d14b7b68acd060d8331f3ade1fb74e167 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 5 Dec 2024 09:21:23 -0600
+Subject: [PATCH] Use ARM_COMPUTE_ENABLE_NEON in code for checking NEON support
+
+ENABLE_NEON is a flag used by the build systems. The flag is not used
+in code, instead ARM_COMPUTE_ENABLE_NEON is used everywhere.
+
+Drop the ENABLE_NEON compiler definition to prevent any accidental
+use in code.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+Change-Id: I65f5e7411c99280e2dd8c187140909cefd1c6892
+---
+ Android.bp | 1 -
+ BUILD.bazel | 1 -
+ SConscript | 2 +-
+ SConstruct | 2 +-
+ cmake/Options.cmake | 6 +-----
+ scripts/generate_android_bp.py | 1 -
+ 6 files changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/Android.bp b/Android.bp
+index 69379472b0..9288bba2d4 100644
+--- a/Android.bp
++++ b/Android.bp
+@@ -157,7 +157,6 @@ arm_compute_library_defaults {
+ "-DEMBEDDED_KERNELS",
+ "-DARM_COMPUTE_ASSERTS_ENABLED",
+ "-DARM_COMPUTE_CPP_SCHEDULER",
+- "-DENABLE_NEON",
+ "-DARM_COMPUTE_ENABLE_NEON",
+ "-Wno-unused-parameter",
+ "-DNO_DOT_IN_TOOLCHAIN",
+diff --git a/BUILD.bazel b/BUILD.bazel
+index f553b7bfad..2262a09655 100644
+--- a/BUILD.bazel
++++ b/BUILD.bazel
+@@ -170,7 +170,6 @@ config_setting(
+ cc_library(
+ name = "common_defines",
+ defines = [
+- "ENABLE_NEON",
+ "ARM_COMPUTE_CPU_ENABLED",
+ "ARM_COMPUTE_ENABLE_NEON",
+ "ARM_COMPUTE_ENABLE_I8MM",
+diff --git a/SConscript b/SConscript
+index 12e8fd1025..69a564873f 100644
+--- a/SConscript
++++ b/SConscript
+@@ -97,7 +97,7 @@ def build_multiisa_lib_objects():
+
+ # note that ARM_COMPUTE_ENABLE_FP16 is enabled in update_data_type_layout_flags() to make
+ # sure the environment is progated to the validation suite
+- arm_compute_env.Append(CPPDEFINES = ['ENABLE_NEON', 'ARM_COMPUTE_ENABLE_NEON',
++ arm_compute_env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_NEON',
+ 'ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE','ARM_COMPUTE_ENABLE_BF16',
+ 'ARM_COMPUTE_ENABLE_I8MM', 'ARM_COMPUTE_ENABLE_SVEF32MM'])
+
+diff --git a/SConstruct b/SConstruct
+index 8d7bd291e8..7381300fc8 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -302,7 +302,7 @@ if 'v7a' in env['estate'] and env['estate'] == '64':
+ print("ERROR: armv7a architecture has only 32-bit execution state")
+ Exit(1)
+
+-env.Append(CPPDEFINES = ['ENABLE_NEON', 'ARM_COMPUTE_ENABLE_NEON'])
++env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_NEON'])
+
+ if 'sve' in env['arch']:
+ env.Append(CPPDEFINES = ['ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE'])
+diff --git a/cmake/Options.cmake b/cmake/Options.cmake
+index 5d685be48d..121d527718 100644
+--- a/cmake/Options.cmake
++++ b/cmake/Options.cmake
+@@ -53,7 +53,6 @@ option(ARM_COMPUTE_ENABLE_SVE_VALIDATION "" OFF)
+
+ option(ENABLE_NEON "Enable Arm® Neon™ support" ON)
+ option(ARM_COMPUTE_CPU_ENABLED "" ON)
+-option(ARM_COMPUTE_ENABLE_NEON "" ON)
+ option(ARM_COMPUTE_ENABLE_I8MM "" ON)
+ option(ENABLE_FP32_KERNELS "" ON)
+ option(ENABLE_QASYMM8_KERNELS "" ON)
+@@ -70,14 +69,11 @@ option(ENABLE_FP16_KERNELS "" OFF)
+ option(ARM_COMPUTE_ENABLE_FP16 "" OFF)
+
+ if(ENABLE_NEON)
+- add_definitions(-DENABLE_NEON)
++ add_definitions(-DARM_COMPUTE_ENABLE_NEON)
+ endif()
+ if(ARM_COMPUTE_CPU_ENABLED)
+ add_definitions(-DARM_COMPUTE_CPU_ENABLED)
+ endif()
+-if(ARM_COMPUTE_ENABLE_NEON)
+- add_definitions(-DARM_COMPUTE_ENABLE_NEON)
+-endif()
+ if(ARM_COMPUTE_ENABLE_FP16)
+ add_definitions(-DARM_COMPUTE_ENABLE_FP16)
+ endif()
+diff --git a/scripts/generate_android_bp.py b/scripts/generate_android_bp.py
+index d5b268f522..99a04e7071 100755
+--- a/scripts/generate_android_bp.py
++++ b/scripts/generate_android_bp.py
+@@ -94,7 +94,6 @@ arm_compute_library_defaults {
+ "-DEMBEDDED_KERNELS",
+ "-DARM_COMPUTE_ASSERTS_ENABLED",
+ "-DARM_COMPUTE_CPP_SCHEDULER",
+- "-DENABLE_NEON",
+ "-DARM_COMPUTE_ENABLE_NEON",
+ "-Wno-unused-parameter",
+ "-DNO_DOT_IN_TOOLCHAIN",
diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch
new file mode 100644
index 00000000..b51e4534
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch
@@ -0,0 +1,197 @@
+From 92a881cebfee5504b188a046a96d39dd9361ddb1 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 5 Dec 2024 08:57:38 -0600
+Subject: [PATCH] Use ARM_COMPUTE_ENABLE_SVE in code for checking SVE support
+
+ENABLE_SVE is a flag used by the build systems. The flag used in code
+is ARM_COMPUTE_ENABLE_SVE. There are just a couple spots where the
+build system flag is used instead causing the need to define both.
+
+Switch these last users of ENABLE_SVE over to ARM_COMPUTE_ENABLE_SVE
+then drop the ENABLE_SVE definition to prevent any more instances
+being added in the future.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+Change-Id: I00da7580c4520647b62c6989bc7fbdd5efc7935e
+---
+ BUILD.bazel | 3 ---
+ SConscript | 2 +-
+ SConstruct | 2 +-
+ .../batchnormalization/impl/SVE/fp16.cpp | 2 +-
+ .../batchnormalization/impl/SVE/fp32.cpp | 2 +-
+ tests/BUILD.bazel | 1 -
+ tests/validation/NEON/ActivationLayer.cpp | 24 +++++++++----------
+ tests/validation/NEON/ArithmeticAddition.cpp | 6 ++---
+ 8 files changed, 19 insertions(+), 23 deletions(-)
+
+diff --git a/BUILD.bazel b/BUILD.bazel
+index 2262a09655..c04a52e084 100644
+--- a/BUILD.bazel
++++ b/BUILD.bazel
+@@ -297,7 +297,6 @@ cc_library(
+ "//conditions:default": [],
+ }),
+ local_defines = [
+- "ENABLE_SVE",
+ "ARM_COMPUTE_ENABLE_SVE",
+ "ARM_COMPUTE_ENABLE_SVE2",
+ "ARM_COMPUTE_ENABLE_BF16",
+@@ -348,7 +347,6 @@ cc_library(
+ "//conditions:default": [],
+ }),
+ local_defines = [
+- "ENABLE_SVE",
+ "ARM_COMPUTE_ENABLE_SVE",
+ "ARM_COMPUTE_ENABLE_BF16",
+ ],
+@@ -409,7 +407,6 @@ cc_library(
+ "//conditions:default": [],
+ }),
+ local_defines = [
+- "ENABLE_SVE",
+ "ARM_COMPUTE_ENABLE_SVE",
+ "ARM_COMPUTE_ENABLE_BF16",
+ ],
+diff --git a/SConscript b/SConscript
+index 69a564873f..c2ca549b71 100644
+--- a/SConscript
++++ b/SConscript
+@@ -98,7 +98,7 @@ def build_multiisa_lib_objects():
+ # note that ARM_COMPUTE_ENABLE_FP16 is enabled in update_data_type_layout_flags() to make
+ # sure the environment is progated to the validation suite
+ arm_compute_env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_NEON',
+- 'ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE','ARM_COMPUTE_ENABLE_BF16',
++ 'ARM_COMPUTE_ENABLE_SVE','ARM_COMPUTE_ENABLE_BF16',
+ 'ARM_COMPUTE_ENABLE_I8MM', 'ARM_COMPUTE_ENABLE_SVEF32MM'])
+
+ # Build all the common files for the base architecture
+diff --git a/SConstruct b/SConstruct
+index 7381300fc8..17f5615acf 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -305,7 +305,7 @@ if 'v7a' in env['estate'] and env['estate'] == '64':
+ env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_NEON'])
+
+ if 'sve' in env['arch']:
+- env.Append(CPPDEFINES = ['ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE'])
++ env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_SVE'])
+ if 'sve2' in env['arch']:
+ env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_SVE2'])
+
+diff --git a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp
+index 48caaa3e63..e07593312c 100644
+--- a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp
++++ b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp
+@@ -128,4 +128,4 @@ void fp16_sve_batch_normalization(ITensor *src,
+ }
+ } // namespace cpu
+ } // namespace arm_compute
+-#endif // ENABLE_SVE
++#endif // ARM_COMPUTE_ENABLE_SVE
+diff --git a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp
+index df4fbfe607..0d52d2c3c0 100644
+--- a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp
++++ b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp
+@@ -128,4 +128,4 @@ void fp32_sve_batch_normalization(ITensor *src,
+ }
+ } // namespace cpu
+ } // namespace arm_compute
+-#endif // ENABLE_SVE
++#endif // ARM_COMPUTE_ENABLE_SVE
+diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel
+index 7085f1facc..4b4be8b257 100644
+--- a/tests/BUILD.bazel
++++ b/tests/BUILD.bazel
+@@ -114,7 +114,6 @@ cc_binary(
+ }) +
+ select({
+ "//:sve_validation_flag": [
+- "ENABLE_SVE",
+ "ARM_COMPUTE_ENABLE_SVE",
+ ],
+ "//conditions:default": [],
+diff --git a/tests/validation/NEON/ActivationLayer.cpp b/tests/validation/NEON/ActivationLayer.cpp
+index 119d51808a..69a8b52354 100644
+--- a/tests/validation/NEON/ActivationLayer.cpp
++++ b/tests/validation/NEON/ActivationLayer.cpp
+@@ -73,11 +73,11 @@ RelativeTolerance<float> relative_tolerance(DataType data_type, ActivationLayerI
+ switch(data_type)
+ {
+ case DataType::F16:
+-#if defined(ENABLE_SVE)
++#if defined(ARM_COMPUTE_ENABLE_SVE)
+ return RelativeTolerance<float>(0.25f);
+-#else // !defined(ENABLE_SVE)
++#else // !defined(ARM_COMPUTE_ENABLE_SVE)
+ return RelativeTolerance<float>(0.1f);
+-#endif // defined(ENABLE_SVE)
++#endif // defined(ARM_COMPUTE_ENABLE_SVE)
+ default:
+ return RelativeTolerance<float>(0.05f);
+ }
+@@ -85,11 +85,11 @@ RelativeTolerance<float> relative_tolerance(DataType data_type, ActivationLayerI
+ switch(data_type)
+ {
+ case DataType::F16:
+-#if defined(ENABLE_SVE)
++#if defined(ARM_COMPUTE_ENABLE_SVE)
+ return RelativeTolerance<float>(0.9f);
+-#else // !defined(ENABLE_SVE)
++#else // !defined(ARM_COMPUTE_ENABLE_SVE)
+ return RelativeTolerance<float>(0.01f);
+-#endif // defined(ENABLE_SVE)
++#endif // defined(ARM_COMPUTE_ENABLE_SVE)
+ default:
+ return RelativeTolerance<float>(0.00001f);
+ }
+@@ -117,11 +117,11 @@ AbsoluteTolerance<float> absolute_tolerance(DataType data_type, ActivationLayerI
+ switch(data_type)
+ {
+ case DataType::F16:
+-#if defined(ENABLE_SVE)
++#if defined(ARM_COMPUTE_ENABLE_SVE)
+ return AbsoluteTolerance<float>(0.25f);
+-#else // !defined(ENABLE_SVE)
++#else // !defined(ARM_COMPUTE_ENABLE_SVE)
+ return AbsoluteTolerance<float>(0.01f);
+-#endif // defined(ENABLE_SVE)
++#endif // defined(ARM_COMPUTE_ENABLE_SVE)
+ default:
+ return AbsoluteTolerance<float>(0.00001f);
+ }
+@@ -129,11 +129,11 @@ AbsoluteTolerance<float> absolute_tolerance(DataType data_type, ActivationLayerI
+ switch(data_type)
+ {
+ case DataType::F16:
+-#if defined(ENABLE_SVE)
++#if defined(ARM_COMPUTE_ENABLE_SVE)
+ return AbsoluteTolerance<float>(0.9f);
+-#else // !defined(ENABLE_SVE)
++#else // !defined(ARM_COMPUTE_ENABLE_SVE)
+ return AbsoluteTolerance<float>(0.01f);
+-#endif // defined(ENABLE_SVE)
++#endif // defined(ARM_COMPUTE_ENABLE_SVE)
+ default:
+ return AbsoluteTolerance<float>(0.00001f);
+ }
+diff --git a/tests/validation/NEON/ArithmeticAddition.cpp b/tests/validation/NEON/ArithmeticAddition.cpp
+index c0033daab0..bae8535ff3 100644
+--- a/tests/validation/NEON/ArithmeticAddition.cpp
++++ b/tests/validation/NEON/ArithmeticAddition.cpp
+@@ -48,11 +48,11 @@ namespace validation
+ using framework::dataset::make;
+ namespace
+ {
+-#if !defined(__aarch64__) || defined(ENABLE_SVE)
++#if !defined(__aarch64__) || defined(ARM_COMPUTE_ENABLE_SVE)
+ constexpr AbsoluteTolerance<float> tolerance_quant(1); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */
+-#else // !defined(__aarch64__) || defined(ENABLE_SVE)
++#else // !defined(__aarch64__) || defined(ARM_COMPUTE_ENABLE_SVE)
+ constexpr AbsoluteTolerance<float> tolerance_quant(1);
+-#endif // !defined(__aarch64__) || defined(ENABLE_SVE)
++#endif // !defined(__aarch64__) || defined(ARM_COMPUTE_ENABLE_SVE)
+ const auto InPlaceDataSet = framework::dataset::make("InPlace", { false, true });
+ const auto OutOfPlaceDataSet = framework::dataset::make("InPlace", { false });
+ } // namespace
diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch
new file mode 100644
index 00000000..971658b4
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch
@@ -0,0 +1,167 @@
+From a3c7d6aefc289dcce6656fc6d9f9c8c9b1af8f0b Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 5 Dec 2024 09:38:26 -0600
+Subject: [PATCH] Add source files at library definition time
+
+This allows for easier conditional disabling of these libraries.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+Change-Id: I442aaa03060f2cb7db4ed0c1d93e64dbc223fdc6
+---
+ CMakeLists.txt | 20 ++++++++++----------
+ scripts/generate_build_files.py | 16 ++++------------
+ src/CMakeLists.txt | 16 ++++------------
+ 3 files changed, 18 insertions(+), 34 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e8bdf2af1a..4073e06b17 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -46,6 +46,12 @@ set(CMAKE_CXX_EXTENSIONS OFF)
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Options.cmake)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Version.cmake)
++include(${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt)
++
++list(TRANSFORM ARM_COMPUTE_GRAPH_SOURCES PREPEND "src/")
++list(TRANSFORM ARM_COMPUTE_SVE_SOURCES PREPEND "src/")
++list(TRANSFORM ARM_COMPUTE_SVE2_SOURCES PREPEND "src/")
++list(TRANSFORM ARM_COMPUTE_SOURCES PREPEND "src/")
+
+ # Require at least gcc/g++ 11) CMAKE_CXX_COMPILER_VERSION OR
+ if(CMAKE_C_COMPILER_VERSION VERSION_LESS 10.2 OR CMAKE_CXX_COMPILER_VERSION
+@@ -139,8 +145,7 @@ endif()
+
+ # ---------------------------------------------------------------------
+ # SVE Object Library
+-
+-add_library(arm_compute_sve OBJECT "")
++add_library(arm_compute_sve OBJECT ${ARM_COMPUTE_SVE_SOURCES})
+ target_compile_options(arm_compute_sve
+ PRIVATE "-march=armv8.2-a+sve+fp16+dotprod"
+ PRIVATE "-fPIC")
+@@ -162,8 +167,7 @@ target_include_directories(
+
+ # ---------------------------------------------------------------------
+ # SVE2 Object Library
+-
+-add_library(arm_compute_sve2 OBJECT "")
++add_library(arm_compute_sve2 OBJECT ${ARM_COMPUTE_SVE2_SOURCES})
+ target_compile_options(arm_compute_sve2
+ PRIVATE "-march=armv8.6-a+sve2+fp16+dotprod"
+ PRIVATE "-fPIC")
+@@ -187,7 +191,7 @@ target_include_directories(
+ # ---------------------------------------------------------------------
+ # Core Library
+
+-add_library(arm_compute "")
++add_library(arm_compute ${ARM_COMPUTE_SOURCES})
+ target_compile_options(arm_compute PRIVATE "-march=${ARM_COMPUTE_ARCH}")
+ target_compile_definitions(arm_compute PRIVATE ARM_COMPUTE_ENABLE_BF16)
+ target_compile_definitions(arm_compute PRIVATE ENABLE_SVE)
+@@ -216,7 +220,7 @@ target_link_libraries(
+ # ---------------------------------------------------------------------
+ # Graph Library
+
+-add_library(arm_compute_graph "")
++add_library(arm_compute_graph ${ARM_COMPUTE_GRAPH_SOURCES})
+ target_compile_options(arm_compute_graph PRIVATE "-march=${ARM_COMPUTE_ARCH}")
+ target_compile_definitions(arm_compute_graph PRIVATE ENABLE_SVE)
+ target_compile_definitions(arm_compute_graph PRIVATE ARM_COMPUTE_ENABLE_SVE)
+@@ -238,10 +242,6 @@ target_compile_options(arm_compute_graph PUBLIC ${COMMON_CXX_FLAGS})
+
+ add_library(ArmCompute::Graph ALIAS arm_compute_graph)
+
+-# ---------------------------------------------------------------------
+-# Library Target Sources
+-add_subdirectory(src)
+-
+ if(ARM_COMPUTE_BUILD_TESTING)
+ # ---------------------------------------------------------------------
+ # Validation Framework Library
+diff --git a/scripts/generate_build_files.py b/scripts/generate_build_files.py
+index 52a8cc14da..4c4a14623f 100644
+--- a/scripts/generate_build_files.py
++++ b/scripts/generate_build_files.py
+@@ -167,27 +167,19 @@ def build_from_template_cmake(srcs_graph, srcs_sve, srcs_sve2, srcs_core):
+
+ template = f"""{get_template_header()}
+
+-target_sources(
+- arm_compute_graph
+- PRIVATE
++set(ARM_COMPUTE_GRAPH_SOURCES
+ {line_separator.join(srcs_graph)}
+ )
+
+-target_sources(
+- arm_compute_sve
+- PRIVATE
++set(ARM_COMPUTE_SVE_SOURCES
+ {line_separator.join(srcs_sve)}
+ )
+
+-target_sources(
+- arm_compute_sve2
+- PRIVATE
++set(ARM_COMPUTE_SVE2_SOURCES
+ {line_separator.join(srcs_sve2)}
+ )
+
+-target_sources(
+- arm_compute
+- PRIVATE
++set(ARM_COMPUTE_SOURCES
+ {line_separator.join(srcs_core)}
+ )
+ """
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index f1b275532a..73871563e1 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -20,9 +20,7 @@
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ # SOFTWARE.
+
+-target_sources(
+- arm_compute_graph
+- PRIVATE
++set(ARM_COMPUTE_GRAPH_SOURCES
+ graph/DataLayerVisitor.cpp
+ graph/Graph.cpp
+ graph/GraphBuilder.cpp
+@@ -100,9 +98,7 @@ target_sources(
+ graph/printers/DotGraphPrinter.cpp
+ )
+
+-target_sources(
+- arm_compute_sve
+- PRIVATE
++set(ARM_COMPUTE_SVE_SOURCES
+ core/NEON/kernels/arm_conv/depthwise/interleaves/sve_s8q_3x3_dot.cpp
+ core/NEON/kernels/arm_conv/depthwise/interleaves/sve_u8q_3x3_dot.cpp
+ core/NEON/kernels/arm_conv/depthwise/kernels/sme2_fp16_nhwc_3x3_s1_output2x2_mla_depthfirst/generic_direct.cpp
+@@ -331,9 +327,7 @@ target_sources(
+ cpu/kernels/softmax/generic/sve/impl_bf16.cpp
+ )
+
+-target_sources(
+- arm_compute_sve2
+- PRIVATE
++set(ARM_COMPUTE_SVE2_SOURCES
+ cpu/kernels/activation/generic/sve2/lut.cpp
+ cpu/kernels/activation/generic/sve2/qasymm8.cpp
+ cpu/kernels/activation/generic/sve2/qasymm8_signed.cpp
+@@ -356,9 +350,7 @@ target_sources(
+ cpu/kernels/softmax/generic/sve2/impl.cpp
+ )
+
+-target_sources(
+- arm_compute
+- PRIVATE
++set(ARM_COMPUTE_SOURCES
+ c/AclContext.cpp
+ c/AclOperator.cpp
+ c/AclQueue.cpp
diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch
new file mode 100644
index 00000000..29ca02f5
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch
@@ -0,0 +1,112 @@
+From cdb765df59d8ce5f388ac2a820b5da76eb8d610c Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 5 Dec 2024 09:47:25 -0600
+Subject: [PATCH] Add CMake options for SVE, SVE2, and BF16 support
+
+These should be optional, add options for these. Remove the hard-coded
+definitions of these for the libraries. This also makes it so validation
+options are not needed, if SVE is enabled it will be validated.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+Change-Id: I03182ac6ece843e813c027ef6a573cbba254dee9
+---
+ CMakeLists.txt | 19 -------------------
+ cmake/Options.cmake | 16 +++++++++++++---
+ 2 files changed, 13 insertions(+), 22 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4073e06b17..4d95fb1bfd 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -149,9 +149,6 @@ add_library(arm_compute_sve OBJECT ${ARM_COMPUTE_SVE_SOURCES})
+ target_compile_options(arm_compute_sve
+ PRIVATE "-march=armv8.2-a+sve+fp16+dotprod"
+ PRIVATE "-fPIC")
+-target_compile_definitions(arm_compute_sve PRIVATE ARM_COMPUTE_ENABLE_BF16)
+-target_compile_definitions(arm_compute_sve PRIVATE ENABLE_SVE)
+-target_compile_definitions(arm_compute_sve PRIVATE ARM_COMPUTE_ENABLE_SVE)
+ target_include_directories(
+ arm_compute_sve
+ PUBLIC $<INSTALL_INTERFACE:include>
+@@ -171,10 +168,6 @@ add_library(arm_compute_sve2 OBJECT ${ARM_COMPUTE_SVE2_SOURCES})
+ target_compile_options(arm_compute_sve2
+ PRIVATE "-march=armv8.6-a+sve2+fp16+dotprod"
+ PRIVATE "-fPIC")
+-target_compile_definitions(arm_compute_sve2 PRIVATE ARM_COMPUTE_ENABLE_SVE2)
+-target_compile_definitions(arm_compute_sve2 PRIVATE ARM_COMPUTE_ENABLE_BF16)
+-target_compile_definitions(arm_compute_sve2 PRIVATE ENABLE_SVE)
+-target_compile_definitions(arm_compute_sve2 PRIVATE ARM_COMPUTE_ENABLE_SVE)
+ target_include_directories(
+ arm_compute_sve2
+ PUBLIC $<INSTALL_INTERFACE:include>
+@@ -193,9 +186,6 @@ target_include_directories(
+
+ add_library(arm_compute ${ARM_COMPUTE_SOURCES})
+ target_compile_options(arm_compute PRIVATE "-march=${ARM_COMPUTE_ARCH}")
+-target_compile_definitions(arm_compute PRIVATE ARM_COMPUTE_ENABLE_BF16)
+-target_compile_definitions(arm_compute PRIVATE ENABLE_SVE)
+-target_compile_definitions(arm_compute PRIVATE ARM_COMPUTE_ENABLE_SVE)
+ target_include_directories(
+ arm_compute
+ PUBLIC $<INSTALL_INTERFACE:include>
+@@ -222,8 +212,6 @@ target_link_libraries(
+
+ add_library(arm_compute_graph ${ARM_COMPUTE_GRAPH_SOURCES})
+ target_compile_options(arm_compute_graph PRIVATE "-march=${ARM_COMPUTE_ARCH}")
+-target_compile_definitions(arm_compute_graph PRIVATE ENABLE_SVE)
+-target_compile_definitions(arm_compute_graph PRIVATE ARM_COMPUTE_ENABLE_SVE)
+ # add_subdirectory(src/graph)
+
+ target_include_directories(
+@@ -268,13 +256,6 @@ if(ARM_COMPUTE_BUILD_TESTING)
+
+ add_executable(arm_compute_validation "")
+ target_compile_options(arm_compute_validation PRIVATE "-march=${ARM_COMPUTE_ARCH}")
+- if(ARM_COMPUTE_ENABLE_BF16_VALIDATION)
+- target_compile_definitions(arm_compute_validation PRIVATE ARM_COMPUTE_ENABLE_BF16)
+- endif()
+- if(ARM_COMPUTE_ENABLE_SVE_VALIDATION)
+- target_compile_definitions(arm_compute_validation PRIVATE ENABLE_SVE)
+- target_compile_definitions(arm_compute_validation PRIVATE ARM_COMPUTE_ENABLE_SVE)
+- endif()
+ add_subdirectory(tests/validation)
+ target_compile_options(arm_compute_validation PUBLIC ${COMMON_CXX_FLAGS})
+ set_target_properties(
+diff --git a/cmake/Options.cmake b/cmake/Options.cmake
+index 121d527718..5c23fcb490 100644
+--- a/cmake/Options.cmake
++++ b/cmake/Options.cmake
+@@ -48,11 +48,12 @@ set(ARM_COMPUTE_ARCH armv8-a CACHE STRING "Architecture to use")
+ # ---------------------------------------------------------------------
+ # Backends
+
+-option(ARM_COMPUTE_ENABLE_BF16_VALIDATION "" ON)
+-option(ARM_COMPUTE_ENABLE_SVE_VALIDATION "" OFF)
+-
+ option(ENABLE_NEON "Enable Arm® Neon™ support" ON)
++option(ENABLE_SVE "Enable Arm® SVE support" ON)
++option(ENABLE_SVE2 "Enable Arm® SVE2 support" ON)
++
+ option(ARM_COMPUTE_CPU_ENABLED "" ON)
++option(ARM_COMPUTE_ENABLE_BF16 "" ON)
+ option(ARM_COMPUTE_ENABLE_I8MM "" ON)
+ option(ENABLE_FP32_KERNELS "" ON)
+ option(ENABLE_QASYMM8_KERNELS "" ON)
+@@ -74,6 +75,15 @@ endif()
+ if(ARM_COMPUTE_CPU_ENABLED)
+ add_definitions(-DARM_COMPUTE_CPU_ENABLED)
+ endif()
++if(ENABLE_SVE)
++ add_definitions(-DARM_COMPUTE_ENABLE_SVE)
++endif()
++if(ENABLE_SVE2)
++ add_definitions(-DARM_COMPUTE_ENABLE_SVE2)
++endif()
++if(ARM_COMPUTE_ENABLE_BF16)
++ add_definitions(-DARM_COMPUTE_ENABLE_BF16)
++endif()
+ if(ARM_COMPUTE_ENABLE_FP16)
+ add_definitions(-DARM_COMPUTE_ENABLE_FP16)
+ endif()
diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch
new file mode 100644
index 00000000..06370adb
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch
@@ -0,0 +1,91 @@
+From ab5bf5b8f86337a31bfd48277650f583a040e658 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 5 Dec 2024 09:59:48 -0600
+Subject: [PATCH] Allow SVE and SVE2 support to be disabled in CMake
+
+Currently these are hard-coded as enabled. The SVE and SVE2 libraries
+are built unconditionally. These should only be built when SVE or
+SVE2 is available.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+Change-Id: I176259f872a84f736028622694d65d4c5b57e379
+---
+ CMakeLists.txt | 25 ++++++++++++++++++-------
+ 1 file changed, 18 insertions(+), 7 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4d95fb1bfd..d233d6bc67 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -145,6 +145,7 @@ endif()
+
+ # ---------------------------------------------------------------------
+ # SVE Object Library
++if(ENABLE_SVE)
+ add_library(arm_compute_sve OBJECT ${ARM_COMPUTE_SVE_SOURCES})
+ target_compile_options(arm_compute_sve
+ PRIVATE "-march=armv8.2-a+sve+fp16+dotprod"
+@@ -161,9 +162,11 @@ target_include_directories(
+ src/core/cpu/kernels/assembly
+ src/cpu/kernels/assembly
+ src/core/NEON/kernels/arm_gemm/merges)
++endif() # ENABLE_SVE
+
+ # ---------------------------------------------------------------------
+ # SVE2 Object Library
++if(ENABLE_SVE2)
+ add_library(arm_compute_sve2 OBJECT ${ARM_COMPUTE_SVE2_SOURCES})
+ target_compile_options(arm_compute_sve2
+ PRIVATE "-march=armv8.6-a+sve2+fp16+dotprod"
+@@ -180,6 +183,7 @@ target_include_directories(
+ src/core/cpu/kernels/assembly
+ src/cpu/kernels/assembly
+ src/core/NEON/kernels/arm_gemm/merges)
++endif() # ENABLE_SVE2
+
+ # ---------------------------------------------------------------------
+ # Core Library
+@@ -203,9 +207,12 @@ target_compile_options(arm_compute PUBLIC ${COMMON_CXX_FLAGS})
+ add_library(ArmCompute::Core ALIAS arm_compute)
+
+ # arm_compute_sve and arm_compute_sve2 obj files will not be public in the arm_compute.so
+-target_link_libraries(
+- arm_compute PRIVATE $<TARGET_OBJECTS:arm_compute_sve>
+- PRIVATE $<TARGET_OBJECTS:arm_compute_sve2>)
++if(ENABLE_SVE)
++ target_link_libraries(arm_compute PRIVATE $<TARGET_OBJECTS:arm_compute_sve>)
++endif()
++if(ENABLE_SVE2)
++ target_link_libraries(arm_compute PRIVATE $<TARGET_OBJECTS:arm_compute_sve2>)
++endif()
+
+ # ---------------------------------------------------------------------
+ # Graph Library
+@@ -263,8 +270,10 @@ if(ARM_COMPUTE_BUILD_TESTING)
+ "${CMAKE_BINARY_DIR}/validation")
+ target_link_libraries(
+ arm_compute_validation
+- PUBLIC arm_compute arm_compute_graph arm_compute_validation_framework
+- arm_compute_sve)
++ PUBLIC arm_compute arm_compute_graph arm_compute_validation_framework)
++ if(ENABLE_SVE)
++ target_link_libraries(arm_compute_validation PUBLIC arm_compute_sve)
++ endif()
+ target_link_directories(arm_compute_validation PUBLIC tests)
+
+ # ---------------------------------------------------------------------
+@@ -299,8 +308,10 @@ if(ARM_COMPUTE_BUILD_EXAMPLES)
+ set_target_properties(
+ ${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
+ "${CMAKE_BINARY_DIR}/examples")
+- target_link_libraries(${test_name} PUBLIC arm_compute
+- arm_compute_graph arm_compute_sve)
++ target_link_libraries(${test_name} PUBLIC arm_compute arm_compute_graph)
++ if(ENABLE_SVE)
++ target_link_libraries(${test_name} PUBLIC arm_compute_sve)
++ endif()
+ endforeach()
+
+ # NEON Examples
diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch
new file mode 100644
index 00000000..07dd4bee
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch
@@ -0,0 +1,86 @@
+From 416cffe2a75a4ec66a75e00bc00297f2f0187e0f Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 5 Dec 2024 10:05:03 -0600
+Subject: [PATCH] Allow ARMv7 builds using CMake
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+Change-Id: Ib6bae5820569a8eadd53afdfe31e611a3089140e
+---
+ CMakeLists.txt | 25 +++++++++++++++++--
+ .../fixtures/CpuGemmAssemblyDispatchFixture.h | 3 +++
+ 2 files changed, 26 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d233d6bc67..4fc27553f3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -148,7 +148,7 @@ endif()
+ if(ENABLE_SVE)
+ add_library(arm_compute_sve OBJECT ${ARM_COMPUTE_SVE_SOURCES})
+ target_compile_options(arm_compute_sve
+- PRIVATE "-march=armv8.2-a+sve+fp16+dotprod"
++ PRIVATE "-march=${ARM_COMPUTE_ARCH}"
+ PRIVATE "-fPIC")
+ target_include_directories(
+ arm_compute_sve
+@@ -169,7 +169,7 @@ endif() # ENABLE_SVE
+ if(ENABLE_SVE2)
+ add_library(arm_compute_sve2 OBJECT ${ARM_COMPUTE_SVE2_SOURCES})
+ target_compile_options(arm_compute_sve2
+- PRIVATE "-march=armv8.6-a+sve2+fp16+dotprod"
++ PRIVATE "-march=${ARM_COMPUTE_ARCH}"
+ PRIVATE "-fPIC")
+ target_include_directories(
+ arm_compute_sve2
+@@ -204,6 +204,15 @@ target_include_directories(
+ src/core/NEON/kernels/convolution/winograd)
+ target_compile_options(arm_compute PUBLIC ${COMMON_CXX_FLAGS})
+
++if(ARM_COMPUTE_ARCH MATCHES "armv7")
++ target_sources(
++ arm_compute
++ PRIVATE
++ src/core/NEON/kernels/arm_gemm/kernels/a32_sgemm_8x6/a53.cpp
++ src/core/NEON/kernels/arm_gemm/kernels/a32_sgemm_8x6/a55r1.cpp
++ src/core/NEON/kernels/arm_gemm/kernels/a32_sgemm_8x6/generic.cpp)
++endif()
++
+ add_library(ArmCompute::Core ALIAS arm_compute)
+
+ # arm_compute_sve and arm_compute_sve2 obj files will not be public in the arm_compute.so
+@@ -264,6 +273,18 @@ if(ARM_COMPUTE_BUILD_TESTING)
+ add_executable(arm_compute_validation "")
+ target_compile_options(arm_compute_validation PRIVATE "-march=${ARM_COMPUTE_ARCH}")
+ add_subdirectory(tests/validation)
++ target_include_directories(
++ arm_compute_validation
++ PUBLIC $<INSTALL_INTERFACE:include>
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
++ ${CMAKE_CURRENT_SOURCE_DIR}
++ PRIVATE src
++ src/cpu/kernels/assembly
++ src/core/NEON/kernels/arm_gemm
++ src/core/NEON/kernels/assembly
++ src/core/NEON/kernels/convolution/common
++ src/core/NEON/kernels/arm_conv/depthwise
++ src/core/NEON/kernels/convolution/winograd)
+ target_compile_options(arm_compute_validation PUBLIC ${COMMON_CXX_FLAGS})
+ set_target_properties(
+ arm_compute_validation PROPERTIES RUNTIME_OUTPUT_DIRECTORY
+diff --git a/tests/validation/fixtures/CpuGemmAssemblyDispatchFixture.h b/tests/validation/fixtures/CpuGemmAssemblyDispatchFixture.h
+index 5d74e210d5..0b45cdf356 100644
+--- a/tests/validation/fixtures/CpuGemmAssemblyDispatchFixture.h
++++ b/tests/validation/fixtures/CpuGemmAssemblyDispatchFixture.h
+@@ -25,7 +25,10 @@
+ #define ACL_TESTS_VALIDATION_FIXTURES_CPUGEMMASSEMBLYDISPATCHFIXTURE_H
+
+ #include "arm_compute/core/Helpers.h"
++
++#ifdef ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS
+ #include "arm_compute/runtime/NEON/functions/NEReorderLayer.h"
++#endif //ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS
+ #include "arm_compute/runtime/NEON/functions/NETranspose.h"
+
+ #include "src/core/NEON/kernels/arm_gemm/utils.hpp"
diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch
new file mode 100644
index 00000000..9883a44d
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch
@@ -0,0 +1,46 @@
+From 58698788adaeb2f74cf9fcddf06f3e9a2e78b984 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Mon, 16 Dec 2024 09:42:22 -0600
+Subject: [PATCH] Fix undefined symbol error when building TensorInfo
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+Change-Id: I657d1b7faaad94147c685c4826916d3c21da82e1
+---
+ arm_compute/core/TensorInfo.h | 5 +----
+ src/core/TensorInfo.cpp | 5 +++++
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/arm_compute/core/TensorInfo.h b/arm_compute/core/TensorInfo.h
+index e4c9cbe879..2bfe83c4b1 100644
+--- a/arm_compute/core/TensorInfo.h
++++ b/arm_compute/core/TensorInfo.h
+@@ -242,10 +242,7 @@ public:
+ {
+ return _num_channels;
+ }
+- const TensorShape &tensor_shape() const override
+- {
+- return _tensor_shape;
+- }
++ const TensorShape &tensor_shape() const override;
+ const TensorDimsState &tensor_dims_state() const override
+ {
+ return _dims_state;
+diff --git a/src/core/TensorInfo.cpp b/src/core/TensorInfo.cpp
+index 31bddbde40..884203fd7c 100644
+--- a/src/core/TensorInfo.cpp
++++ b/src/core/TensorInfo.cpp
+@@ -395,6 +395,11 @@ ITensorInfo &TensorInfo::set_tensor_dims_state(const TensorDimsState &state)
+ return *this;
+ }
+
++const TensorShape &TensorInfo::tensor_shape() const
++{
++ return _tensor_shape;
++}
++
+ ITensorInfo &TensorInfo::set_quantization_info(const QuantizationInfo &quantization_info)
+ {
+ _quantization_info = quantization_info;
diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
new file mode 100644
index 00000000..383b02fb
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
@@ -0,0 +1,89 @@
+SUMMARY = "The ARM Computer Vision and Machine Learning library"
+DESCRIPTION = "The ARM Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSES/MIT.txt;md5=35f8944fae972976691f3483b0ac9dba"
+
+SRC_URI = " \
+ git://github.com/ARM-software/ComputeLibrary.git;branch=main;protocol=https \
+ file://0001-fix-Fix-indention-in-cmake-generator-script.patch \
+ file://0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch \
+ file://0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch \
+ file://0004-Add-source-files-at-library-definition-time.patch \
+ file://0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch \
+ file://0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch \
+ file://0007-Allow-ARMv7-builds-using-CMake.patch \
+ file://0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch \
+"
+SRCREV = "32bcced2af7feea6969dd1d22e58d0718dc488e3"
+
+S = "${WORKDIR}/git"
+
+# Only compatible with armv7, armv7ve, and aarch64
+COMPATIBLE_MACHINE = "(^$)"
+COMPATIBLE_MACHINE:aarch64 = "(.*)"
+COMPATIBLE_MACHINE:armv7a = "${@bb.utils.contains("TUNE_FEATURES","neon","(.*)","(^$)",d)}"
+COMPATIBLE_MACHINE:armv7ve = "${@bb.utils.contains("TUNE_FEATURES","neon","(.*)","(^$)",d)}"
+
+inherit cmake
+
+PACKAGECONFIG ??= "examples tests cppthreads openmp"
+
+PACKAGECONFIG[Werror] = "-DARM_COMPUTE_WERROR=ON,-DARM_COMPUTE_WERROR=OFF"
+PACKAGECONFIG[examples] = "-DARM_COMPUTE_BUILD_EXAMPLES=ON,-DARM_COMPUTE_BUILD_EXAMPLES=OFF"
+PACKAGECONFIG[tests] = "-DARM_COMPUTE_BUILD_TESTING=ON,-DARM_COMPUTE_BUILD_TESTING=OFF"
+PACKAGECONFIG[cppthreads] = "-DARM_COMPUTE_CPPTHREADS=ON,-DARM_COMPUTE_CPPTHREADS=OFF"
+PACKAGECONFIG[openmp] = "-DARM_COMPUTE_OPENMP=ON,-DARM_COMPUTE_OPENMP=OFF"
+
+EXTRA_OECMAKE:append:aarch64 = " \
+ -DARM_COMPUTE_ARCH=armv8-a \
+ -DENABLE_NEON=ON \
+ -DENABLE_SVE=OFF \
+ -DENABLE_SVE2=OFF \
+"
+EXTRA_OECMAKE:append:arm = " \
+ -DARM_COMPUTE_ARCH=armv7-a \
+ -DENABLE_NEON=ON \
+ -DENABLE_SVE=OFF \
+ -DENABLE_SVE2=OFF \
+ -DARM_COMPUTE_ENABLE_BF16=OFF \
+ -DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS=OFF \
+"
+
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+# package unversioned .so files in PN (they are not dev symlinks)
+FILES_SOLIBSDEV = ""
+FILES:${PN} += "${libdir}/*.so"
+
+# Install headers and examples
+do_install:append() {
+ CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
+
+ # Install headers
+ install -d ${D}${includedir}
+ cp $CP_ARGS ${S}/arm_compute ${D}${includedir}
+ cp $CP_ARGS ${S}/support ${D}${includedir}
+ cp $CP_ARGS ${S}/include/half ${D}${includedir}
+
+ # Latest ONNX Runtime uses some headers from the ACL source
+ install -d ${D}${includedir}/src
+ (cd ${S}/src; find -type f -name \*.h\* -exec install -D {} ${D}${includedir}/src/{} \;)
+
+ # Install examples
+ if ${@bb.utils.contains('PACKAGECONFIG', 'examples', 'true', 'false', d)}; then
+ install -d ${D}${bindir}/${PN}-${PV}/examples
+ for example in ${B}/examples/*; do
+ if [ -d "$example" ]; then
+ continue
+ fi
+ case "$example" in
+ (*.o|*.a|*.cmake) continue;;
+ esac
+ install -m 0555 $example ${D}${bindir}/${PN}-${PV}/examples
+ done
+ fi
+}
+
+PACKAGES =+ "${PN}-tests ${PN}-examples"
+FILES:${PN}-tests += "${libdir}/tests"
+FILES:${PN}-examples += "${bindir}/*/examples"
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [meta-arago][scarthgap/master][PATCH 2/4] meta-arago-extras: Add recipe for Arm NN
2025-02-03 18:59 [meta-arago][scarthgap/master][PATCH 0/4] Add ML frameworks Andrew Davis
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 1/4] meta-arago-extras: Add recipe for arm-compute-library Andrew Davis
@ 2025-02-03 18:59 ` Andrew Davis
2025-02-05 20:12 ` Denys Dmytriyenko
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 3/4] meta-arago-extras: Add recipe for ONNX Andrew Davis
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 4/4] meta-arago-extras: Add recipe for ONNX Runtime Andrew Davis
3 siblings, 1 reply; 9+ messages in thread
From: Andrew Davis @ 2025-02-03 18:59 UTC (permalink / raw)
To: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago; +Cc: Andrew Davis
Arm NN is a performant machine learning inference engine for Linux,
accelerating ML on Arm Cortex-A CPUs.
Signed-off-by: Andrew Davis <afd@ti.com>
---
...01-Fix-type-casting-for-32bit-builds.patch | 40 +++++++++++
.../recipes-devtools/armnn/armnn_24.11.bb | 70 +++++++++++++++++++
2 files changed, 110 insertions(+)
create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch
create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
diff --git a/meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch b/meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch
new file mode 100644
index 00000000..8e3cf34d
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch
@@ -0,0 +1,40 @@
+From 10953c25a77989709bcbd065489700314fe0c8c6 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 16 Jan 2025 11:11:28 -0600
+Subject: [PATCH] Fix type casting for 32bit builds
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+Change-Id: Id68274e68e7832b827050a2e417053e88e7a6728
+---
+ include/armnn/Numpy.hpp | 2 +-
+ tests/ExecuteNetwork/FileComparisonExecutor.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/armnn/Numpy.hpp b/include/armnn/Numpy.hpp
+index a4154b434..f77b065ca 100644
+--- a/include/armnn/Numpy.hpp
++++ b/include/armnn/Numpy.hpp
+@@ -209,7 +209,7 @@ namespace armnnNumpy
+ template<typename T>
+ inline void ReadData(std::ifstream& ifStream, T* tensor, const unsigned int& numElements)
+ {
+- ifStream.read(reinterpret_cast<char *>(tensor), sizeof(T) * numElements);
++ ifStream.read(reinterpret_cast<char *>(tensor), static_cast<std::streamsize>(sizeof(T) * numElements));
+ }
+
+
+diff --git a/tests/ExecuteNetwork/FileComparisonExecutor.cpp b/tests/ExecuteNetwork/FileComparisonExecutor.cpp
+index 903ed0362..4617ebe4a 100644
+--- a/tests/ExecuteNetwork/FileComparisonExecutor.cpp
++++ b/tests/ExecuteNetwork/FileComparisonExecutor.cpp
+@@ -187,7 +187,7 @@ Tensor ReadTensorFromFile(const std::string fileName)
+
+ // We'll read the entire file into one buffer.
+ std::ifstream file(fileName, std::ios::binary);
+- std::vector<char> buffer(fileSize);
++ std::vector<char> buffer(static_cast<std::size_t>(fileSize));
+ if (file.read(buffer.data(), static_cast<std::streamsize>(fileSize)))
+ {
+ std::string tensorName;
diff --git a/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb b/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
new file mode 100644
index 00000000..e965382a
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
@@ -0,0 +1,70 @@
+SUMMARY = "ARM Neural Network SDK"
+DESCRIPTION = "Linux software and tools to enable machine learning workloads on power-efficient devices"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3e14a924c16f7d828b8335a59da64074"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+BRANCH = "branches/armnn_24_11"
+SRC_URI = "git://github.com/ARM-software/armnn.git;branch=${BRANCH};protocol=https"
+SRC_URI += "file://0001-Fix-type-casting-for-32bit-builds.patch"
+
+# v24.11
+SRCREV = "3ed70c005559d409feff2c578a1a39cf8fec8804"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+inherit pkgconfig
+
+DEPENDS = " \
+ boost \
+ protobuf \
+ xxd-native \
+ arm-compute-library \
+"
+
+RDEPENDS:${PN} = " \
+ arm-compute-library \
+ protobuf \
+ boost \
+"
+
+PACKAGECONFIG += "unit-tests tests ref"
+PACKAGECONFIG += "${@bb.utils.contains('TARGET_ARCH', 'aarch64', 'neon', '', d)}"
+PACKAGECONFIG += "${@bb.utils.contains('TARGET_ARCH', 'arm', 'neon', '', d)}"
+
+PACKAGECONFIG[neon] = "-DARMCOMPUTENEON=1, -DARMCOMPUTENEON=0"
+PACKAGECONFIG[unit-tests] = "-DBUILD_UNIT_TESTS=1, -DBUILD_UNIT_TESTS=0"
+PACKAGECONFIG[tests] = "-DBUILD_TESTS=1, -DBUILD_TESTS=0"
+PACKAGECONFIG[ref] = "-DARMNNREF=1, -DARMNNREF=0"
+
+EXTRA_OECMAKE += " \
+ -DHALF_INCLUDE=${STAGING_DIR_TARGET} \
+"
+
+do_install:append() {
+ CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
+
+ if ${@bb.utils.contains('PACKAGECONFIG', 'tests', 'true', 'false', d)}; then
+ install -d ${D}${bindir}/${P}
+ find ${B}/tests -maxdepth 1 -type f -executable -exec cp $CP_ARGS {} ${D}${bindir}/${P} \;
+ fi
+
+ if ${@bb.utils.contains('PACKAGECONFIG', 'unit-tests', 'true', 'false', d)}; then
+ install -d ${D}${bindir}/${P}
+ cp $CP_ARGS ${B}/UnitTests ${D}${bindir}/${P}
+ fi
+
+ if ${@bb.utils.contains('PACKAGECONFIG', 'tensorflow-lite', 'false', 'true', d)}; then
+ rm -rf ${D}${includedir}/armnnTfLiteParser
+ fi
+}
+
+CXXFLAGS += "-Wno-error=array-bounds -Wno-error=deprecated-declarations -Wno-error=nonnull"
+
+FILES:${PN} += "${libdir}/*"
+FILES:${PN}-dev += "${includedir}/* ${libdir}/cmake/armnn/* ${libdir}/pkgconfig/*.pc ${bindir}/*"
+
+INSANE_SKIP:${PN} = "dev-so"
+INSANE_SKIP:${PN}-dev += "buildpaths"
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [meta-arago][scarthgap/master][PATCH 3/4] meta-arago-extras: Add recipe for ONNX
2025-02-03 18:59 [meta-arago][scarthgap/master][PATCH 0/4] Add ML frameworks Andrew Davis
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 1/4] meta-arago-extras: Add recipe for arm-compute-library Andrew Davis
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 2/4] meta-arago-extras: Add recipe for Arm NN Andrew Davis
@ 2025-02-03 18:59 ` Andrew Davis
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 4/4] meta-arago-extras: Add recipe for ONNX Runtime Andrew Davis
3 siblings, 0 replies; 9+ messages in thread
From: Andrew Davis @ 2025-02-03 18:59 UTC (permalink / raw)
To: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago; +Cc: Andrew Davis
ONNX provides an open source format for AI models, both deep learning
and traditional ML. It defines an extensible computation graph model,
as well as definitions of built-in operators and standard data types.
Signed-off-by: Andrew Davis <afd@ti.com>
---
...age-Protobuf-before-checking-if-it-w.patch | 25 ++++
...-export-internal-targets-directories.patch | 28 +++++
.../recipes-framework/onnx/onnx_1.16.1.bb | 107 ++++++++++++++++++
3 files changed, 160 insertions(+)
create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch
create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0002-Do-not-re-export-internal-targets-directories.patch
create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
diff --git a/meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch b/meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch
new file mode 100644
index 00000000..dceac1f4
--- /dev/null
+++ b/meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch
@@ -0,0 +1,25 @@
+From 7e118775c120ec802d13ac3e0125d726323aee87 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 16 Jan 2025 11:44:56 -0600
+Subject: [PATCH] Try to find package Protobuf before checking if it was found
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+---
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b666eec4..f6fbf159 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -127,6 +127,8 @@ if(ONNX_BUILD_TESTS)
+ set(googletest_STATIC_LIBRARIES GTest::gtest)
+ endif()
+
++find_package(Protobuf)
++
+ if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf))
+ # Sometimes we need to use protoc compiled for host architecture while linking
+ # libprotobuf against target architecture. See https://github.com/caffe2/caffe
diff --git a/meta-arago-extras/recipes-framework/onnx/onnx/0002-Do-not-re-export-internal-targets-directories.patch b/meta-arago-extras/recipes-framework/onnx/onnx/0002-Do-not-re-export-internal-targets-directories.patch
new file mode 100644
index 00000000..d9233912
--- /dev/null
+++ b/meta-arago-extras/recipes-framework/onnx/onnx/0002-Do-not-re-export-internal-targets-directories.patch
@@ -0,0 +1,28 @@
+From 0bdd879060cb5022b62d06bff0f21a21c3be18ca Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Mon, 3 Feb 2025 11:28:52 -0600
+Subject: [PATCH] Do not re-export internal targets directories
+
+These can be specific to a given project build and should not
+be automatically inherited to dependent projects.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+---
+ cmake/ONNXConfig.cmake.in | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/cmake/ONNXConfig.cmake.in b/cmake/ONNXConfig.cmake.in
+index d588f8ae..a61af089 100644
+--- a/cmake/ONNXConfig.cmake.in
++++ b/cmake/ONNXConfig.cmake.in
+@@ -6,8 +6,6 @@
+ # library version information
+ set(ONNX_VERSION "@ONNX_VERSION@")
+
+-list(APPEND CMAKE_PREFIX_PATH "@PROTOBUF_DIR@")
+-set(Protobuf_INCLUDE_DIR "@PROTOBUF_INCLUDE_DIR@")
+ find_package(Protobuf REQUIRED)
+
+ # import targets
diff --git a/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb b/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
new file mode 100644
index 00000000..fead0e61
--- /dev/null
+++ b/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
@@ -0,0 +1,107 @@
+DESCRIPTION = "Open standard for machine learning interoperability"
+SUMMARY = "ONNX Python package & C++ library"
+HOMEPAGE = "https://www.onnx.ai/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI = "git://github.com/onnx/onnx.git;protocol=https;branch=rel-1.16.1"
+SRC_URI += "\
+ file://0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch \
+ file://0002-Do-not-re-export-internal-targets-directories.patch \
+"
+SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
+
+S = "${WORKDIR}/git"
+
+DEPENDS += "\
+ abseil-cpp \
+ protobuf \
+ protobuf-native \
+ python3-protobuf \
+ python3-protobuf-native \
+"
+
+PYTHON_DEPENDS = "\
+ python3 \
+ python3-numpy \
+ python3-numpy-native \
+ python3-pybind11 \
+ python3-pybind11-native \
+"
+
+PYTHON_RDEPENDS = "\
+ python3 \
+ python3-numpy \
+ python3-protobuf \
+ python3-coloredlogs \
+ python3-flatbuffers \
+ python3-sympy \
+"
+
+PACKAGECONFIG ??= "python sharedlib unittests"
+
+PACKAGECONFIG[python] = "\
+ -DBUILD_ONNX_PYTHON=ON \
+ -DPYTHON_LIBRARY=${PYTHON_LIBRARY} \
+ -DPYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIR}, \
+ -DBUILD_ONNX_PYTHON=OFF, \
+ ${PYTHON_DEPENDS} \
+"
+
+PACKAGECONFIG[sharedlib] = "-DBUILD_SHARED_LIBS=ON, -D-DBUILD_SHARED_LIBS=OFF"
+PACKAGECONFIG[unittests] = "-DONNX_BUILD_TESTS=ON, -DONNX_BUILD_TESTS=OFF, googletest"
+
+EXTRA_OECMAKE:append = " \
+ -DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
+ -DONNX_USE_PROTOBUF_SHARED_LIBS=ON \
+ -DONNX_DISABLE_STATIC_REGISTRATION=ON \
+ -DONNX_ML=1 \
+ -DCMAKE_VERBOSE_MAKEFILE=ON \
+ --log-level=VERBOSE \
+"
+
+inherit python3native cmake
+
+python do_build_version_file() {
+ import os
+ import textwrap
+
+ version_file_path = os.path.join(d.getVar('B'), "onnx", "version.py")
+ os.makedirs(os.path.dirname(version_file_path), exist_ok=True)
+ with open(version_file_path, "w", encoding="utf-8") as f:
+ f.write(
+ textwrap.dedent(
+ f"""\
+ # This file is generated. DO NOT EDIT!
+
+
+ version = "{d.getVar('PV')}"
+ git_version = "{d.getVar('SRCREV')}"
+ """
+ )
+ )
+}
+addtask build_version_file before do_install after do_compile
+
+do_install:append() {
+ CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
+
+ # Install the Python package.
+ if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+ (cd ${S}/onnx; cp --parents $(find . -name "*.py*") ${D}${PYTHON_SITEPACKAGES_DIR}/onnx)
+ cp $CP_ARGS ${B}/onnx ${D}${PYTHON_SITEPACKAGES_DIR}
+ cp $CP_ARGS ${B}/onnx_cpp2py_export.so ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+ fi
+}
+
+# Add Python package
+PACKAGE_BEFORE_PN += "python3-${PN}"
+FILES:python3-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
+RDEPENDS:python3-${PN} += "${PYTHON_RDEPENDS} onnx"
+
+# Output library is unversioned
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [meta-arago][scarthgap/master][PATCH 4/4] meta-arago-extras: Add recipe for ONNX Runtime
2025-02-03 18:59 [meta-arago][scarthgap/master][PATCH 0/4] Add ML frameworks Andrew Davis
` (2 preceding siblings ...)
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 3/4] meta-arago-extras: Add recipe for ONNX Andrew Davis
@ 2025-02-03 18:59 ` Andrew Davis
3 siblings, 0 replies; 9+ messages in thread
From: Andrew Davis @ 2025-02-03 18:59 UTC (permalink / raw)
To: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago; +Cc: Andrew Davis
ONNX Runtime is a cross-platform inference and training machine-learning
accelerator. ONNX Runtime is compatible with different hardware, drivers,
and operating systems, and provides optimal performance by leveraging
hardware accelerators where applicable alongside graph optimizations and
transforms.
Signed-off-by: Andrew Davis <afd@ti.com>
---
...ble-permission-bit-from-source-files.patch | 72 ++++++++
...-in-option-text-s-buildings-bindings.patch | 25 +++
...D_LIBRARY_PATH-to-search-path-when-n.patch | 32 ++++
...MAKE_CXX_FLAGS-in-build-information-.patch | 31 ++++
...ake-Print-out-result-of-find_package.patch | 37 +++++
.../onnxruntime/onnxruntime_1.20.1.bb | 155 ++++++++++++++++++
6 files changed, 352 insertions(+)
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch
create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb
diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch
new file mode 100644
index 00000000..c890f0bd
--- /dev/null
+++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch
@@ -0,0 +1,72 @@
+From 626066499c34c524924302342fc071f32442caae Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Sun, 12 Jan 2025 12:48:49 -0600
+Subject: [PATCH] Remove executable permission bit from source files
+
+These are source files, not executables, do not set the executable
+permission bit on these files.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+---
+ onnxruntime/contrib_ops/cpu/utils/console_dumper.h | 1 +
+ onnxruntime/core/optimizer/bias_softmax_fusion.cc | 0
+ onnxruntime/core/providers/acl/acl_execution_provider.h | 0
+ onnxruntime/core/providers/acl/acl_fwd.h | 0
+ onnxruntime/core/providers/acl/acl_provider_factory.cc | 0
+ onnxruntime/core/providers/acl/math/gemm.cc | 0
+ onnxruntime/core/providers/acl/nn/batch_norm.cc | 0
+ onnxruntime/core/providers/acl/nn/batch_norm.h | 0
+ onnxruntime/test/optimizer/graph_transform_test.cc | 0
+ onnxruntime/test/optimizer/graph_transform_test_layernorm.cc | 0
+ 10 files changed, 1 insertion(+)
+ mode change 100755 => 100644 onnxruntime/core/optimizer/bias_softmax_fusion.cc
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/acl_execution_provider.h
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/acl_fwd.h
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/acl_provider_factory.cc
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/math/gemm.cc
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/nn/batch_norm.cc
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/nn/batch_norm.h
+ mode change 100755 => 100644 onnxruntime/test/optimizer/graph_transform_test.cc
+ mode change 100755 => 100644 onnxruntime/test/optimizer/graph_transform_test_layernorm.cc
+
+diff --git a/onnxruntime/contrib_ops/cpu/utils/console_dumper.h b/onnxruntime/contrib_ops/cpu/utils/console_dumper.h
+index 9ebc44f441..64bd2b7b18 100644
+--- a/onnxruntime/contrib_ops/cpu/utils/console_dumper.h
++++ b/onnxruntime/contrib_ops/cpu/utils/console_dumper.h
+@@ -3,6 +3,7 @@
+
+ #pragma once
+ #include <string>
++#include <iostream>
+ #include "core/framework/ort_value.h"
+ #include "core/framework/float16.h"
+ #include "contrib_ops/cpu/utils/debug_macros.h"
+diff --git a/onnxruntime/core/optimizer/bias_softmax_fusion.cc b/onnxruntime/core/optimizer/bias_softmax_fusion.cc
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/acl_execution_provider.h b/onnxruntime/core/providers/acl/acl_execution_provider.h
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/acl_fwd.h b/onnxruntime/core/providers/acl/acl_fwd.h
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/acl_provider_factory.cc b/onnxruntime/core/providers/acl/acl_provider_factory.cc
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/math/gemm.cc b/onnxruntime/core/providers/acl/math/gemm.cc
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/nn/batch_norm.cc b/onnxruntime/core/providers/acl/nn/batch_norm.cc
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/nn/batch_norm.h b/onnxruntime/core/providers/acl/nn/batch_norm.h
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/test/optimizer/graph_transform_test.cc b/onnxruntime/test/optimizer/graph_transform_test.cc
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/test/optimizer/graph_transform_test_layernorm.cc b/onnxruntime/test/optimizer/graph_transform_test_layernorm.cc
+old mode 100755
+new mode 100644
diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch
new file mode 100644
index 00000000..88423190
--- /dev/null
+++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch
@@ -0,0 +1,25 @@
+From be67663e9a44d146033aeb97804145a60b4032db Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 16 Jan 2025 12:35:03 -0600
+Subject: [PATCH] [cmake] Fix typo in option text s/buildings/bindings
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+---
+ cmake/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
+index d90a2a3550..e0cde678db 100644
+--- a/cmake/CMakeLists.txt
++++ b/cmake/CMakeLists.txt
+@@ -77,7 +77,7 @@ option(onnxruntime_GENERATE_TEST_REPORTS "Enable test report generation" OFF)
+ option(onnxruntime_ENABLE_STATIC_ANALYSIS "Enable static analysis" OFF)
+ option(onnxruntime_USE_CUSTOM_STATIC_ANALYSIS_RULES "Use a custom SDL Rule. It is mainly for our CI build" OFF)
+ option(onnxruntime_REDIRECT_STATIC_ANALYSIS_OUTPUTS_TO_FILE "Use a custom SDL Rule. It is mainly for our CI build" OFF)
+-option(onnxruntime_ENABLE_PYTHON "Enable python buildings" OFF)
++option(onnxruntime_ENABLE_PYTHON "Enable python bindings" OFF)
+ # Enable it may cause LNK1169 error
+ option(onnxruntime_ENABLE_MEMLEAK_CHECKER "Experimental: Enable memory leak checker in Windows debug build" OFF)
+ option(onnxruntime_USE_CUDA "Build with CUDA support" OFF)
diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch
new file mode 100644
index 00000000..cd979b76
--- /dev/null
+++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch
@@ -0,0 +1,32 @@
+From b1689f3f963f4c07d3329a838569ac4c2fa2bd5f Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 16 Jan 2025 12:38:13 -0600
+Subject: [PATCH] [ACL] Do not add LD_LIBRARY_PATH to search path when not
+ defined
+
+If LD_LIBRARY_PATH is not defined a blank "-L" is added to the
+link command. This causes the next object to be linked to get
+treated as if it was a search path and causes link failure.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+---
+ cmake/onnxruntime_providers_acl.cmake | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/cmake/onnxruntime_providers_acl.cmake b/cmake/onnxruntime_providers_acl.cmake
+index e23d289271..19d41dc73f 100644
+--- a/cmake/onnxruntime_providers_acl.cmake
++++ b/cmake/onnxruntime_providers_acl.cmake
+@@ -13,7 +13,9 @@
+ onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11 safeint_interface
+ )
+
+- target_link_libraries(onnxruntime_providers_acl -L$ENV{LD_LIBRARY_PATH})
++ if (DEFINED ENV{LD_LIBRARY_PATH})
++ target_link_libraries(onnxruntime_providers_acl -L$ENV{LD_LIBRARY_PATH})
++ endif()
+ add_dependencies(onnxruntime_providers_acl ${onnxruntime_EXTERNAL_DEPENDENCIES})
+ set_target_properties(onnxruntime_providers_acl PROPERTIES FOLDER "ONNXRuntime")
+ target_include_directories(onnxruntime_providers_acl
diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch
new file mode 100644
index 00000000..46fc2fc5
--- /dev/null
+++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch
@@ -0,0 +1,31 @@
+From 7ea6e35d3630f8c19080a0cb5a4a4c55c242a36b Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 16 Jan 2025 12:40:57 -0600
+Subject: [PATCH] Do not include CMAKE_CXX_FLAGS in build information string
+
+While this information can be useful, it often includes information
+that may be specific to the build machine (like include paths with
+usernames, e.g. -I /home/myname/externalproject/fakeroot/inlcude).
+
+This causes issues for reproducible builds (resulting binaries will
+be different between different build machines).
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+---
+ cmake/CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
+index e0cde678db..e0d8fd0a17 100644
+--- a/cmake/CMakeLists.txt
++++ b/cmake/CMakeLists.txt
+@@ -1439,7 +1439,6 @@ if (Git_FOUND)
+ string(APPEND ORT_BUILD_INFO "git-branch=${ORT_GIT_BRANCH}, git-commit-id=${ORT_GIT_COMMIT}, ")
+ endif()
+ string(APPEND ORT_BUILD_INFO "build type=${CMAKE_BUILD_TYPE}")
+-string(APPEND ORT_BUILD_INFO ", cmake cxx flags: ${CMAKE_CXX_FLAGS}")
+ configure_file(onnxruntime_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/onnxruntime_config.h)
+ get_property(onnxruntime_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+
diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch
new file mode 100644
index 00000000..9bbe920b
--- /dev/null
+++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch
@@ -0,0 +1,37 @@
+From a73d9b9f4dba6d164e128d6c768d1b0a04e969ab Mon Sep 17 00:00:00 2001
+From: Andrew Davis <afd@ti.com>
+Date: Thu, 16 Jan 2025 12:47:27 -0600
+Subject: [PATCH] [cmake] Print out result of find_package
+
+A verbose only message is already printed that states the CMake will
+attempt to find a package using find_package():
+
+> Trying find_package(...) before FetchContent
+
+But it never prints if the package was found this way or not.
+Add this result message.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <afd@ti.com>
+---
+ cmake/external/helper_functions.cmake | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/cmake/external/helper_functions.cmake b/cmake/external/helper_functions.cmake
+index e3f2211f96..9ca6a967da 100644
+--- a/cmake/external/helper_functions.cmake
++++ b/cmake/external/helper_functions.cmake
+@@ -138,9 +138,12 @@ macro(onnxruntime_fetchcontent_makeavailable)
+ unset(__cmake_fpArgs)
+
+ if(${__cmake_contentName}_FOUND)
++ message(VERBOSE "Found ${__cmake_contentName} with find_package()")
+ FetchContent_SetPopulated(${__cmake_contentName})
+ FetchContent_GetProperties(${__cmake_contentName})
+ continue()
++ else()
++ message(VERBOSE "Could not find ${__cmake_contentName} with find_package()")
+ endif()
+ endif()
+ else()
diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb
new file mode 100644
index 00000000..494bea9a
--- /dev/null
+++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb
@@ -0,0 +1,155 @@
+DESCRIPTION = "ONNX Runtime is a cross-platform, high performance machine learning inferencing framework"
+SUMMARY = "ONNX Runtime Python package & C++ library"
+HOMEPAGE = "https://www.onnxruntime.ai/"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=0f7e3b1308cb5c00b372a6e78835732d"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI = "\
+ git://github.com/microsoft/onnxruntime.git;protocol=https;branch=rel-1.20.1 \
+ git://github.com/HowardHinnant/date.git;protocol=https;branch=master;name=date;destsuffix=${S}/cmake/external/date \
+ git://github.com/pytorch/cpuinfo.git;protocol=https;branch=main;name=cpuinfo;destsuffix=${S}/cmake/external/cpuinfo \
+ git://github.com/google/flatbuffers.git;protocol=https;branch=master;name=flatbuffers;destsuffix=${S}/cmake/external/flatbuffers \
+ git://github.com/dcleblanc/SafeInt.git;protocol=https;branch=master;name=safeint;destsuffix=${S}/cmake/external/safeint \
+ git://gitlab.com/libeigen/eigen.git;protocol=https;branch=3.4;name=eigen;destsuffix=${S}/cmake/external/eigen \
+ git://github.com/google/nsync.git;protocol=https;branch=master;name=nsync;destsuffix=${S}/cmake/external/nsync \
+"
+SRC_URI += "\
+ file://0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch \
+ file://0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch \
+ file://0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch \
+ file://0005-cmake-Print-out-result-of-find_package.patch \
+ file://0001-Remove-executable-permission-bit-from-source-files.patch \
+"
+
+SRCREV_FORMAT = "default"
+SRCREV = "5c1b7ccbff7e5141c1da7a9d963d660e5741c319"
+SRCREV_date = "6e921e1b1d21e84a5c82416ba7ecd98e33a436d0"
+SRCREV_cpuinfo = "ca678952a9a8eaa6de112d154e8e104b22f9ab3f"
+SRCREV_flatbuffers = "0100f6a5779831fa7a651e4b67ef389a8752bd9b"
+SRCREV_safeint = "4cafc9196c4da9c817992b20f5253ef967685bf8"
+SRCREV_eigen = "e7248b26a1ed53fa030c5c459f7ea095dfd276ac"
+SRCREV_nsync = "13de152c2a1cd73ff4df97bd2c406b6d15d34af3"
+
+S = "${WORKDIR}/git"
+
+DEPENDS += "\
+ onnx \
+ abseil-cpp \
+ protobuf \
+ protobuf-native \
+ boost \
+ re2 \
+ nlohmann-json \
+ microsoft-gsl \
+"
+
+PYTHON_DEPENDS = "\
+ python3 \
+ python3-numpy \
+ python3-numpy-native \
+ python3-pybind11 \
+ python3-pybind11-native \
+"
+
+PYTHON_RDEPENDS = "\
+ python3 \
+ python3-onnx \
+ python3-numpy \
+ python3-protobuf \
+ python3-coloredlogs \
+ python3-flatbuffers \
+ python3-sympy \
+"
+
+OECMAKE_SOURCEPATH = "${S}/cmake"
+
+PACKAGECONFIG ??= "python sharedlib unittests acl"
+
+PACKAGECONFIG[python] = "-Donnxruntime_ENABLE_PYTHON=ON, -Donnxruntime_ENABLE_PYTHON=OFF, ${PYTHON_DEPENDS}"
+PACKAGECONFIG[sharedlib] = "-Donnxruntime_BUILD_SHARED_LIB=ON, -Donnxruntime_BUILD_SHARED_LIB=OFF"
+PACKAGECONFIG[unittests] = "-Donnxruntime_BUILD_UNIT_TESTS=ON, -Donnxruntime_BUILD_UNIT_TESTS=OFF, googletest"
+
+PACKAGECONFIG[acl] = "-Donnxruntime_USE_ACL=ON, -Donnxruntime_USE_ACL=OFF, arm-compute-library"
+PACKAGECONFIG[armnn] = "-Donnxruntime_USE_ARMNN=ON, -Donnxruntime_USE_ARMNN=OFF, armnn"
+PACKAGECONFIG[armnn-relu] = "-Donnxruntime_ARMNN_RELU_USE_CPU=ON, -Donnxruntime_ARMNN_RELU_USE_CPU=OFF"
+PACKAGECONFIG[armnn-bn] = "-Donnxruntime_ARMNN_BN_USE_CPU=ON, -Donnxruntime_ARMNN_BN_USE_CPU=OFF"
+
+EXTRA_OECMAKE:append = " \
+ -DFETCHCONTENT_FULLY_DISCONNECTED=ON \
+ -DFETCHCONTENT_SOURCE_DIR_DATE=${S}/cmake/external/date \
+ -DFETCHCONTENT_SOURCE_DIR_PYTORCH_CPUINFO=${S}/cmake/external/cpuinfo \
+ -DFETCHCONTENT_SOURCE_DIR_PYTORCH_CLOG=${S}/cmake/external/cpuinfo \
+ -DFETCHCONTENT_SOURCE_DIR_FLATBUFFERS=${S}/cmake/external/flatbuffers \
+ -DFETCHCONTENT_SOURCE_DIR_SAFEINT=${S}/cmake/external/safeint \
+ -DFETCHCONTENT_SOURCE_DIR_EIGEN=${S}/cmake/external/eigen \
+ -DFETCHCONTENT_SOURCE_DIR_GOOGLE_NSYNC=${S}/cmake/external/nsync \
+"
+
+EXTRA_OECMAKE:append = " \
+ -DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
+ -Donnx_SOURCE_DIR=${RECIPE_SYSROOT}${PYTHON_SITEPACKAGES_DIR} \
+ -DPython_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \
+ --compile-no-warning-as-error \
+ --log-level=VERBOSE \
+"
+
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)}
+inherit python3-dir cmake
+
+do_install:append() {
+ CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
+
+ # Install test binaries and data in test package
+ install -d ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/libcustom_op_library.so ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/libcustom_op_get_const_input_test_library.so ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/libcustom_op_local_function.so ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/libcustom_op_invalid_library.so ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/libtest_execution_provider.so ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/onnxruntime_customopregistration_test ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/onnxruntime_global_thread_pools_test ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/onnxruntime_logging_apis_test ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/onnxruntime_mlas_test ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/onnxruntime_perf_test ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/onnxruntime_shared_lib_test ${D}${bindir}/${BPN}-tests
+ install -m 0755 ${B}/onnxruntime_test_all ${D}${bindir}/${BPN}-tests
+ cp $CP_ARGS ${B}/testdata ${D}${bindir}/${BPN}-tests
+
+ # Install python tests and data
+ cp $CP_ARGS ${S}/onnxruntime/test/python/* ${D}${bindir}/${BPN}-tests
+
+ # Install the Python package.
+ if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+ cp $CP_ARGS ${B}/onnxruntime ${D}${PYTHON_SITEPACKAGES_DIR}
+ find ${D}${PYTHON_SITEPACKAGES_DIR} -name "libonnx*.so*" -exec rm {} \;
+ fi
+}
+
+# Add Python package
+PACKAGE_BEFORE_PN += "python3-${PN}"
+FILES:python3-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
+RDEPENDS:python3-${PN} += "${PYTHON_RDEPENDS} onnxruntime"
+
+# Add Python tests package
+PACKAGE_BEFORE_PN += "python3-${PN}-tests"
+FILES:python3-${PN}-tests += "\
+ ${bindir}/${BPN}-tests/*.py \
+ ${bindir}/${BPN}-tests/contrib_ops \
+ ${bindir}/${BPN}-tests/quantization \
+ ${bindir}/${BPN}-tests/transformers \
+"
+RDEPENDS:python3-${PN}-tests += "python3-${PN}"
+
+# Add tests package
+PACKAGE_BEFORE_PN += "${PN}-tests"
+FILES:${PN}-tests = "${bindir}/${BPN}-tests"
+INSANE_SKIP:${PN}-tests += "libdir"
+
+# package unversioned .so files in PN (they are not dev symlinks)
+FILES_SOLIBSDEV = "${libdir}/libonnxruntime.so"
+FILES:${PN} += "${libdir}/libonnxruntime_providers_shared.so"
+
+INSANE_SKIP:${PN}-dbg += "libdir"
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 1/4] meta-arago-extras: Add recipe for arm-compute-library
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 1/4] meta-arago-extras: Add recipe for arm-compute-library Andrew Davis
@ 2025-02-05 20:07 ` Denys Dmytriyenko
2025-02-05 20:27 ` Andrew Davis
0 siblings, 1 reply; 9+ messages in thread
From: Denys Dmytriyenko @ 2025-02-05 20:07 UTC (permalink / raw)
To: afd; +Cc: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago
On Mon, Feb 03, 2025 at 12:59:50PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> The Compute Library is a collection of low-level machine learning
> functions optimized for Arm. This will be used for ARMNN and
> other machine learning applications and frameworks.
>
> Signed-off-by: Andrew Davis <afd@ti.com>
> ---
> ...-indention-in-cmake-generator-script.patch | 130 ++++++++++++
> ...ENABLE_NEON-in-code-for-checking-NEO.patch | 114 ++++++++++
> ...ENABLE_SVE-in-code-for-checking-SVE-.patch | 197 ++++++++++++++++++
> ...rce-files-at-library-definition-time.patch | 167 +++++++++++++++
> ...ptions-for-SVE-SVE2-and-BF16-support.patch | 112 ++++++++++
> ...SVE2-support-to-be-disabled-in-CMake.patch | 91 ++++++++
> .../0007-Allow-ARMv7-builds-using-CMake.patch | 86 ++++++++
> ...ymbol-error-when-building-TensorInfo.patch | 46 ++++
> .../arm-compute-library_24.12.bb | 89 ++++++++
> 9 files changed, 1032 insertions(+)
> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch
> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch
> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch
> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch
> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch
> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch
> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch
> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch
> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
> diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
> new file mode 100644
> index 00000000..383b02fb
> --- /dev/null
> +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
> @@ -0,0 +1,89 @@
> +SUMMARY = "The ARM Computer Vision and Machine Learning library"
> +DESCRIPTION = "The ARM Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs."
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM = "file://LICENSES/MIT.txt;md5=35f8944fae972976691f3483b0ac9dba"
> +
> +SRC_URI = " \
> + git://github.com/ARM-software/ComputeLibrary.git;branch=main;protocol=https \
> + file://0001-fix-Fix-indention-in-cmake-generator-script.patch \
> + file://0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch \
> + file://0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch \
> + file://0004-Add-source-files-at-library-definition-time.patch \
> + file://0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch \
> + file://0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch \
> + file://0007-Allow-ARMv7-builds-using-CMake.patch \
> + file://0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch \
> +"
> +SRCREV = "32bcced2af7feea6969dd1d22e58d0718dc488e3"
> +
> +S = "${WORKDIR}/git"
> +
> +# Only compatible with armv7, armv7ve, and aarch64
> +COMPATIBLE_MACHINE = "(^$)"
> +COMPATIBLE_MACHINE:aarch64 = "(.*)"
> +COMPATIBLE_MACHINE:armv7a = "${@bb.utils.contains("TUNE_FEATURES","neon","(.*)","(^$)",d)}"
> +COMPATIBLE_MACHINE:armv7ve = "${@bb.utils.contains("TUNE_FEATURES","neon","(.*)","(^$)",d)}"
Seems excessive...
Will this work:
COMPATIBLE_MACHINE = "(armv7a|aarch64)"
If you do want to specifically check for "neon" being enabled, you can still
skip armv7ve, as armv7a check will also apply to armv7ve...
> +
> +inherit cmake
> +
> +PACKAGECONFIG ??= "examples tests cppthreads openmp"
> +
> +PACKAGECONFIG[Werror] = "-DARM_COMPUTE_WERROR=ON,-DARM_COMPUTE_WERROR=OFF"
> +PACKAGECONFIG[examples] = "-DARM_COMPUTE_BUILD_EXAMPLES=ON,-DARM_COMPUTE_BUILD_EXAMPLES=OFF"
> +PACKAGECONFIG[tests] = "-DARM_COMPUTE_BUILD_TESTING=ON,-DARM_COMPUTE_BUILD_TESTING=OFF"
> +PACKAGECONFIG[cppthreads] = "-DARM_COMPUTE_CPPTHREADS=ON,-DARM_COMPUTE_CPPTHREADS=OFF"
> +PACKAGECONFIG[openmp] = "-DARM_COMPUTE_OPENMP=ON,-DARM_COMPUTE_OPENMP=OFF"
> +
> +EXTRA_OECMAKE:append:aarch64 = " \
> + -DARM_COMPUTE_ARCH=armv8-a \
> + -DENABLE_NEON=ON \
> + -DENABLE_SVE=OFF \
> + -DENABLE_SVE2=OFF \
> +"
> +EXTRA_OECMAKE:append:arm = " \
And here, the override should probably be armv7a, not arm? I know you set
COMPATIBLE_MACHINE above to prevent armv4/v5/v6 from even coming here, but
still...
> + -DARM_COMPUTE_ARCH=armv7-a \
> + -DENABLE_NEON=ON \
> + -DENABLE_SVE=OFF \
> + -DENABLE_SVE2=OFF \
> + -DARM_COMPUTE_ENABLE_BF16=OFF \
> + -DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS=OFF \
> +"
> +
> +INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 2/4] meta-arago-extras: Add recipe for Arm NN
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 2/4] meta-arago-extras: Add recipe for Arm NN Andrew Davis
@ 2025-02-05 20:12 ` Denys Dmytriyenko
2025-02-05 20:55 ` Andrew Davis
0 siblings, 1 reply; 9+ messages in thread
From: Denys Dmytriyenko @ 2025-02-05 20:12 UTC (permalink / raw)
To: afd; +Cc: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago
On Mon, Feb 03, 2025 at 12:59:51PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> Arm NN is a performant machine learning inference engine for Linux,
> accelerating ML on Arm Cortex-A CPUs.
>
> Signed-off-by: Andrew Davis <afd@ti.com>
> ---
> ...01-Fix-type-casting-for-32bit-builds.patch | 40 +++++++++++
> .../recipes-devtools/armnn/armnn_24.11.bb | 70 +++++++++++++++++++
> 2 files changed, 110 insertions(+)
> create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch
> create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
...
> diff --git a/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb b/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
> new file mode 100644
> index 00000000..e965382a
> --- /dev/null
> +++ b/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
> @@ -0,0 +1,70 @@
> +SUMMARY = "ARM Neural Network SDK"
> +DESCRIPTION = "Linux software and tools to enable machine learning workloads on power-efficient devices"
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=3e14a924c16f7d828b8335a59da64074"
> +
> +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
This is the default - why do you need to set it explicitly?
> +BRANCH = "branches/armnn_24_11"
> +SRC_URI = "git://github.com/ARM-software/armnn.git;branch=${BRANCH};protocol=https"
> +SRC_URI += "file://0001-Fix-type-casting-for-32bit-builds.patch"
> +
> +# v24.11
> +SRCREV = "3ed70c005559d409feff2c578a1a39cf8fec8804"
> +
> +S = "${WORKDIR}/git"
> +
> +inherit cmake
> +inherit pkgconfig
> +
> +DEPENDS = " \
> + boost \
> + protobuf \
> + xxd-native \
> + arm-compute-library \
> +"
> +
> +RDEPENDS:${PN} = " \
> + arm-compute-library \
> + protobuf \
> + boost \
All these are listed in the DEPENDS and will be carried over to RDEPENDS
automatically, no need to list them explicitly, unless shlib logic is
completely screwed, in which case you better mention that in the commit log.
> +"
> +
> +PACKAGECONFIG += "unit-tests tests ref"
> +PACKAGECONFIG += "${@bb.utils.contains('TARGET_ARCH', 'aarch64', 'neon', '', d)}"
> +PACKAGECONFIG += "${@bb.utils.contains('TARGET_ARCH', 'arm', 'neon', '', d)}"
> +
> +PACKAGECONFIG[neon] = "-DARMCOMPUTENEON=1, -DARMCOMPUTENEON=0"
> +PACKAGECONFIG[unit-tests] = "-DBUILD_UNIT_TESTS=1, -DBUILD_UNIT_TESTS=0"
> +PACKAGECONFIG[tests] = "-DBUILD_TESTS=1, -DBUILD_TESTS=0"
> +PACKAGECONFIG[ref] = "-DARMNNREF=1, -DARMNNREF=0"
> +
> +EXTRA_OECMAKE += " \
> + -DHALF_INCLUDE=${STAGING_DIR_TARGET} \
> +"
> +
> +do_install:append() {
> + CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
> +
> + if ${@bb.utils.contains('PACKAGECONFIG', 'tests', 'true', 'false', d)}; then
> + install -d ${D}${bindir}/${P}
> + find ${B}/tests -maxdepth 1 -type f -executable -exec cp $CP_ARGS {} ${D}${bindir}/${P} \;
> + fi
> +
> + if ${@bb.utils.contains('PACKAGECONFIG', 'unit-tests', 'true', 'false', d)}; then
> + install -d ${D}${bindir}/${P}
> + cp $CP_ARGS ${B}/UnitTests ${D}${bindir}/${P}
> + fi
> +
> + if ${@bb.utils.contains('PACKAGECONFIG', 'tensorflow-lite', 'false', 'true', d)}; then
> + rm -rf ${D}${includedir}/armnnTfLiteParser
> + fi
> +}
> +
> +CXXFLAGS += "-Wno-error=array-bounds -Wno-error=deprecated-declarations -Wno-error=nonnull"
> +
> +FILES:${PN} += "${libdir}/*"
> +FILES:${PN}-dev += "${includedir}/* ${libdir}/cmake/armnn/* ${libdir}/pkgconfig/*.pc ${bindir}/*"
> +
> +INSANE_SKIP:${PN} = "dev-so"
> +INSANE_SKIP:${PN}-dev += "buildpaths"
> --
> 2.39.2
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 1/4] meta-arago-extras: Add recipe for arm-compute-library
2025-02-05 20:07 ` Denys Dmytriyenko
@ 2025-02-05 20:27 ` Andrew Davis
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Davis @ 2025-02-05 20:27 UTC (permalink / raw)
To: Denys Dmytriyenko
Cc: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago
On 2/5/25 2:07 PM, Denys Dmytriyenko wrote:
> On Mon, Feb 03, 2025 at 12:59:50PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
>> The Compute Library is a collection of low-level machine learning
>> functions optimized for Arm. This will be used for ARMNN and
>> other machine learning applications and frameworks.
>>
>> Signed-off-by: Andrew Davis <afd@ti.com>
>> ---
>> ...-indention-in-cmake-generator-script.patch | 130 ++++++++++++
>> ...ENABLE_NEON-in-code-for-checking-NEO.patch | 114 ++++++++++
>> ...ENABLE_SVE-in-code-for-checking-SVE-.patch | 197 ++++++++++++++++++
>> ...rce-files-at-library-definition-time.patch | 167 +++++++++++++++
>> ...ptions-for-SVE-SVE2-and-BF16-support.patch | 112 ++++++++++
>> ...SVE2-support-to-be-disabled-in-CMake.patch | 91 ++++++++
>> .../0007-Allow-ARMv7-builds-using-CMake.patch | 86 ++++++++
>> ...ymbol-error-when-building-TensorInfo.patch | 46 ++++
>> .../arm-compute-library_24.12.bb | 89 ++++++++
>> 9 files changed, 1032 insertions(+)
>> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
>
>> diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
>> new file mode 100644
>> index 00000000..383b02fb
>> --- /dev/null
>> +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
>> @@ -0,0 +1,89 @@
>> +SUMMARY = "The ARM Computer Vision and Machine Learning library"
>> +DESCRIPTION = "The ARM Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs."
>> +LICENSE = "MIT"
>> +LIC_FILES_CHKSUM = "file://LICENSES/MIT.txt;md5=35f8944fae972976691f3483b0ac9dba"
>> +
>> +SRC_URI = " \
>> + git://github.com/ARM-software/ComputeLibrary.git;branch=main;protocol=https \
>> + file://0001-fix-Fix-indention-in-cmake-generator-script.patch \
>> + file://0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch \
>> + file://0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch \
>> + file://0004-Add-source-files-at-library-definition-time.patch \
>> + file://0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch \
>> + file://0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch \
>> + file://0007-Allow-ARMv7-builds-using-CMake.patch \
>> + file://0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch \
>> +"
>> +SRCREV = "32bcced2af7feea6969dd1d22e58d0718dc488e3"
>> +
>> +S = "${WORKDIR}/git"
>> +
>> +# Only compatible with armv7, armv7ve, and aarch64
>> +COMPATIBLE_MACHINE = "(^$)"
>> +COMPATIBLE_MACHINE:aarch64 = "(.*)"
>> +COMPATIBLE_MACHINE:armv7a = "${@bb.utils.contains("TUNE_FEATURES","neon","(.*)","(^$)",d)}"
>> +COMPATIBLE_MACHINE:armv7ve = "${@bb.utils.contains("TUNE_FEATURES","neon","(.*)","(^$)",d)}"
>
> Seems excessive...
>
> Will this work:
>
> COMPATIBLE_MACHINE = "(armv7a|aarch64)"
>
> If you do want to specifically check for "neon" being enabled, you can still
> skip armv7ve, as armv7a check will also apply to armv7ve...
>
I do need to check for NEON specifically like this as there
are armv7a and armv7ve machines with it disabled, and this
will not work for them.
As for skipping the check armv7ve it does seem like that would
work, but I see them checked individually all over core layers
for some reason, so wanted to follow that. For a random example:
https://git.openembedded.org/openembedded-core/tree/meta/recipes-extended/ghostscript/ghostscript_10.04.0.bb#n47
>
>> +
>> +inherit cmake
>> +
>> +PACKAGECONFIG ??= "examples tests cppthreads openmp"
>> +
>> +PACKAGECONFIG[Werror] = "-DARM_COMPUTE_WERROR=ON,-DARM_COMPUTE_WERROR=OFF"
>> +PACKAGECONFIG[examples] = "-DARM_COMPUTE_BUILD_EXAMPLES=ON,-DARM_COMPUTE_BUILD_EXAMPLES=OFF"
>> +PACKAGECONFIG[tests] = "-DARM_COMPUTE_BUILD_TESTING=ON,-DARM_COMPUTE_BUILD_TESTING=OFF"
>> +PACKAGECONFIG[cppthreads] = "-DARM_COMPUTE_CPPTHREADS=ON,-DARM_COMPUTE_CPPTHREADS=OFF"
>> +PACKAGECONFIG[openmp] = "-DARM_COMPUTE_OPENMP=ON,-DARM_COMPUTE_OPENMP=OFF"
>> +
>> +EXTRA_OECMAKE:append:aarch64 = " \
>> + -DARM_COMPUTE_ARCH=armv8-a \
>> + -DENABLE_NEON=ON \
>> + -DENABLE_SVE=OFF \
>> + -DENABLE_SVE2=OFF \
>> +"
>> +EXTRA_OECMAKE:append:arm = " \
>
> And here, the override should probably be armv7a, not arm? I know you set
> COMPATIBLE_MACHINE above to prevent armv4/v5/v6 from even coming here, but
> still...
>
Maybe, but that seems overly constraining then, for instance if this
package gains support for additional ARM versions like armv6, then I
would have to change this back to just arm, instead of just relaxing
the COMPATIBLE_MACHINE lines above.
Andrew
>
>> + -DARM_COMPUTE_ARCH=armv7-a \
>> + -DENABLE_NEON=ON \
>> + -DENABLE_SVE=OFF \
>> + -DENABLE_SVE2=OFF \
>> + -DARM_COMPUTE_ENABLE_BF16=OFF \
>> + -DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS=OFF \
>> +"
>> +
>> +INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 2/4] meta-arago-extras: Add recipe for Arm NN
2025-02-05 20:12 ` Denys Dmytriyenko
@ 2025-02-05 20:55 ` Andrew Davis
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Davis @ 2025-02-05 20:55 UTC (permalink / raw)
To: Denys Dmytriyenko
Cc: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago
On 2/5/25 2:12 PM, Denys Dmytriyenko wrote:
> On Mon, Feb 03, 2025 at 12:59:51PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
>> Arm NN is a performant machine learning inference engine for Linux,
>> accelerating ML on Arm Cortex-A CPUs.
>>
>> Signed-off-by: Andrew Davis <afd@ti.com>
>> ---
>> ...01-Fix-type-casting-for-32bit-builds.patch | 40 +++++++++++
>> .../recipes-devtools/armnn/armnn_24.11.bb | 70 +++++++++++++++++++
>> 2 files changed, 110 insertions(+)
>> create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
>
> ...
>
>> diff --git a/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb b/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
>> new file mode 100644
>> index 00000000..e965382a
>> --- /dev/null
>> +++ b/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
>> @@ -0,0 +1,70 @@
>> +SUMMARY = "ARM Neural Network SDK"
>> +DESCRIPTION = "Linux software and tools to enable machine learning workloads on power-efficient devices"
>> +LICENSE = "MIT"
>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=3e14a924c16f7d828b8335a59da64074"
>> +
>> +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
>
> This is the default - why do you need to set it explicitly?
>
Hmm, must have been a leftover from devtools or something, I can remove it.
>
>> +BRANCH = "branches/armnn_24_11"
>> +SRC_URI = "git://github.com/ARM-software/armnn.git;branch=${BRANCH};protocol=https"
>> +SRC_URI += "file://0001-Fix-type-casting-for-32bit-builds.patch"
>> +
>> +# v24.11
>> +SRCREV = "3ed70c005559d409feff2c578a1a39cf8fec8804"
>> +
>> +S = "${WORKDIR}/git"
>> +
>> +inherit cmake
>> +inherit pkgconfig
>> +
>> +DEPENDS = " \
>> + boost \
>> + protobuf \
>> + xxd-native \
>> + arm-compute-library \
>> +"
>> +
>> +RDEPENDS:${PN} = " \
>> + arm-compute-library \
>> + protobuf \
>> + boost \
>
> All these are listed in the DEPENDS and will be carried over to RDEPENDS
> automatically, no need to list them explicitly, unless shlib logic is
> completely screwed, in which case you better mention that in the commit log.
>
For arm-compute-library the shlib logic was completely screwed but I
think that got fixed for this version. Let me run some checks and I'll
drop these if it all works.
Andrew
>
>> +"
>> +
>> +PACKAGECONFIG += "unit-tests tests ref"
>> +PACKAGECONFIG += "${@bb.utils.contains('TARGET_ARCH', 'aarch64', 'neon', '', d)}"
>> +PACKAGECONFIG += "${@bb.utils.contains('TARGET_ARCH', 'arm', 'neon', '', d)}"
>> +
>> +PACKAGECONFIG[neon] = "-DARMCOMPUTENEON=1, -DARMCOMPUTENEON=0"
>> +PACKAGECONFIG[unit-tests] = "-DBUILD_UNIT_TESTS=1, -DBUILD_UNIT_TESTS=0"
>> +PACKAGECONFIG[tests] = "-DBUILD_TESTS=1, -DBUILD_TESTS=0"
>> +PACKAGECONFIG[ref] = "-DARMNNREF=1, -DARMNNREF=0"
>> +
>> +EXTRA_OECMAKE += " \
>> + -DHALF_INCLUDE=${STAGING_DIR_TARGET} \
>> +"
>> +
>> +do_install:append() {
>> + CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
>> +
>> + if ${@bb.utils.contains('PACKAGECONFIG', 'tests', 'true', 'false', d)}; then
>> + install -d ${D}${bindir}/${P}
>> + find ${B}/tests -maxdepth 1 -type f -executable -exec cp $CP_ARGS {} ${D}${bindir}/${P} \;
>> + fi
>> +
>> + if ${@bb.utils.contains('PACKAGECONFIG', 'unit-tests', 'true', 'false', d)}; then
>> + install -d ${D}${bindir}/${P}
>> + cp $CP_ARGS ${B}/UnitTests ${D}${bindir}/${P}
>> + fi
>> +
>> + if ${@bb.utils.contains('PACKAGECONFIG', 'tensorflow-lite', 'false', 'true', d)}; then
>> + rm -rf ${D}${includedir}/armnnTfLiteParser
>> + fi
>> +}
>> +
>> +CXXFLAGS += "-Wno-error=array-bounds -Wno-error=deprecated-declarations -Wno-error=nonnull"
>> +
>> +FILES:${PN} += "${libdir}/*"
>> +FILES:${PN}-dev += "${includedir}/* ${libdir}/cmake/armnn/* ${libdir}/pkgconfig/*.pc ${bindir}/*"
>> +
>> +INSANE_SKIP:${PN} = "dev-so"
>> +INSANE_SKIP:${PN}-dev += "buildpaths"
>> --
>> 2.39.2
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-02-05 20:56 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-03 18:59 [meta-arago][scarthgap/master][PATCH 0/4] Add ML frameworks Andrew Davis
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 1/4] meta-arago-extras: Add recipe for arm-compute-library Andrew Davis
2025-02-05 20:07 ` Denys Dmytriyenko
2025-02-05 20:27 ` Andrew Davis
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 2/4] meta-arago-extras: Add recipe for Arm NN Andrew Davis
2025-02-05 20:12 ` Denys Dmytriyenko
2025-02-05 20:55 ` Andrew Davis
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 3/4] meta-arago-extras: Add recipe for ONNX Andrew Davis
2025-02-03 18:59 ` [meta-arago][scarthgap/master][PATCH 4/4] meta-arago-extras: Add recipe for ONNX Runtime Andrew Davis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.