* [meta-arago][scarthgap/master][PATCH 0/6] Add ONNX Runtime
@ 2025-01-17 0:25 Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 1/6] flatbuffers: Remove this recipe Andrew Davis
` (5 more replies)
0 siblings, 6 replies; 16+ messages in thread
From: Andrew Davis @ 2025-01-17 0:25 UTC (permalink / raw)
To: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago; +Cc: Andrew Davis
Hello all,
[2/6] is a v2 with a fixup so it only builds for ARMv7+.
[3/6] is already in -next but this is a small update, it can either
replace the one in -next or I can resend as an update patch.
[4/6] is only needed for scarthgap, master should not need this one.
This all adds some initial support for ONNX Runtime for all devices
not just ones with DSP. For now, DSP support will still come from
meta-edgeai layer.
Thanks,
Andrew
Andrew Davis (6):
flatbuffers: Remove this recipe
meta-arago-extras: Add recipe for arm-compute-library
meta-arago-extras: Add recipe for Arm NN
meta-arago-extras: Backport abseil-cpp from meta-oe master
meta-arago-extras: Add recipe for ONNX
meta-arago-extras: Add recipe for ONNX Runtime
.../0001-absl-always-use-asm-sgidefs.h.patch | 38 ++++
...e-maes-option-from-cross-compilation.patch | 38 ++++
...e-neon-option-from-cross-compilation.patch | 49 +++++
.../abseil-cpp/0004-abseil-ppc-fixes.patch | 103 +++++++++
...-virtual-dtor-in-the-flags-are-neede.patch | 30 +++
.../abseil-cpp/abseil-cpp_20240722.0.bb | 54 +++++
...-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 | 85 ++++++++
.../flatbuffers/flatbuffers_1.11.0.bb | 34 ---
...age-Protobuf-before-checking-if-it-w.patch | 25 +++
.../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 ++++++++++++++
26 files changed, 1953 insertions(+), 34 deletions(-)
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
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
delete mode 100644 meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.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_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] 16+ messages in thread
* [meta-arago][scarthgap/master][PATCH 1/6] flatbuffers: Remove this recipe
2025-01-17 0:25 [meta-arago][scarthgap/master][PATCH 0/6] Add ONNX Runtime Andrew Davis
@ 2025-01-17 0:25 ` Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 2/6] meta-arago-extras: Add recipe for arm-compute-library Andrew Davis
` (4 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Andrew Davis @ 2025-01-17 0:25 UTC (permalink / raw)
To: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago; +Cc: Andrew Davis
This was used for TFlite and ARMNN before it was included in meta-oe.
A newer better maintained version of this is in meta-oe now.
Signed-off-by: Andrew Davis <afd@ti.com>
---
.../flatbuffers/flatbuffers_1.11.0.bb | 34 -------------------
1 file changed, 34 deletions(-)
delete mode 100644 meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb
diff --git a/meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb b/meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb
deleted file mode 100644
index 7f7b8b99..00000000
--- a/meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb
+++ /dev/null
@@ -1,34 +0,0 @@
-SUMMARY = "Memory Efficient Serialization Library"
-HOMEPAGE = "https://github.com/google/flatbuffers"
-SECTION = "console/tools"
-LICENSE = "Apache-2.0"
-
-PACKAGE_BEFORE_PN = "${PN}-compiler"
-
-RDEPENDS:${PN}-compiler = "${PN}"
-RDEPENDS:${PN}-dev += "${PN}-compiler"
-
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a873c5645c184d51e0f9b34e1d7cf559"
-
-SRCREV = "bf9eb67ab9371755c6bcece13cadc7693bcbf264"
-
-SRC_URI = "git://github.com/google/flatbuffers.git;protocol=https;branch=master"
-
-# Make sure C++11 is used, required for example for GCC 4.9
-CXXFLAGS += "-std=c++11"
-BUILD_CXXFLAGS += "-std=c++11"
-
-# BUILD_TYPE=Release is required, otherwise flatc is not installed
-EXTRA_OECMAKE += "\
- -DCMAKE_BUILD_TYPE=Release \
- -DFLATBUFFERS_BUILD_TESTS=OFF \
- -DFLATBUFFERS_BUILD_SHAREDLIB=ON \
-"
-
-inherit cmake
-
-S = "${WORKDIR}/git"
-
-FILES:${PN}-compiler = "${bindir}"
-
-BBCLASSEXTEND = "native nativesdk"
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [meta-arago][scarthgap/master][PATCH 2/6] meta-arago-extras: Add recipe for arm-compute-library
2025-01-17 0:25 [meta-arago][scarthgap/master][PATCH 0/6] Add ONNX Runtime Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 1/6] flatbuffers: Remove this recipe Andrew Davis
@ 2025-01-17 0:25 ` Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 3/6] meta-arago-extras: Add recipe for Arm NN Andrew Davis
` (3 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Andrew Davis @ 2025-01-17 0:25 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] 16+ messages in thread
* [meta-arago][scarthgap/master][PATCH 3/6] meta-arago-extras: Add recipe for Arm NN
2025-01-17 0:25 [meta-arago][scarthgap/master][PATCH 0/6] Add ONNX Runtime Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 1/6] flatbuffers: Remove this recipe Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 2/6] meta-arago-extras: Add recipe for arm-compute-library Andrew Davis
@ 2025-01-17 0:25 ` Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master Andrew Davis
` (2 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Andrew Davis @ 2025-01-17 0:25 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 | 85 +++++++++++++++++++
2 files changed, 125 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..3ba914da
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
@@ -0,0 +1,85 @@
+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 buildpaths"
+INSANE_SKIP:${PN}-dev += "dev-elf buildpaths"
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master
2025-01-17 0:25 [meta-arago][scarthgap/master][PATCH 0/6] Add ONNX Runtime Andrew Davis
` (2 preceding siblings ...)
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 3/6] meta-arago-extras: Add recipe for Arm NN Andrew Davis
@ 2025-01-17 0:25 ` Andrew Davis
2025-01-22 23:02 ` Denys Dmytriyenko
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 6/6] meta-arago-extras: Add recipe for ONNX Runtime Andrew Davis
5 siblings, 1 reply; 16+ messages in thread
From: Andrew Davis @ 2025-01-17 0:25 UTC (permalink / raw)
To: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago; +Cc: Andrew Davis
ONNX and ONNX Runtime depend on a very specific version of Abseil that
is not the version included with meta-oe scarthgap. But it just so
happens to be the version provided in current meta-oe master.
Backport this version for our use in scarthgap.
This patch is not needed for meta-arago master branch. If meta-oe
master at some point moves to a newer incompatible version of
Abseil we will deal with this dependency in a different way.
Signed-off-by: Andrew Davis <afd@ti.com>
---
.../0001-absl-always-use-asm-sgidefs.h.patch | 38 +++++++
...e-maes-option-from-cross-compilation.patch | 38 +++++++
...e-neon-option-from-cross-compilation.patch | 49 +++++++++
.../abseil-cpp/0004-abseil-ppc-fixes.patch | 103 ++++++++++++++++++
...-virtual-dtor-in-the-flags-are-neede.patch | 30 +++++
.../abseil-cpp/abseil-cpp_20240722.0.bb | 54 +++++++++
6 files changed, 312 insertions(+)
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
new file mode 100644
index 00000000..6fecf256
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
@@ -0,0 +1,38 @@
+From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 9 Apr 2020 13:06:27 -0700
+Subject: [PATCH] absl: always use <asm/sgidefs.h>
+
+Fixes mips/musl build, since sgidefs.h is not present on all C libraries
+but on linux asm/sgidefs.h is there and contains same definitions, using
+that makes it portable.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ absl/base/internal/direct_mmap.h | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
+index 1beb2ee4..140b0697 100644
+--- a/absl/base/internal/direct_mmap.h
++++ b/absl/base/internal/direct_mmap.h
+@@ -41,13 +41,9 @@
+
+ #ifdef __mips__
+ // Include definitions of the ABI currently in use.
+-#if defined(__BIONIC__) || !defined(__GLIBC__)
+-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
++// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
+ // definitions we need.
+ #include <asm/sgidefs.h>
+-#else
+-#include <sgidefs.h>
+-#endif // __BIONIC__ || !__GLIBC__
+ #endif // __mips__
+
+ // SYS_mmap and SYS_munmap are not defined in Android.
+--
+2.25.1
+
diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
new file mode 100644
index 00000000..d49e860f
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
@@ -0,0 +1,38 @@
+From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <sinan.kaya@microsoft.com>
+Date: Mon, 3 Feb 2020 03:25:57 +0000
+Subject: [PATCH] Remove maes option from cross-compilation
+
+Upstream-Status: Pending
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index da2282fe..5e0e8dfd 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+ list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
+ )
+
+-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
+- "-maes"
+- "-msse4.1"
+-)
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index b9e0071e..0072008c 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+ ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
+ ]
+
+-ABSL_RANDOM_HWAES_X64_FLAGS = [
+- "-maes",
+- "-msse4.1",
+-]
+--
+2.25.1
+
diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
new file mode 100644
index 00000000..c82b9e1b
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
@@ -0,0 +1,49 @@
+From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski@bisdn.de>
+Date: Thu, 16 Jun 2022 11:46:31 +0000
+Subject: [PATCH] Remove neon option from cross compilation
+
+Not every arm platform supports neon instructions, so do not enforce
+them.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index 5e0e8dfd..57cfc4d3 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
+ "/DNOMINMAX"
+ )
+
+-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
+- "-mfpu=neon"
+-)
+-
+ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+ "-march=armv8-a+crypto"
+ )
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index 0072008c..72840fda 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [
+ "/DNOMINMAX",
+ ]
+
+-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
+- "-mfpu=neon",
+-]
+-
+ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+ "-march=armv8-a+crypto",
+ ]
+--
+2.25.1
+
diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
new file mode 100644
index 00000000..ba0cd669
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
@@ -0,0 +1,103 @@
+From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 21 Sep 2024 20:53:06 +0800
+Subject: [PATCH] abseil: ppc fixes
+
+An all-in-one patch that fixes several issues:
+
+1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
+2) powerpc stacktrace implementation only works on glibc (disabled on musl)
+3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
+4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
+
+Sourced from void linux
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ absl/base/internal/unscaledcycleclock.cc | 4 ++--
+ absl/base/internal/unscaledcycleclock_config.h | 3 ++-
+ absl/debugging/internal/examine_stack.cc | 8 +++++++-
+ absl/debugging/internal/stacktrace_config.h | 2 +-
+ 4 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc
+index a0bf3a65..103b4f6a 100644
+--- a/absl/base/internal/unscaledcycleclock.cc
++++ b/absl/base/internal/unscaledcycleclock.cc
+@@ -20,7 +20,7 @@
+ #include <intrin.h>
+ #endif
+
+-#if defined(__powerpc__) || defined(__ppc__)
++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+ #ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
+ #elif defined(__FreeBSD__)
+@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
+ return base_internal::NominalCPUFrequency();
+ }
+
+-#elif defined(__powerpc__) || defined(__ppc__)
++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+
+ int64_t UnscaledCycleClock::Now() {
+ #ifdef __GLIBC__
+diff --git a/absl/base/internal/unscaledcycleclock_config.h b/absl/base/internal/unscaledcycleclock_config.h
+index 43a3dabe..196a8535 100644
+--- a/absl/base/internal/unscaledcycleclock_config.h
++++ b/absl/base/internal/unscaledcycleclock_config.h
+@@ -21,7 +21,8 @@
+
+ // The following platforms have an implementation of a hardware counter.
+ #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
+- defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) || \
++ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
++ defined(_M_IX86) || \
+ (defined(_M_X64) && !defined(_M_ARM64EC))
+ #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
+ #else
+diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
+index 3dd6ba1a..f923b055 100644
+--- a/absl/debugging/internal/examine_stack.cc
++++ b/absl/debugging/internal/examine_stack.cc
+@@ -36,6 +36,10 @@
+ #include <csignal>
+ #include <cstdio>
+
++#if defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #include "absl/base/attributes.h"
+ #include "absl/base/internal/raw_logging.h"
+ #include "absl/base/macros.h"
+@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) {
+ return reinterpret_cast<void*>(context->uc_mcontext.pc);
+ #elif defined(__powerpc64__)
+ return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
+-#elif defined(__powerpc__)
++#elif defined(__powerpc__) && defined(__GLIBC__)
+ return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
++#elif defined(__powerpc__)
++ return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
+ #elif defined(__riscv)
+ return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
+ #elif defined(__s390__) && !defined(__s390x__)
+diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h
+index 3929b1b7..23d5e504 100644
+--- a/absl/debugging/internal/stacktrace_config.h
++++ b/absl/debugging/internal/stacktrace_config.h
+@@ -60,7 +60,7 @@
+ #elif defined(__i386__) || defined(__x86_64__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+ "absl/debugging/internal/stacktrace_x86-inl.inc"
+-#elif defined(__ppc__) || defined(__PPC__)
++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+ "absl/debugging/internal/stacktrace_powerpc-inl.inc"
+ #elif defined(__aarch64__)
+--
+2.25.1
+
diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
new file mode 100644
index 00000000..9a4fc0b4
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
@@ -0,0 +1,30 @@
+From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
+From: Derek Mauro <dmauro@google.com>
+Date: Mon, 5 Aug 2024 07:35:05 -0700
+Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to
+ suppress warnings in headers". It should fall through to the "don't impose
+ our warnings on others" case. Do this by matching on "-Wno-*" instead of
+ "-Wno*".
+
+Fixes #1737
+
+PiperOrigin-RevId: 659548798
+Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
+Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
+---
+ CMake/AbseilHelpers.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
+index b177e590..3c4c92fe 100644
+--- a/CMake/AbseilHelpers.cmake
++++ b/CMake/AbseilHelpers.cmake
+@@ -195,7 +195,7 @@ function(absl_cc_library)
+ # specified platform. Filter both of them out before the successor
+ # reaches the "^-m" filter.
+ set(skip_next_cflag ON)
+- elseif(${cflag} MATCHES "^(-Wno|/wd)")
++ elseif(${cflag} MATCHES "^(-Wno-|/wd)")
+ # These flags are needed to suppress warnings that might fire in our headers.
+ set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
+ elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
new file mode 100644
index 00000000..4bfc2100
--- /dev/null
+++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
@@ -0,0 +1,54 @@
+SUMMARY = "Abseil is a cpp library like STL"
+DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
+additional useful libraries like algorithm, container, debugging, hash, memory, \
+meta, numeric, strings, synchronization, time, types and utility."
+HOMEPAGE = "https://abseil.io/"
+SECTION = "libs"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
+
+SRCREV = "4447c7562e3bc702ade25105912dce503f0c4010"
+BRANCH = "lts_2024_07_22"
+SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
+ file://0001-absl-always-use-asm-sgidefs.h.patch \
+ file://0002-Remove-maes-option-from-cross-compilation.patch \
+ file://0003-Remove-neon-option-from-cross-compilation.patch \
+ file://0004-abseil-ppc-fixes.patch \
+ file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
+ -DBUILD_TESTING=OFF \
+ -DABSL_ENABLE_INSTALL=ON \
+ "
+
+SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
+
+PACKAGES_DYNAMIC += "^libabsl-*"
+PACKAGES_DYNAMIC:class-native = ""
+
+PACKAGESPLITFUNCS =+ "split_dynamic_packages"
+
+python split_dynamic_packages() {
+ libdir = d.getVar('libdir')
+
+ libpackages = do_split_packages(
+ d,
+ root=libdir,
+ file_regex=r'^libabsl_(.*)\.so\..*$',
+ output_pattern='libabsl-%s',
+ description="abseil shared library %s",
+ prepend=True,
+ extra_depends='',
+ )
+ if libpackages:
+ d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(libpackages))
+}
+
+ALLOW_EMPTY:${PN} = "1"
+
+BBCLASSEXTEND = "native nativesdk"
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX
2025-01-17 0:25 [meta-arago][scarthgap/master][PATCH 0/6] Add ONNX Runtime Andrew Davis
` (3 preceding siblings ...)
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master Andrew Davis
@ 2025-01-17 0:25 ` Andrew Davis
2025-01-18 19:48 ` Chirag Shilwant
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 6/6] meta-arago-extras: Add recipe for ONNX Runtime Andrew Davis
5 siblings, 1 reply; 16+ messages in thread
From: Andrew Davis @ 2025-01-17 0:25 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 ++++
.../recipes-framework/onnx/onnx_1.16.1.bb | 107 ++++++++++++++++++
2 files changed, 132 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_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_1.16.1.bb b/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
new file mode 100644
index 00000000..9624d061
--- /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"
+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 += "${PYTHON_PN}-${PN}"
+FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
+RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
+
+# Output library is unversioned
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
+
+# TODO: ONNXConfig.cmake in package onnx-dev contains reference to TMPDIR
+INSANE_SKIP:${PN}-dev = "buildpaths"
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [meta-arago][scarthgap/master][PATCH 6/6] meta-arago-extras: Add recipe for ONNX Runtime
2025-01-17 0:25 [meta-arago][scarthgap/master][PATCH 0/6] Add ONNX Runtime Andrew Davis
` (4 preceding siblings ...)
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX Andrew Davis
@ 2025-01-17 0:25 ` Andrew Davis
5 siblings, 0 replies; 16+ messages in thread
From: Andrew Davis @ 2025-01-17 0:25 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..84a02d56
--- /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 += "${PYTHON_PN}-${PN}"
+FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
+RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnxruntime"
+
+# Add Python tests package
+PACKAGE_BEFORE_PN += "${PYTHON_PN}-${PN}-tests"
+FILES:${PYTHON_PN}-${PN}-tests += "\
+ ${bindir}/${BPN}-tests/*.py \
+ ${bindir}/${BPN}-tests/contrib_ops \
+ ${bindir}/${BPN}-tests/quantization \
+ ${bindir}/${BPN}-tests/transformers \
+"
+RDEPENDS:${PYTHON_PN}-${PN}-tests += "${PYTHON_PN}-${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] 16+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX Andrew Davis
@ 2025-01-18 19:48 ` Chirag Shilwant
2025-01-21 18:59 ` Andrew Davis
0 siblings, 1 reply; 16+ messages in thread
From: Chirag Shilwant @ 2025-01-18 19:48 UTC (permalink / raw)
To: Andrew Davis, meta-arago; +Cc: Denys Dmytriyenko, Ryan Eatmon
Hi Andrew,
On 17/01/25 05:55, Andrew Davis wrote:
> 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 ++++
> .../recipes-framework/onnx/onnx_1.16.1.bb | 107 ++++++++++++++++++
> 2 files changed, 132 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_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_1.16.1.bb b/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
> new file mode 100644
> index 00000000..9624d061
> --- /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"
> +SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
> +
> +S = "${WORKDIR}/git"
> +
> +DEPENDS += "\
> + abseil-cpp \
> + protobuf \
> + protobuf-native \
> + python3-protobuf \
> + python3-protobuf-native \
> +"
> +
> +PYTHON_DEPENDS = "\
> + python3 \
Nitpick,
To have a consistency across the entire recipe,
I think it would be better to use PYTHON_PN (as done at PACKAGE_BEFORE_PN)
OR keep it static as python3 for all references
--
Chirag
> + 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 += "${PYTHON_PN}-${PN}"
> +FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
> +RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
> +
> +# Output library is unversioned
> +SOLIBS = ".so"
> +FILES_SOLIBSDEV = ""
> +
> +# TODO: ONNXConfig.cmake in package onnx-dev contains reference to TMPDIR
> +INSANE_SKIP:${PN}-dev = "buildpaths"
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX
2025-01-18 19:48 ` Chirag Shilwant
@ 2025-01-21 18:59 ` Andrew Davis
2025-01-21 19:25 ` Denys Dmytriyenko
2025-01-22 16:30 ` Ryan Eatmon
0 siblings, 2 replies; 16+ messages in thread
From: Andrew Davis @ 2025-01-21 18:59 UTC (permalink / raw)
To: Chirag Shilwant, meta-arago; +Cc: Denys Dmytriyenko, Ryan Eatmon
On 1/18/25 1:48 PM, Chirag Shilwant wrote:
> Hi Andrew,
>
> On 17/01/25 05:55, Andrew Davis wrote:
>> 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 ++++
>> .../recipes-framework/onnx/onnx_1.16.1.bb | 107 ++++++++++++++++++
>> 2 files changed, 132 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_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_1.16.1.bb b/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
>> new file mode 100644
>> index 00000000..9624d061
>> --- /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"
>> +SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
>> +
>> +S = "${WORKDIR}/git"
>> +
>> +DEPENDS += "\
>> + abseil-cpp \
>> + protobuf \
>> + protobuf-native \
>> + python3-protobuf \
>> + python3-protobuf-native \
>> +"
>> +
>> +PYTHON_DEPENDS = "\
>> + python3 \
>
>
>
> Nitpick,
>
> To have a consistency across the entire recipe,
> I think it would be better to use PYTHON_PN (as done at PACKAGE_BEFORE_PN)
> OR keep it static as python3 for all references
>
Good idea, seems most recipes just use "python3" and not PYTHON_PN, so I'll
switch to that. Better to be explicit on which python we need. (I just hope
we never have to deal with a python4 someday :D)
Andrew
>
> --
> Chirag
>
>
>
>> + 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 += "${PYTHON_PN}-${PN}"
>> +FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
>> +RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
>> +
>> +# Output library is unversioned
>> +SOLIBS = ".so"
>> +FILES_SOLIBSDEV = ""
>> +
>> +# TODO: ONNXConfig.cmake in package onnx-dev contains reference to TMPDIR
>> +INSANE_SKIP:${PN}-dev = "buildpaths"
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX
2025-01-21 18:59 ` Andrew Davis
@ 2025-01-21 19:25 ` Denys Dmytriyenko
2025-01-22 16:30 ` Ryan Eatmon
1 sibling, 0 replies; 16+ messages in thread
From: Denys Dmytriyenko @ 2025-01-21 19:25 UTC (permalink / raw)
To: afd; +Cc: Chirag Shilwant, meta-arago, Denys Dmytriyenko, Ryan Eatmon
On Tue, Jan 21, 2025 at 12:59:59PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> On 1/18/25 1:48 PM, Chirag Shilwant wrote:
> >Hi Andrew,
> >
> >On 17/01/25 05:55, Andrew Davis wrote:
> >>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 ++++
> >> .../recipes-framework/onnx/onnx_1.16.1.bb | 107 ++++++++++++++++++
> >> 2 files changed, 132 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_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_1.16.1.bb b/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
> >>new file mode 100644
> >>index 00000000..9624d061
> >>--- /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"
> >>+SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
> >>+
> >>+S = "${WORKDIR}/git"
> >>+
> >>+DEPENDS += "\
> >>+ abseil-cpp \
> >>+ protobuf \
> >>+ protobuf-native \
> >>+ python3-protobuf \
> >>+ python3-protobuf-native \
> >>+"
> >>+
> >>+PYTHON_DEPENDS = "\
> >>+ python3 \
> >
> >
> >
> >Nitpick,
> >
> >To have a consistency across the entire recipe,
> >I think it would be better to use PYTHON_PN (as done at PACKAGE_BEFORE_PN)
> >OR keep it static as python3 for all references
> >
>
> Good idea, seems most recipes just use "python3" and not PYTHON_PN, so I'll
> switch to that. Better to be explicit on which python we need. (I just hope
> we never have to deal with a python4 someday :D)
Heh, you never know. We've dealt with python2/python3 and needing to support
both, as well as Qt3/Qt4/Qt5 (and Qt6 now), and gstreamer 0.10 vs. 1.0...
> >
> >>+ 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 += "${PYTHON_PN}-${PN}"
> >>+FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
> >>+RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
> >>+
> >>+# Output library is unversioned
> >>+SOLIBS = ".so"
> >>+FILES_SOLIBSDEV = ""
> >>+
> >>+# TODO: ONNXConfig.cmake in package onnx-dev contains reference to TMPDIR
> >>+INSANE_SKIP:${PN}-dev = "buildpaths"
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX
2025-01-21 18:59 ` Andrew Davis
2025-01-21 19:25 ` Denys Dmytriyenko
@ 2025-01-22 16:30 ` Ryan Eatmon
2025-01-24 21:14 ` Andrew Davis
1 sibling, 1 reply; 16+ messages in thread
From: Ryan Eatmon @ 2025-01-22 16:30 UTC (permalink / raw)
To: Andrew Davis, Chirag Shilwant, meta-arago; +Cc: Denys Dmytriyenko
On 1/21/2025 12:59 PM, Andrew Davis wrote:
> On 1/18/25 1:48 PM, Chirag Shilwant wrote:
>> Hi Andrew,
>>
>> On 17/01/25 05:55, Andrew Davis wrote:
>>> 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 ++++
>>> .../recipes-framework/onnx/onnx_1.16.1.bb | 107 ++++++++++++++++++
>>> 2 files changed, 132 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_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_1.16.1.bb
>>> b/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
>>> new file mode 100644
>>> index 00000000..9624d061
>>> --- /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"
>>> +SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
>>> +
>>> +S = "${WORKDIR}/git"
>>> +
>>> +DEPENDS += "\
>>> + abseil-cpp \
>>> + protobuf \
>>> + protobuf-native \
>>> + python3-protobuf \
>>> + python3-protobuf-native \
>>> +"
>>> +
>>> +PYTHON_DEPENDS = "\
>>> + python3 \
>>
>>
>>
>> Nitpick,
>>
>> To have a consistency across the entire recipe,
>> I think it would be better to use PYTHON_PN (as done at
>> PACKAGE_BEFORE_PN)
>> OR keep it static as python3 for all references
>>
>
> Good idea, seems most recipes just use "python3" and not PYTHON_PN, so I'll
> switch to that. Better to be explicit on which python we need. (I just hope
> we never have to deal with a python4 someday :D)
>
> Andrew
Does this mean a v2 is coming for this series? I'm getting a little
lost since you keep sending some of the same patches under new series
names... I'll wait to process all of these until we get the v2.
>>
>> --
>> Chirag
>>
>>
>>
>>> + 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 += "${PYTHON_PN}-${PN}"
>>> +FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
>>> +RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
>>> +
>>> +# Output library is unversioned
>>> +SOLIBS = ".so"
>>> +FILES_SOLIBSDEV = ""
>>> +
>>> +# TODO: ONNXConfig.cmake in package onnx-dev contains reference to
>>> TMPDIR
>>> +INSANE_SKIP:${PN}-dev = "buildpaths"
--
Ryan Eatmon reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc. - LCPD - MGTS
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master Andrew Davis
@ 2025-01-22 23:02 ` Denys Dmytriyenko
2025-01-23 15:49 ` Andrew Davis
0 siblings, 1 reply; 16+ messages in thread
From: Denys Dmytriyenko @ 2025-01-22 23:02 UTC (permalink / raw)
To: afd; +Cc: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago
On Thu, Jan 16, 2025 at 06:25:18PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> ONNX and ONNX Runtime depend on a very specific version of Abseil that
> is not the version included with meta-oe scarthgap. But it just so
> happens to be the version provided in current meta-oe master.
> Backport this version for our use in scarthgap.
>
> This patch is not needed for meta-arago master branch. If meta-oe
> master at some point moves to a newer incompatible version of
> Abseil we will deal with this dependency in a different way.
Just a note here - there's an effort to improve meta-arago-* layers quality
and eventually seek a Yocto Project Compatible status for them. Adding a
version of a recipe that exists upstream is possible, but requires some extra
attention, especially when it's a newer version and gets preferred by BitBake
automatically. One way to do it is to lower its default preference with
DEFAULT_PREFERENCE = "-1" and then set a corresponding PREFERRED_VERSION in
the distro conf...
> Signed-off-by: Andrew Davis <afd@ti.com>
> ---
> .../0001-absl-always-use-asm-sgidefs.h.patch | 38 +++++++
> ...e-maes-option-from-cross-compilation.patch | 38 +++++++
> ...e-neon-option-from-cross-compilation.patch | 49 +++++++++
> .../abseil-cpp/0004-abseil-ppc-fixes.patch | 103 ++++++++++++++++++
> ...-virtual-dtor-in-the-flags-are-neede.patch | 30 +++++
> .../abseil-cpp/abseil-cpp_20240722.0.bb | 54 +++++++++
> 6 files changed, 312 insertions(+)
> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
>
> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
> new file mode 100644
> index 00000000..6fecf256
> --- /dev/null
> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
> @@ -0,0 +1,38 @@
> +From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Thu, 9 Apr 2020 13:06:27 -0700
> +Subject: [PATCH] absl: always use <asm/sgidefs.h>
> +
> +Fixes mips/musl build, since sgidefs.h is not present on all C libraries
> +but on linux asm/sgidefs.h is there and contains same definitions, using
> +that makes it portable.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +---
> + absl/base/internal/direct_mmap.h | 6 +-----
> + 1 file changed, 1 insertion(+), 5 deletions(-)
> +
> +diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
> +index 1beb2ee4..140b0697 100644
> +--- a/absl/base/internal/direct_mmap.h
> ++++ b/absl/base/internal/direct_mmap.h
> +@@ -41,13 +41,9 @@
> +
> + #ifdef __mips__
> + // Include definitions of the ABI currently in use.
> +-#if defined(__BIONIC__) || !defined(__GLIBC__)
> +-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
> ++// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
> + // definitions we need.
> + #include <asm/sgidefs.h>
> +-#else
> +-#include <sgidefs.h>
> +-#endif // __BIONIC__ || !__GLIBC__
> + #endif // __mips__
> +
> + // SYS_mmap and SYS_munmap are not defined in Android.
> +--
> +2.25.1
> +
> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
> new file mode 100644
> index 00000000..d49e860f
> --- /dev/null
> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
> @@ -0,0 +1,38 @@
> +From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
> +From: Sinan Kaya <sinan.kaya@microsoft.com>
> +Date: Mon, 3 Feb 2020 03:25:57 +0000
> +Subject: [PATCH] Remove maes option from cross-compilation
> +
> +Upstream-Status: Pending
> +---
> + absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
> + absl/copts/GENERATED_copts.bzl | 4 ----
> + 2 files changed, 8 deletions(-)
> +
> +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
> +index da2282fe..5e0e8dfd 100644
> +--- a/absl/copts/GENERATED_AbseilCopts.cmake
> ++++ b/absl/copts/GENERATED_AbseilCopts.cmake
> +@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
> + list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
> + )
> +
> +-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
> +- "-maes"
> +- "-msse4.1"
> +-)
> +diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
> +index b9e0071e..0072008c 100644
> +--- a/absl/copts/GENERATED_copts.bzl
> ++++ b/absl/copts/GENERATED_copts.bzl
> +@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
> + ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
> + ]
> +
> +-ABSL_RANDOM_HWAES_X64_FLAGS = [
> +- "-maes",
> +- "-msse4.1",
> +-]
> +--
> +2.25.1
> +
> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
> new file mode 100644
> index 00000000..c82b9e1b
> --- /dev/null
> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
> @@ -0,0 +1,49 @@
> +From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001
> +From: Jonas Gorski <jonas.gorski@bisdn.de>
> +Date: Thu, 16 Jun 2022 11:46:31 +0000
> +Subject: [PATCH] Remove neon option from cross compilation
> +
> +Not every arm platform supports neon instructions, so do not enforce
> +them.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
> +---
> + absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
> + absl/copts/GENERATED_copts.bzl | 4 ----
> + 2 files changed, 8 deletions(-)
> +
> +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
> +index 5e0e8dfd..57cfc4d3 100644
> +--- a/absl/copts/GENERATED_AbseilCopts.cmake
> ++++ b/absl/copts/GENERATED_AbseilCopts.cmake
> +@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
> + "/DNOMINMAX"
> + )
> +
> +-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
> +- "-mfpu=neon"
> +-)
> +-
> + list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
> + "-march=armv8-a+crypto"
> + )
> +diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
> +index 0072008c..72840fda 100644
> +--- a/absl/copts/GENERATED_copts.bzl
> ++++ b/absl/copts/GENERATED_copts.bzl
> +@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [
> + "/DNOMINMAX",
> + ]
> +
> +-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
> +- "-mfpu=neon",
> +-]
> +-
> + ABSL_RANDOM_HWAES_ARM64_FLAGS = [
> + "-march=armv8-a+crypto",
> + ]
> +--
> +2.25.1
> +
> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
> new file mode 100644
> index 00000000..ba0cd669
> --- /dev/null
> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
> @@ -0,0 +1,103 @@
> +From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Sat, 21 Sep 2024 20:53:06 +0800
> +Subject: [PATCH] abseil: ppc fixes
> +
> +An all-in-one patch that fixes several issues:
> +
> +1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
> +2) powerpc stacktrace implementation only works on glibc (disabled on musl)
> +3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
> +4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
> +
> +Sourced from void linux
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +---
> + absl/base/internal/unscaledcycleclock.cc | 4 ++--
> + absl/base/internal/unscaledcycleclock_config.h | 3 ++-
> + absl/debugging/internal/examine_stack.cc | 8 +++++++-
> + absl/debugging/internal/stacktrace_config.h | 2 +-
> + 4 files changed, 12 insertions(+), 5 deletions(-)
> +
> +diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc
> +index a0bf3a65..103b4f6a 100644
> +--- a/absl/base/internal/unscaledcycleclock.cc
> ++++ b/absl/base/internal/unscaledcycleclock.cc
> +@@ -20,7 +20,7 @@
> + #include <intrin.h>
> + #endif
> +
> +-#if defined(__powerpc__) || defined(__ppc__)
> ++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
> + #ifdef __GLIBC__
> + #include <sys/platform/ppc.h>
> + #elif defined(__FreeBSD__)
> +@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
> + return base_internal::NominalCPUFrequency();
> + }
> +
> +-#elif defined(__powerpc__) || defined(__ppc__)
> ++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
> +
> + int64_t UnscaledCycleClock::Now() {
> + #ifdef __GLIBC__
> +diff --git a/absl/base/internal/unscaledcycleclock_config.h b/absl/base/internal/unscaledcycleclock_config.h
> +index 43a3dabe..196a8535 100644
> +--- a/absl/base/internal/unscaledcycleclock_config.h
> ++++ b/absl/base/internal/unscaledcycleclock_config.h
> +@@ -21,7 +21,8 @@
> +
> + // The following platforms have an implementation of a hardware counter.
> + #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
> +- defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) || \
> ++ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
> ++ defined(_M_IX86) || \
> + (defined(_M_X64) && !defined(_M_ARM64EC))
> + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
> + #else
> +diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
> +index 3dd6ba1a..f923b055 100644
> +--- a/absl/debugging/internal/examine_stack.cc
> ++++ b/absl/debugging/internal/examine_stack.cc
> +@@ -36,6 +36,10 @@
> + #include <csignal>
> + #include <cstdio>
> +
> ++#if defined(__powerpc__)
> ++#include <asm/ptrace.h>
> ++#endif
> ++
> + #include "absl/base/attributes.h"
> + #include "absl/base/internal/raw_logging.h"
> + #include "absl/base/macros.h"
> +@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) {
> + return reinterpret_cast<void*>(context->uc_mcontext.pc);
> + #elif defined(__powerpc64__)
> + return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
> +-#elif defined(__powerpc__)
> ++#elif defined(__powerpc__) && defined(__GLIBC__)
> + return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
> ++#elif defined(__powerpc__)
> ++ return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
> + #elif defined(__riscv)
> + return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
> + #elif defined(__s390__) && !defined(__s390x__)
> +diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h
> +index 3929b1b7..23d5e504 100644
> +--- a/absl/debugging/internal/stacktrace_config.h
> ++++ b/absl/debugging/internal/stacktrace_config.h
> +@@ -60,7 +60,7 @@
> + #elif defined(__i386__) || defined(__x86_64__)
> + #define ABSL_STACKTRACE_INL_HEADER \
> + "absl/debugging/internal/stacktrace_x86-inl.inc"
> +-#elif defined(__ppc__) || defined(__PPC__)
> ++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
> + #define ABSL_STACKTRACE_INL_HEADER \
> + "absl/debugging/internal/stacktrace_powerpc-inl.inc"
> + #elif defined(__aarch64__)
> +--
> +2.25.1
> +
> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
> new file mode 100644
> index 00000000..9a4fc0b4
> --- /dev/null
> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
> @@ -0,0 +1,30 @@
> +From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
> +From: Derek Mauro <dmauro@google.com>
> +Date: Mon, 5 Aug 2024 07:35:05 -0700
> +Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to
> + suppress warnings in headers". It should fall through to the "don't impose
> + our warnings on others" case. Do this by matching on "-Wno-*" instead of
> + "-Wno*".
> +
> +Fixes #1737
> +
> +PiperOrigin-RevId: 659548798
> +Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
> +Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
> +---
> + CMake/AbseilHelpers.cmake | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
> +index b177e590..3c4c92fe 100644
> +--- a/CMake/AbseilHelpers.cmake
> ++++ b/CMake/AbseilHelpers.cmake
> +@@ -195,7 +195,7 @@ function(absl_cc_library)
> + # specified platform. Filter both of them out before the successor
> + # reaches the "^-m" filter.
> + set(skip_next_cflag ON)
> +- elseif(${cflag} MATCHES "^(-Wno|/wd)")
> ++ elseif(${cflag} MATCHES "^(-Wno-|/wd)")
> + # These flags are needed to suppress warnings that might fire in our headers.
> + set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
> + elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
> new file mode 100644
> index 00000000..4bfc2100
> --- /dev/null
> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
> @@ -0,0 +1,54 @@
> +SUMMARY = "Abseil is a cpp library like STL"
> +DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
> +additional useful libraries like algorithm, container, debugging, hash, memory, \
> +meta, numeric, strings, synchronization, time, types and utility."
> +HOMEPAGE = "https://abseil.io/"
> +SECTION = "libs"
> +LICENSE = "Apache-2.0"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
> +
> +SRCREV = "4447c7562e3bc702ade25105912dce503f0c4010"
> +BRANCH = "lts_2024_07_22"
> +SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
> + file://0001-absl-always-use-asm-sgidefs.h.patch \
> + file://0002-Remove-maes-option-from-cross-compilation.patch \
> + file://0003-Remove-neon-option-from-cross-compilation.patch \
> + file://0004-abseil-ppc-fixes.patch \
> + file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \
> + "
> +
> +S = "${WORKDIR}/git"
> +
> +inherit cmake
> +
> +EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
> + -DBUILD_TESTING=OFF \
> + -DABSL_ENABLE_INSTALL=ON \
> + "
> +
> +SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
> +
> +PACKAGES_DYNAMIC += "^libabsl-*"
> +PACKAGES_DYNAMIC:class-native = ""
> +
> +PACKAGESPLITFUNCS =+ "split_dynamic_packages"
> +
> +python split_dynamic_packages() {
> + libdir = d.getVar('libdir')
> +
> + libpackages = do_split_packages(
> + d,
> + root=libdir,
> + file_regex=r'^libabsl_(.*)\.so\..*$',
> + output_pattern='libabsl-%s',
> + description="abseil shared library %s",
> + prepend=True,
> + extra_depends='',
> + )
> + if libpackages:
> + d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(libpackages))
> +}
> +
> +ALLOW_EMPTY:${PN} = "1"
> +
> +BBCLASSEXTEND = "native nativesdk"
> --
> 2.39.2
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master
2025-01-22 23:02 ` Denys Dmytriyenko
@ 2025-01-23 15:49 ` Andrew Davis
2025-01-23 15:56 ` Ryan Eatmon
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Davis @ 2025-01-23 15:49 UTC (permalink / raw)
To: Denys Dmytriyenko
Cc: Denys Dmytriyenko, Ryan Eatmon, Chirag Shilwant, meta-arago
On 1/22/25 5:02 PM, Denys Dmytriyenko wrote:
> On Thu, Jan 16, 2025 at 06:25:18PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
>> ONNX and ONNX Runtime depend on a very specific version of Abseil that
>> is not the version included with meta-oe scarthgap. But it just so
>> happens to be the version provided in current meta-oe master.
>> Backport this version for our use in scarthgap.
>>
>> This patch is not needed for meta-arago master branch. If meta-oe
>> master at some point moves to a newer incompatible version of
>> Abseil we will deal with this dependency in a different way.
>
> Just a note here - there's an effort to improve meta-arago-* layers quality
> and eventually seek a Yocto Project Compatible status for them. Adding a
> version of a recipe that exists upstream is possible, but requires some extra
> attention, especially when it's a newer version and gets preferred by BitBake
> automatically. One way to do it is to lower its default preference with
> DEFAULT_PREFERENCE = "-1" and then set a corresponding PREFERRED_VERSION in
> the distro conf...
>
Good info, thanks, if I need to make a change like this going forward I'll do
it like that. (I'm assuming our scarthgap branch isn't going to be a candidate
for this Yocto Compat status, and this patch is only for scarthgap so no fix
needed for this patch?)
Andrew
>
>> Signed-off-by: Andrew Davis <afd@ti.com>
>> ---
>> .../0001-absl-always-use-asm-sgidefs.h.patch | 38 +++++++
>> ...e-maes-option-from-cross-compilation.patch | 38 +++++++
>> ...e-neon-option-from-cross-compilation.patch | 49 +++++++++
>> .../abseil-cpp/0004-abseil-ppc-fixes.patch | 103 ++++++++++++++++++
>> ...-virtual-dtor-in-the-flags-are-neede.patch | 30 +++++
>> .../abseil-cpp/abseil-cpp_20240722.0.bb | 54 +++++++++
>> 6 files changed, 312 insertions(+)
>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
>>
>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
>> new file mode 100644
>> index 00000000..6fecf256
>> --- /dev/null
>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
>> @@ -0,0 +1,38 @@
>> +From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
>> +From: Khem Raj <raj.khem@gmail.com>
>> +Date: Thu, 9 Apr 2020 13:06:27 -0700
>> +Subject: [PATCH] absl: always use <asm/sgidefs.h>
>> +
>> +Fixes mips/musl build, since sgidefs.h is not present on all C libraries
>> +but on linux asm/sgidefs.h is there and contains same definitions, using
>> +that makes it portable.
>> +
>> +Upstream-Status: Pending
>> +
>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> +---
>> + absl/base/internal/direct_mmap.h | 6 +-----
>> + 1 file changed, 1 insertion(+), 5 deletions(-)
>> +
>> +diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
>> +index 1beb2ee4..140b0697 100644
>> +--- a/absl/base/internal/direct_mmap.h
>> ++++ b/absl/base/internal/direct_mmap.h
>> +@@ -41,13 +41,9 @@
>> +
>> + #ifdef __mips__
>> + // Include definitions of the ABI currently in use.
>> +-#if defined(__BIONIC__) || !defined(__GLIBC__)
>> +-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
>> ++// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
>> + // definitions we need.
>> + #include <asm/sgidefs.h>
>> +-#else
>> +-#include <sgidefs.h>
>> +-#endif // __BIONIC__ || !__GLIBC__
>> + #endif // __mips__
>> +
>> + // SYS_mmap and SYS_munmap are not defined in Android.
>> +--
>> +2.25.1
>> +
>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
>> new file mode 100644
>> index 00000000..d49e860f
>> --- /dev/null
>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
>> @@ -0,0 +1,38 @@
>> +From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
>> +From: Sinan Kaya <sinan.kaya@microsoft.com>
>> +Date: Mon, 3 Feb 2020 03:25:57 +0000
>> +Subject: [PATCH] Remove maes option from cross-compilation
>> +
>> +Upstream-Status: Pending
>> +---
>> + absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
>> + absl/copts/GENERATED_copts.bzl | 4 ----
>> + 2 files changed, 8 deletions(-)
>> +
>> +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
>> +index da2282fe..5e0e8dfd 100644
>> +--- a/absl/copts/GENERATED_AbseilCopts.cmake
>> ++++ b/absl/copts/GENERATED_AbseilCopts.cmake
>> +@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
>> + list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
>> + )
>> +
>> +-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
>> +- "-maes"
>> +- "-msse4.1"
>> +-)
>> +diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
>> +index b9e0071e..0072008c 100644
>> +--- a/absl/copts/GENERATED_copts.bzl
>> ++++ b/absl/copts/GENERATED_copts.bzl
>> +@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
>> + ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
>> + ]
>> +
>> +-ABSL_RANDOM_HWAES_X64_FLAGS = [
>> +- "-maes",
>> +- "-msse4.1",
>> +-]
>> +--
>> +2.25.1
>> +
>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
>> new file mode 100644
>> index 00000000..c82b9e1b
>> --- /dev/null
>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
>> @@ -0,0 +1,49 @@
>> +From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001
>> +From: Jonas Gorski <jonas.gorski@bisdn.de>
>> +Date: Thu, 16 Jun 2022 11:46:31 +0000
>> +Subject: [PATCH] Remove neon option from cross compilation
>> +
>> +Not every arm platform supports neon instructions, so do not enforce
>> +them.
>> +
>> +Upstream-Status: Pending
>> +
>> +Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
>> +---
>> + absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
>> + absl/copts/GENERATED_copts.bzl | 4 ----
>> + 2 files changed, 8 deletions(-)
>> +
>> +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
>> +index 5e0e8dfd..57cfc4d3 100644
>> +--- a/absl/copts/GENERATED_AbseilCopts.cmake
>> ++++ b/absl/copts/GENERATED_AbseilCopts.cmake
>> +@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
>> + "/DNOMINMAX"
>> + )
>> +
>> +-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
>> +- "-mfpu=neon"
>> +-)
>> +-
>> + list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
>> + "-march=armv8-a+crypto"
>> + )
>> +diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
>> +index 0072008c..72840fda 100644
>> +--- a/absl/copts/GENERATED_copts.bzl
>> ++++ b/absl/copts/GENERATED_copts.bzl
>> +@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [
>> + "/DNOMINMAX",
>> + ]
>> +
>> +-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
>> +- "-mfpu=neon",
>> +-]
>> +-
>> + ABSL_RANDOM_HWAES_ARM64_FLAGS = [
>> + "-march=armv8-a+crypto",
>> + ]
>> +--
>> +2.25.1
>> +
>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
>> new file mode 100644
>> index 00000000..ba0cd669
>> --- /dev/null
>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
>> @@ -0,0 +1,103 @@
>> +From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001
>> +From: Khem Raj <raj.khem@gmail.com>
>> +Date: Sat, 21 Sep 2024 20:53:06 +0800
>> +Subject: [PATCH] abseil: ppc fixes
>> +
>> +An all-in-one patch that fixes several issues:
>> +
>> +1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
>> +2) powerpc stacktrace implementation only works on glibc (disabled on musl)
>> +3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
>> +4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
>> +
>> +Sourced from void linux
>> +
>> +Upstream-Status: Pending
>> +
>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> +---
>> + absl/base/internal/unscaledcycleclock.cc | 4 ++--
>> + absl/base/internal/unscaledcycleclock_config.h | 3 ++-
>> + absl/debugging/internal/examine_stack.cc | 8 +++++++-
>> + absl/debugging/internal/stacktrace_config.h | 2 +-
>> + 4 files changed, 12 insertions(+), 5 deletions(-)
>> +
>> +diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc
>> +index a0bf3a65..103b4f6a 100644
>> +--- a/absl/base/internal/unscaledcycleclock.cc
>> ++++ b/absl/base/internal/unscaledcycleclock.cc
>> +@@ -20,7 +20,7 @@
>> + #include <intrin.h>
>> + #endif
>> +
>> +-#if defined(__powerpc__) || defined(__ppc__)
>> ++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
>> + #ifdef __GLIBC__
>> + #include <sys/platform/ppc.h>
>> + #elif defined(__FreeBSD__)
>> +@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
>> + return base_internal::NominalCPUFrequency();
>> + }
>> +
>> +-#elif defined(__powerpc__) || defined(__ppc__)
>> ++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
>> +
>> + int64_t UnscaledCycleClock::Now() {
>> + #ifdef __GLIBC__
>> +diff --git a/absl/base/internal/unscaledcycleclock_config.h b/absl/base/internal/unscaledcycleclock_config.h
>> +index 43a3dabe..196a8535 100644
>> +--- a/absl/base/internal/unscaledcycleclock_config.h
>> ++++ b/absl/base/internal/unscaledcycleclock_config.h
>> +@@ -21,7 +21,8 @@
>> +
>> + // The following platforms have an implementation of a hardware counter.
>> + #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
>> +- defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) || \
>> ++ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
>> ++ defined(_M_IX86) || \
>> + (defined(_M_X64) && !defined(_M_ARM64EC))
>> + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
>> + #else
>> +diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
>> +index 3dd6ba1a..f923b055 100644
>> +--- a/absl/debugging/internal/examine_stack.cc
>> ++++ b/absl/debugging/internal/examine_stack.cc
>> +@@ -36,6 +36,10 @@
>> + #include <csignal>
>> + #include <cstdio>
>> +
>> ++#if defined(__powerpc__)
>> ++#include <asm/ptrace.h>
>> ++#endif
>> ++
>> + #include "absl/base/attributes.h"
>> + #include "absl/base/internal/raw_logging.h"
>> + #include "absl/base/macros.h"
>> +@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) {
>> + return reinterpret_cast<void*>(context->uc_mcontext.pc);
>> + #elif defined(__powerpc64__)
>> + return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
>> +-#elif defined(__powerpc__)
>> ++#elif defined(__powerpc__) && defined(__GLIBC__)
>> + return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
>> ++#elif defined(__powerpc__)
>> ++ return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
>> + #elif defined(__riscv)
>> + return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
>> + #elif defined(__s390__) && !defined(__s390x__)
>> +diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h
>> +index 3929b1b7..23d5e504 100644
>> +--- a/absl/debugging/internal/stacktrace_config.h
>> ++++ b/absl/debugging/internal/stacktrace_config.h
>> +@@ -60,7 +60,7 @@
>> + #elif defined(__i386__) || defined(__x86_64__)
>> + #define ABSL_STACKTRACE_INL_HEADER \
>> + "absl/debugging/internal/stacktrace_x86-inl.inc"
>> +-#elif defined(__ppc__) || defined(__PPC__)
>> ++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
>> + #define ABSL_STACKTRACE_INL_HEADER \
>> + "absl/debugging/internal/stacktrace_powerpc-inl.inc"
>> + #elif defined(__aarch64__)
>> +--
>> +2.25.1
>> +
>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
>> new file mode 100644
>> index 00000000..9a4fc0b4
>> --- /dev/null
>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
>> @@ -0,0 +1,30 @@
>> +From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
>> +From: Derek Mauro <dmauro@google.com>
>> +Date: Mon, 5 Aug 2024 07:35:05 -0700
>> +Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to
>> + suppress warnings in headers". It should fall through to the "don't impose
>> + our warnings on others" case. Do this by matching on "-Wno-*" instead of
>> + "-Wno*".
>> +
>> +Fixes #1737
>> +
>> +PiperOrigin-RevId: 659548798
>> +Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
>> +Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
>> +---
>> + CMake/AbseilHelpers.cmake | 2 +-
>> + 1 file changed, 1 insertion(+), 1 deletion(-)
>> +
>> +diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
>> +index b177e590..3c4c92fe 100644
>> +--- a/CMake/AbseilHelpers.cmake
>> ++++ b/CMake/AbseilHelpers.cmake
>> +@@ -195,7 +195,7 @@ function(absl_cc_library)
>> + # specified platform. Filter both of them out before the successor
>> + # reaches the "^-m" filter.
>> + set(skip_next_cflag ON)
>> +- elseif(${cflag} MATCHES "^(-Wno|/wd)")
>> ++ elseif(${cflag} MATCHES "^(-Wno-|/wd)")
>> + # These flags are needed to suppress warnings that might fire in our headers.
>> + set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
>> + elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
>> new file mode 100644
>> index 00000000..4bfc2100
>> --- /dev/null
>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
>> @@ -0,0 +1,54 @@
>> +SUMMARY = "Abseil is a cpp library like STL"
>> +DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
>> +additional useful libraries like algorithm, container, debugging, hash, memory, \
>> +meta, numeric, strings, synchronization, time, types and utility."
>> +HOMEPAGE = "https://abseil.io/"
>> +SECTION = "libs"
>> +LICENSE = "Apache-2.0"
>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
>> +
>> +SRCREV = "4447c7562e3bc702ade25105912dce503f0c4010"
>> +BRANCH = "lts_2024_07_22"
>> +SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
>> + file://0001-absl-always-use-asm-sgidefs.h.patch \
>> + file://0002-Remove-maes-option-from-cross-compilation.patch \
>> + file://0003-Remove-neon-option-from-cross-compilation.patch \
>> + file://0004-abseil-ppc-fixes.patch \
>> + file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \
>> + "
>> +
>> +S = "${WORKDIR}/git"
>> +
>> +inherit cmake
>> +
>> +EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
>> + -DBUILD_TESTING=OFF \
>> + -DABSL_ENABLE_INSTALL=ON \
>> + "
>> +
>> +SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
>> +
>> +PACKAGES_DYNAMIC += "^libabsl-*"
>> +PACKAGES_DYNAMIC:class-native = ""
>> +
>> +PACKAGESPLITFUNCS =+ "split_dynamic_packages"
>> +
>> +python split_dynamic_packages() {
>> + libdir = d.getVar('libdir')
>> +
>> + libpackages = do_split_packages(
>> + d,
>> + root=libdir,
>> + file_regex=r'^libabsl_(.*)\.so\..*$',
>> + output_pattern='libabsl-%s',
>> + description="abseil shared library %s",
>> + prepend=True,
>> + extra_depends='',
>> + )
>> + if libpackages:
>> + d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(libpackages))
>> +}
>> +
>> +ALLOW_EMPTY:${PN} = "1"
>> +
>> +BBCLASSEXTEND = "native nativesdk"
>> --
>> 2.39.2
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master
2025-01-23 15:49 ` Andrew Davis
@ 2025-01-23 15:56 ` Ryan Eatmon
2025-01-23 16:28 ` Andrew Davis
0 siblings, 1 reply; 16+ messages in thread
From: Ryan Eatmon @ 2025-01-23 15:56 UTC (permalink / raw)
To: Andrew Davis, Denys Dmytriyenko
Cc: Denys Dmytriyenko, Chirag Shilwant, meta-arago
On 1/23/2025 9:49 AM, Andrew Davis wrote:
> On 1/22/25 5:02 PM, Denys Dmytriyenko wrote:
>> On Thu, Jan 16, 2025 at 06:25:18PM -0600, Andrew Davis via
>> lists.yoctoproject.org wrote:
>>> ONNX and ONNX Runtime depend on a very specific version of Abseil that
>>> is not the version included with meta-oe scarthgap. But it just so
>>> happens to be the version provided in current meta-oe master.
>>> Backport this version for our use in scarthgap.
>>>
>>> This patch is not needed for meta-arago master branch. If meta-oe
>>> master at some point moves to a newer incompatible version of
>>> Abseil we will deal with this dependency in a different way.
>>
>> Just a note here - there's an effort to improve meta-arago-* layers
>> quality
>> and eventually seek a Yocto Project Compatible status for them. Adding a
>> version of a recipe that exists upstream is possible, but requires
>> some extra
>> attention, especially when it's a newer version and gets preferred by
>> BitBake
>> automatically. One way to do it is to lower its default preference with
>> DEFAULT_PREFERENCE = "-1" and then set a corresponding
>> PREFERRED_VERSION in
>> the distro conf...
>>
>
> Good info, thanks, if I need to make a change like this going forward
> I'll do
> it like that. (I'm assuming our scarthgap branch isn't going to be a
> candidate
> for this Yocto Compat status, and this patch is only for scarthgap so no
> fix
> needed for this patch?)
The patch is labelled as being for master as well... Can we not mix the
scarthgap/master patches in a single series unless they truly should be
applied to both. It's really annoying to manually pick and choose which
patches to apply where.
> Andrew
>
>>
>>> Signed-off-by: Andrew Davis <afd@ti.com>
>>> ---
>>> .../0001-absl-always-use-asm-sgidefs.h.patch | 38 +++++++
>>> ...e-maes-option-from-cross-compilation.patch | 38 +++++++
>>> ...e-neon-option-from-cross-compilation.patch | 49 +++++++++
>>> .../abseil-cpp/0004-abseil-ppc-fixes.patch | 103 ++++++++++++++++++
>>> ...-virtual-dtor-in-the-flags-are-neede.patch | 30 +++++
>>> .../abseil-cpp/abseil-cpp_20240722.0.bb | 54 +++++++++
>>> 6 files changed, 312 insertions(+)
>>> create mode 100644
>>> meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
>>> create mode 100644
>>> meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
>>> create mode 100644
>>> meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
>>> create mode 100644
>>> meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
>>> create mode 100644
>>> meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
>>> create mode 100644
>>> meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
>>>
>>> diff --git
>>> a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
>>> new file mode 100644
>>> index 00000000..6fecf256
>>> --- /dev/null
>>> +++
>>> b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
>>> @@ -0,0 +1,38 @@
>>> +From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
>>> +From: Khem Raj <raj.khem@gmail.com>
>>> +Date: Thu, 9 Apr 2020 13:06:27 -0700
>>> +Subject: [PATCH] absl: always use <asm/sgidefs.h>
>>> +
>>> +Fixes mips/musl build, since sgidefs.h is not present on all C
>>> libraries
>>> +but on linux asm/sgidefs.h is there and contains same definitions,
>>> using
>>> +that makes it portable.
>>> +
>>> +Upstream-Status: Pending
>>> +
>>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> +---
>>> + absl/base/internal/direct_mmap.h | 6 +-----
>>> + 1 file changed, 1 insertion(+), 5 deletions(-)
>>> +
>>> +diff --git a/absl/base/internal/direct_mmap.h
>>> b/absl/base/internal/direct_mmap.h
>>> +index 1beb2ee4..140b0697 100644
>>> +--- a/absl/base/internal/direct_mmap.h
>>> ++++ b/absl/base/internal/direct_mmap.h
>>> +@@ -41,13 +41,9 @@
>>> +
>>> + #ifdef __mips__
>>> + // Include definitions of the ABI currently in use.
>>> +-#if defined(__BIONIC__) || !defined(__GLIBC__)
>>> +-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h,
>>> which has the
>>> ++// bionic/musl C libs don't have sgidefs.h, but do have
>>> asm/sgidefs.h, which has the
>>> + // definitions we need.
>>> + #include <asm/sgidefs.h>
>>> +-#else
>>> +-#include <sgidefs.h>
>>> +-#endif // __BIONIC__ || !__GLIBC__
>>> + #endif // __mips__
>>> +
>>> + // SYS_mmap and SYS_munmap are not defined in Android.
>>> +--
>>> +2.25.1
>>> +
>>> diff --git
>>> a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
>>> new file mode 100644
>>> index 00000000..d49e860f
>>> --- /dev/null
>>> +++
>>> b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
>>> @@ -0,0 +1,38 @@
>>> +From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
>>> +From: Sinan Kaya <sinan.kaya@microsoft.com>
>>> +Date: Mon, 3 Feb 2020 03:25:57 +0000
>>> +Subject: [PATCH] Remove maes option from cross-compilation
>>> +
>>> +Upstream-Status: Pending
>>> +---
>>> + absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
>>> + absl/copts/GENERATED_copts.bzl | 4 ----
>>> + 2 files changed, 8 deletions(-)
>>> +
>>> +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake
>>> b/absl/copts/GENERATED_AbseilCopts.cmake
>>> +index da2282fe..5e0e8dfd 100644
>>> +--- a/absl/copts/GENERATED_AbseilCopts.cmake
>>> ++++ b/absl/copts/GENERATED_AbseilCopts.cmake
>>> +@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
>>> + list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
>>> + )
>>> +
>>> +-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
>>> +- "-maes"
>>> +- "-msse4.1"
>>> +-)
>>> +diff --git a/absl/copts/GENERATED_copts.bzl
>>> b/absl/copts/GENERATED_copts.bzl
>>> +index b9e0071e..0072008c 100644
>>> +--- a/absl/copts/GENERATED_copts.bzl
>>> ++++ b/absl/copts/GENERATED_copts.bzl
>>> +@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
>>> + ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
>>> + ]
>>> +
>>> +-ABSL_RANDOM_HWAES_X64_FLAGS = [
>>> +- "-maes",
>>> +- "-msse4.1",
>>> +-]
>>> +--
>>> +2.25.1
>>> +
>>> diff --git
>>> a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
>>> new file mode 100644
>>> index 00000000..c82b9e1b
>>> --- /dev/null
>>> +++
>>> b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
>>> @@ -0,0 +1,49 @@
>>> +From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001
>>> +From: Jonas Gorski <jonas.gorski@bisdn.de>
>>> +Date: Thu, 16 Jun 2022 11:46:31 +0000
>>> +Subject: [PATCH] Remove neon option from cross compilation
>>> +
>>> +Not every arm platform supports neon instructions, so do not enforce
>>> +them.
>>> +
>>> +Upstream-Status: Pending
>>> +
>>> +Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
>>> +---
>>> + absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
>>> + absl/copts/GENERATED_copts.bzl | 4 ----
>>> + 2 files changed, 8 deletions(-)
>>> +
>>> +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake
>>> b/absl/copts/GENERATED_AbseilCopts.cmake
>>> +index 5e0e8dfd..57cfc4d3 100644
>>> +--- a/absl/copts/GENERATED_AbseilCopts.cmake
>>> ++++ b/absl/copts/GENERATED_AbseilCopts.cmake
>>> +@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
>>> + "/DNOMINMAX"
>>> + )
>>> +
>>> +-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
>>> +- "-mfpu=neon"
>>> +-)
>>> +-
>>> + list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
>>> + "-march=armv8-a+crypto"
>>> + )
>>> +diff --git a/absl/copts/GENERATED_copts.bzl
>>> b/absl/copts/GENERATED_copts.bzl
>>> +index 0072008c..72840fda 100644
>>> +--- a/absl/copts/GENERATED_copts.bzl
>>> ++++ b/absl/copts/GENERATED_copts.bzl
>>> +@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [
>>> + "/DNOMINMAX",
>>> + ]
>>> +
>>> +-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
>>> +- "-mfpu=neon",
>>> +-]
>>> +-
>>> + ABSL_RANDOM_HWAES_ARM64_FLAGS = [
>>> + "-march=armv8-a+crypto",
>>> + ]
>>> +--
>>> +2.25.1
>>> +
>>> diff --git
>>> a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
>>> new file mode 100644
>>> index 00000000..ba0cd669
>>> --- /dev/null
>>> +++
>>> b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
>>> @@ -0,0 +1,103 @@
>>> +From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001
>>> +From: Khem Raj <raj.khem@gmail.com>
>>> +Date: Sat, 21 Sep 2024 20:53:06 +0800
>>> +Subject: [PATCH] abseil: ppc fixes
>>> +
>>> +An all-in-one patch that fixes several issues:
>>> +
>>> +1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled
>>> on musl)
>>> +2) powerpc stacktrace implementation only works on glibc (disabled
>>> on musl)
>>> +3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
>>> +4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
>>> +
>>> +Sourced from void linux
>>> +
>>> +Upstream-Status: Pending
>>> +
>>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> +---
>>> + absl/base/internal/unscaledcycleclock.cc | 4 ++--
>>> + absl/base/internal/unscaledcycleclock_config.h | 3 ++-
>>> + absl/debugging/internal/examine_stack.cc | 8 +++++++-
>>> + absl/debugging/internal/stacktrace_config.h | 2 +-
>>> + 4 files changed, 12 insertions(+), 5 deletions(-)
>>> +
>>> +diff --git a/absl/base/internal/unscaledcycleclock.cc
>>> b/absl/base/internal/unscaledcycleclock.cc
>>> +index a0bf3a65..103b4f6a 100644
>>> +--- a/absl/base/internal/unscaledcycleclock.cc
>>> ++++ b/absl/base/internal/unscaledcycleclock.cc
>>> +@@ -20,7 +20,7 @@
>>> + #include <intrin.h>
>>> + #endif
>>> +
>>> +-#if defined(__powerpc__) || defined(__ppc__)
>>> ++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
>>> + #ifdef __GLIBC__
>>> + #include <sys/platform/ppc.h>
>>> + #elif defined(__FreeBSD__)
>>> +@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
>>> + return base_internal::NominalCPUFrequency();
>>> + }
>>> +
>>> +-#elif defined(__powerpc__) || defined(__ppc__)
>>> ++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
>>> +
>>> + int64_t UnscaledCycleClock::Now() {
>>> + #ifdef __GLIBC__
>>> +diff --git a/absl/base/internal/unscaledcycleclock_config.h
>>> b/absl/base/internal/unscaledcycleclock_config.h
>>> +index 43a3dabe..196a8535 100644
>>> +--- a/absl/base/internal/unscaledcycleclock_config.h
>>> ++++ b/absl/base/internal/unscaledcycleclock_config.h
>>> +@@ -21,7 +21,8 @@
>>> +
>>> + // The following platforms have an implementation of a hardware
>>> counter.
>>> + #if defined(__i386__) || defined(__x86_64__) ||
>>> defined(__aarch64__) || \
>>> +- defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86)
>>> || \
>>> ++ ((defined(__powerpc__) || defined(__ppc__)) &&
>>> defined(__GLIBC__)) || \
>>> ++ defined(_M_IX86) || \
>>> + (defined(_M_X64) && !defined(_M_ARM64EC))
>>> + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
>>> + #else
>>> +diff --git a/absl/debugging/internal/examine_stack.cc
>>> b/absl/debugging/internal/examine_stack.cc
>>> +index 3dd6ba1a..f923b055 100644
>>> +--- a/absl/debugging/internal/examine_stack.cc
>>> ++++ b/absl/debugging/internal/examine_stack.cc
>>> +@@ -36,6 +36,10 @@
>>> + #include <csignal>
>>> + #include <cstdio>
>>> +
>>> ++#if defined(__powerpc__)
>>> ++#include <asm/ptrace.h>
>>> ++#endif
>>> ++
>>> + #include "absl/base/attributes.h"
>>> + #include "absl/base/internal/raw_logging.h"
>>> + #include "absl/base/macros.h"
>>> +@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) {
>>> + return reinterpret_cast<void*>(context->uc_mcontext.pc);
>>> + #elif defined(__powerpc64__)
>>> + return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
>>> +-#elif defined(__powerpc__)
>>> ++#elif defined(__powerpc__) && defined(__GLIBC__)
>>> + return
>>> reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
>>> ++#elif defined(__powerpc__)
>>> ++ return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
>>> + #elif defined(__riscv)
>>> + return
>>> reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
>>> + #elif defined(__s390__) && !defined(__s390x__)
>>> +diff --git a/absl/debugging/internal/stacktrace_config.h
>>> b/absl/debugging/internal/stacktrace_config.h
>>> +index 3929b1b7..23d5e504 100644
>>> +--- a/absl/debugging/internal/stacktrace_config.h
>>> ++++ b/absl/debugging/internal/stacktrace_config.h
>>> +@@ -60,7 +60,7 @@
>>> + #elif defined(__i386__) || defined(__x86_64__)
>>> + #define ABSL_STACKTRACE_INL_HEADER \
>>> + "absl/debugging/internal/stacktrace_x86-inl.inc"
>>> +-#elif defined(__ppc__) || defined(__PPC__)
>>> ++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
>>> + #define ABSL_STACKTRACE_INL_HEADER \
>>> + "absl/debugging/internal/stacktrace_powerpc-inl.inc"
>>> + #elif defined(__aarch64__)
>>> +--
>>> +2.25.1
>>> +
>>> diff --git
>>> a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
>>> new file mode 100644
>>> index 00000000..9a4fc0b4
>>> --- /dev/null
>>> +++
>>> b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
>>> @@ -0,0 +1,30 @@
>>> +From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
>>> +From: Derek Mauro <dmauro@google.com>
>>> +Date: Mon, 5 Aug 2024 07:35:05 -0700
>>> +Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are
>>> needed to
>>> + suppress warnings in headers". It should fall through to the "don't
>>> impose
>>> + our warnings on others" case. Do this by matching on "-Wno-*"
>>> instead of
>>> + "-Wno*".
>>> +
>>> +Fixes #1737
>>> +
>>> +PiperOrigin-RevId: 659548798
>>> +Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
>>> +Upstream-Status: Backport
>>> [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
>>> +---
>>> + CMake/AbseilHelpers.cmake | 2 +-
>>> + 1 file changed, 1 insertion(+), 1 deletion(-)
>>> +
>>> +diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
>>> +index b177e590..3c4c92fe 100644
>>> +--- a/CMake/AbseilHelpers.cmake
>>> ++++ b/CMake/AbseilHelpers.cmake
>>> +@@ -195,7 +195,7 @@ function(absl_cc_library)
>>> + # specified platform. Filter both of them out before the
>>> successor
>>> + # reaches the "^-m" filter.
>>> + set(skip_next_cflag ON)
>>> +- elseif(${cflag} MATCHES "^(-Wno|/wd)")
>>> ++ elseif(${cflag} MATCHES "^(-Wno-|/wd)")
>>> + # These flags are needed to suppress warnings that might
>>> fire in our headers.
>>> + set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
>>> + elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
>>> diff --git
>>> a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
>>> new file mode 100644
>>> index 00000000..4bfc2100
>>> --- /dev/null
>>> +++
>>> b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
>>> @@ -0,0 +1,54 @@
>>> +SUMMARY = "Abseil is a cpp library like STL"
>>> +DESCRIPTION = "Abseil provides pieces missing from the C++ standard.
>>> Contains \
>>> +additional useful libraries like algorithm, container, debugging,
>>> hash, memory, \
>>> +meta, numeric, strings, synchronization, time, types and utility."
>>> +HOMEPAGE = "https://abseil.io/"
>>> +SECTION = "libs"
>>> +LICENSE = "Apache-2.0"
>>> +LIC_FILES_CHKSUM =
>>> "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
>>> +
>>> +SRCREV = "4447c7562e3bc702ade25105912dce503f0c4010"
>>> +BRANCH = "lts_2024_07_22"
>>> +SRC_URI =
>>> "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
>>> +
>>> file://0001-absl-always-use-asm-sgidefs.h.patch \
>>> +
>>> file://0002-Remove-maes-option-from-cross-compilation.patch \
>>> +
>>> file://0003-Remove-neon-option-from-cross-compilation.patch \
>>> + file://0004-abseil-ppc-fixes.patch \
>>> +
>>> file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \
>>> + "
>>> +
>>> +S = "${WORKDIR}/git"
>>> +
>>> +inherit cmake
>>> +
>>> +EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
>>> + -DBUILD_TESTING=OFF \
>>> + -DABSL_ENABLE_INSTALL=ON \
>>> + "
>>> +
>>> +SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
>>> +
>>> +PACKAGES_DYNAMIC += "^libabsl-*"
>>> +PACKAGES_DYNAMIC:class-native = ""
>>> +
>>> +PACKAGESPLITFUNCS =+ "split_dynamic_packages"
>>> +
>>> +python split_dynamic_packages() {
>>> + libdir = d.getVar('libdir')
>>> +
>>> + libpackages = do_split_packages(
>>> + d,
>>> + root=libdir,
>>> + file_regex=r'^libabsl_(.*)\.so\..*$',
>>> + output_pattern='libabsl-%s',
>>> + description="abseil shared library %s",
>>> + prepend=True,
>>> + extra_depends='',
>>> + )
>>> + if libpackages:
>>> + d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + '
>>> '.join(libpackages))
>>> +}
>>> +
>>> +ALLOW_EMPTY:${PN} = "1"
>>> +
>>> +BBCLASSEXTEND = "native nativesdk"
>>> --
>>> 2.39.2
--
Ryan Eatmon reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc. - LCPD - MGTS
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master
2025-01-23 15:56 ` Ryan Eatmon
@ 2025-01-23 16:28 ` Andrew Davis
0 siblings, 0 replies; 16+ messages in thread
From: Andrew Davis @ 2025-01-23 16:28 UTC (permalink / raw)
To: Ryan Eatmon, Denys Dmytriyenko
Cc: Denys Dmytriyenko, Chirag Shilwant, meta-arago
On 1/23/25 9:56 AM, Ryan Eatmon wrote:
>
>
> On 1/23/2025 9:49 AM, Andrew Davis wrote:
>> On 1/22/25 5:02 PM, Denys Dmytriyenko wrote:
>>> On Thu, Jan 16, 2025 at 06:25:18PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
>>>> ONNX and ONNX Runtime depend on a very specific version of Abseil that
>>>> is not the version included with meta-oe scarthgap. But it just so
>>>> happens to be the version provided in current meta-oe master.
>>>> Backport this version for our use in scarthgap.
>>>>
>>>> This patch is not needed for meta-arago master branch. If meta-oe
>>>> master at some point moves to a newer incompatible version of
>>>> Abseil we will deal with this dependency in a different way.
>>>
>>> Just a note here - there's an effort to improve meta-arago-* layers quality
>>> and eventually seek a Yocto Project Compatible status for them. Adding a
>>> version of a recipe that exists upstream is possible, but requires some extra
>>> attention, especially when it's a newer version and gets preferred by BitBake
>>> automatically. One way to do it is to lower its default preference with
>>> DEFAULT_PREFERENCE = "-1" and then set a corresponding PREFERRED_VERSION in
>>> the distro conf...
>>>
>>
>> Good info, thanks, if I need to make a change like this going forward I'll do
>> it like that. (I'm assuming our scarthgap branch isn't going to be a candidate
>> for this Yocto Compat status, and this patch is only for scarthgap so no fix
>> needed for this patch?)
>
> The patch is labelled as being for master as well... Can we not mix the scarthgap/master patches in a single series unless they truly should be applied to both. It's really annoying to manually pick and choose which patches to apply where.
>
Sorry about that, I'll split this one out from this series and send
it by itself for just scarthgap.
Andrew
>
>> Andrew
>>
>>>
>>>> Signed-off-by: Andrew Davis <afd@ti.com>
>>>> ---
>>>> .../0001-absl-always-use-asm-sgidefs.h.patch | 38 +++++++
>>>> ...e-maes-option-from-cross-compilation.patch | 38 +++++++
>>>> ...e-neon-option-from-cross-compilation.patch | 49 +++++++++
>>>> .../abseil-cpp/0004-abseil-ppc-fixes.patch | 103 ++++++++++++++++++
>>>> ...-virtual-dtor-in-the-flags-are-neede.patch | 30 +++++
>>>> .../abseil-cpp/abseil-cpp_20240722.0.bb | 54 +++++++++
>>>> 6 files changed, 312 insertions(+)
>>>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
>>>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
>>>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
>>>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
>>>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
>>>> create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
>>>>
>>>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
>>>> new file mode 100644
>>>> index 00000000..6fecf256
>>>> --- /dev/null
>>>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
>>>> @@ -0,0 +1,38 @@
>>>> +From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
>>>> +From: Khem Raj <raj.khem@gmail.com>
>>>> +Date: Thu, 9 Apr 2020 13:06:27 -0700
>>>> +Subject: [PATCH] absl: always use <asm/sgidefs.h>
>>>> +
>>>> +Fixes mips/musl build, since sgidefs.h is not present on all C libraries
>>>> +but on linux asm/sgidefs.h is there and contains same definitions, using
>>>> +that makes it portable.
>>>> +
>>>> +Upstream-Status: Pending
>>>> +
>>>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>> +---
>>>> + absl/base/internal/direct_mmap.h | 6 +-----
>>>> + 1 file changed, 1 insertion(+), 5 deletions(-)
>>>> +
>>>> +diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
>>>> +index 1beb2ee4..140b0697 100644
>>>> +--- a/absl/base/internal/direct_mmap.h
>>>> ++++ b/absl/base/internal/direct_mmap.h
>>>> +@@ -41,13 +41,9 @@
>>>> +
>>>> + #ifdef __mips__
>>>> + // Include definitions of the ABI currently in use.
>>>> +-#if defined(__BIONIC__) || !defined(__GLIBC__)
>>>> +-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
>>>> ++// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
>>>> + // definitions we need.
>>>> + #include <asm/sgidefs.h>
>>>> +-#else
>>>> +-#include <sgidefs.h>
>>>> +-#endif // __BIONIC__ || !__GLIBC__
>>>> + #endif // __mips__
>>>> +
>>>> + // SYS_mmap and SYS_munmap are not defined in Android.
>>>> +--
>>>> +2.25.1
>>>> +
>>>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
>>>> new file mode 100644
>>>> index 00000000..d49e860f
>>>> --- /dev/null
>>>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
>>>> @@ -0,0 +1,38 @@
>>>> +From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
>>>> +From: Sinan Kaya <sinan.kaya@microsoft.com>
>>>> +Date: Mon, 3 Feb 2020 03:25:57 +0000
>>>> +Subject: [PATCH] Remove maes option from cross-compilation
>>>> +
>>>> +Upstream-Status: Pending
>>>> +---
>>>> + absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
>>>> + absl/copts/GENERATED_copts.bzl | 4 ----
>>>> + 2 files changed, 8 deletions(-)
>>>> +
>>>> +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
>>>> +index da2282fe..5e0e8dfd 100644
>>>> +--- a/absl/copts/GENERATED_AbseilCopts.cmake
>>>> ++++ b/absl/copts/GENERATED_AbseilCopts.cmake
>>>> +@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
>>>> + list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
>>>> + )
>>>> +
>>>> +-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
>>>> +- "-maes"
>>>> +- "-msse4.1"
>>>> +-)
>>>> +diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
>>>> +index b9e0071e..0072008c 100644
>>>> +--- a/absl/copts/GENERATED_copts.bzl
>>>> ++++ b/absl/copts/GENERATED_copts.bzl
>>>> +@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
>>>> + ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
>>>> + ]
>>>> +
>>>> +-ABSL_RANDOM_HWAES_X64_FLAGS = [
>>>> +- "-maes",
>>>> +- "-msse4.1",
>>>> +-]
>>>> +--
>>>> +2.25.1
>>>> +
>>>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
>>>> new file mode 100644
>>>> index 00000000..c82b9e1b
>>>> --- /dev/null
>>>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
>>>> @@ -0,0 +1,49 @@
>>>> +From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001
>>>> +From: Jonas Gorski <jonas.gorski@bisdn.de>
>>>> +Date: Thu, 16 Jun 2022 11:46:31 +0000
>>>> +Subject: [PATCH] Remove neon option from cross compilation
>>>> +
>>>> +Not every arm platform supports neon instructions, so do not enforce
>>>> +them.
>>>> +
>>>> +Upstream-Status: Pending
>>>> +
>>>> +Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
>>>> +---
>>>> + absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
>>>> + absl/copts/GENERATED_copts.bzl | 4 ----
>>>> + 2 files changed, 8 deletions(-)
>>>> +
>>>> +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
>>>> +index 5e0e8dfd..57cfc4d3 100644
>>>> +--- a/absl/copts/GENERATED_AbseilCopts.cmake
>>>> ++++ b/absl/copts/GENERATED_AbseilCopts.cmake
>>>> +@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
>>>> + "/DNOMINMAX"
>>>> + )
>>>> +
>>>> +-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
>>>> +- "-mfpu=neon"
>>>> +-)
>>>> +-
>>>> + list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
>>>> + "-march=armv8-a+crypto"
>>>> + )
>>>> +diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
>>>> +index 0072008c..72840fda 100644
>>>> +--- a/absl/copts/GENERATED_copts.bzl
>>>> ++++ b/absl/copts/GENERATED_copts.bzl
>>>> +@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [
>>>> + "/DNOMINMAX",
>>>> + ]
>>>> +
>>>> +-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
>>>> +- "-mfpu=neon",
>>>> +-]
>>>> +-
>>>> + ABSL_RANDOM_HWAES_ARM64_FLAGS = [
>>>> + "-march=armv8-a+crypto",
>>>> + ]
>>>> +--
>>>> +2.25.1
>>>> +
>>>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
>>>> new file mode 100644
>>>> index 00000000..ba0cd669
>>>> --- /dev/null
>>>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
>>>> @@ -0,0 +1,103 @@
>>>> +From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001
>>>> +From: Khem Raj <raj.khem@gmail.com>
>>>> +Date: Sat, 21 Sep 2024 20:53:06 +0800
>>>> +Subject: [PATCH] abseil: ppc fixes
>>>> +
>>>> +An all-in-one patch that fixes several issues:
>>>> +
>>>> +1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
>>>> +2) powerpc stacktrace implementation only works on glibc (disabled on musl)
>>>> +3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
>>>> +4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
>>>> +
>>>> +Sourced from void linux
>>>> +
>>>> +Upstream-Status: Pending
>>>> +
>>>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>> +---
>>>> + absl/base/internal/unscaledcycleclock.cc | 4 ++--
>>>> + absl/base/internal/unscaledcycleclock_config.h | 3 ++-
>>>> + absl/debugging/internal/examine_stack.cc | 8 +++++++-
>>>> + absl/debugging/internal/stacktrace_config.h | 2 +-
>>>> + 4 files changed, 12 insertions(+), 5 deletions(-)
>>>> +
>>>> +diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc
>>>> +index a0bf3a65..103b4f6a 100644
>>>> +--- a/absl/base/internal/unscaledcycleclock.cc
>>>> ++++ b/absl/base/internal/unscaledcycleclock.cc
>>>> +@@ -20,7 +20,7 @@
>>>> + #include <intrin.h>
>>>> + #endif
>>>> +
>>>> +-#if defined(__powerpc__) || defined(__ppc__)
>>>> ++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
>>>> + #ifdef __GLIBC__
>>>> + #include <sys/platform/ppc.h>
>>>> + #elif defined(__FreeBSD__)
>>>> +@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
>>>> + return base_internal::NominalCPUFrequency();
>>>> + }
>>>> +
>>>> +-#elif defined(__powerpc__) || defined(__ppc__)
>>>> ++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
>>>> +
>>>> + int64_t UnscaledCycleClock::Now() {
>>>> + #ifdef __GLIBC__
>>>> +diff --git a/absl/base/internal/unscaledcycleclock_config.h b/absl/base/internal/unscaledcycleclock_config.h
>>>> +index 43a3dabe..196a8535 100644
>>>> +--- a/absl/base/internal/unscaledcycleclock_config.h
>>>> ++++ b/absl/base/internal/unscaledcycleclock_config.h
>>>> +@@ -21,7 +21,8 @@
>>>> +
>>>> + // The following platforms have an implementation of a hardware counter.
>>>> + #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
>>>> +- defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) || \
>>>> ++ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
>>>> ++ defined(_M_IX86) || \
>>>> + (defined(_M_X64) && !defined(_M_ARM64EC))
>>>> + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
>>>> + #else
>>>> +diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
>>>> +index 3dd6ba1a..f923b055 100644
>>>> +--- a/absl/debugging/internal/examine_stack.cc
>>>> ++++ b/absl/debugging/internal/examine_stack.cc
>>>> +@@ -36,6 +36,10 @@
>>>> + #include <csignal>
>>>> + #include <cstdio>
>>>> +
>>>> ++#if defined(__powerpc__)
>>>> ++#include <asm/ptrace.h>
>>>> ++#endif
>>>> ++
>>>> + #include "absl/base/attributes.h"
>>>> + #include "absl/base/internal/raw_logging.h"
>>>> + #include "absl/base/macros.h"
>>>> +@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) {
>>>> + return reinterpret_cast<void*>(context->uc_mcontext.pc);
>>>> + #elif defined(__powerpc64__)
>>>> + return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
>>>> +-#elif defined(__powerpc__)
>>>> ++#elif defined(__powerpc__) && defined(__GLIBC__)
>>>> + return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
>>>> ++#elif defined(__powerpc__)
>>>> ++ return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
>>>> + #elif defined(__riscv)
>>>> + return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
>>>> + #elif defined(__s390__) && !defined(__s390x__)
>>>> +diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h
>>>> +index 3929b1b7..23d5e504 100644
>>>> +--- a/absl/debugging/internal/stacktrace_config.h
>>>> ++++ b/absl/debugging/internal/stacktrace_config.h
>>>> +@@ -60,7 +60,7 @@
>>>> + #elif defined(__i386__) || defined(__x86_64__)
>>>> + #define ABSL_STACKTRACE_INL_HEADER \
>>>> + "absl/debugging/internal/stacktrace_x86-inl.inc"
>>>> +-#elif defined(__ppc__) || defined(__PPC__)
>>>> ++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
>>>> + #define ABSL_STACKTRACE_INL_HEADER \
>>>> + "absl/debugging/internal/stacktrace_powerpc-inl.inc"
>>>> + #elif defined(__aarch64__)
>>>> +--
>>>> +2.25.1
>>>> +
>>>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
>>>> new file mode 100644
>>>> index 00000000..9a4fc0b4
>>>> --- /dev/null
>>>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
>>>> @@ -0,0 +1,30 @@
>>>> +From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
>>>> +From: Derek Mauro <dmauro@google.com>
>>>> +Date: Mon, 5 Aug 2024 07:35:05 -0700
>>>> +Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to
>>>> + suppress warnings in headers". It should fall through to the "don't impose
>>>> + our warnings on others" case. Do this by matching on "-Wno-*" instead of
>>>> + "-Wno*".
>>>> +
>>>> +Fixes #1737
>>>> +
>>>> +PiperOrigin-RevId: 659548798
>>>> +Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
>>>> +Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
>>>> +---
>>>> + CMake/AbseilHelpers.cmake | 2 +-
>>>> + 1 file changed, 1 insertion(+), 1 deletion(-)
>>>> +
>>>> +diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
>>>> +index b177e590..3c4c92fe 100644
>>>> +--- a/CMake/AbseilHelpers.cmake
>>>> ++++ b/CMake/AbseilHelpers.cmake
>>>> +@@ -195,7 +195,7 @@ function(absl_cc_library)
>>>> + # specified platform. Filter both of them out before the successor
>>>> + # reaches the "^-m" filter.
>>>> + set(skip_next_cflag ON)
>>>> +- elseif(${cflag} MATCHES "^(-Wno|/wd)")
>>>> ++ elseif(${cflag} MATCHES "^(-Wno-|/wd)")
>>>> + # These flags are needed to suppress warnings that might fire in our headers.
>>>> + set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
>>>> + elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
>>>> diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
>>>> new file mode 100644
>>>> index 00000000..4bfc2100
>>>> --- /dev/null
>>>> +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
>>>> @@ -0,0 +1,54 @@
>>>> +SUMMARY = "Abseil is a cpp library like STL"
>>>> +DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
>>>> +additional useful libraries like algorithm, container, debugging, hash, memory, \
>>>> +meta, numeric, strings, synchronization, time, types and utility."
>>>> +HOMEPAGE = "https://abseil.io/"
>>>> +SECTION = "libs"
>>>> +LICENSE = "Apache-2.0"
>>>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
>>>> +
>>>> +SRCREV = "4447c7562e3bc702ade25105912dce503f0c4010"
>>>> +BRANCH = "lts_2024_07_22"
>>>> +SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
>>>> + file://0001-absl-always-use-asm-sgidefs.h.patch \
>>>> + file://0002-Remove-maes-option-from-cross-compilation.patch \
>>>> + file://0003-Remove-neon-option-from-cross-compilation.patch \
>>>> + file://0004-abseil-ppc-fixes.patch \
>>>> + file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \
>>>> + "
>>>> +
>>>> +S = "${WORKDIR}/git"
>>>> +
>>>> +inherit cmake
>>>> +
>>>> +EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
>>>> + -DBUILD_TESTING=OFF \
>>>> + -DABSL_ENABLE_INSTALL=ON \
>>>> + "
>>>> +
>>>> +SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
>>>> +
>>>> +PACKAGES_DYNAMIC += "^libabsl-*"
>>>> +PACKAGES_DYNAMIC:class-native = ""
>>>> +
>>>> +PACKAGESPLITFUNCS =+ "split_dynamic_packages"
>>>> +
>>>> +python split_dynamic_packages() {
>>>> + libdir = d.getVar('libdir')
>>>> +
>>>> + libpackages = do_split_packages(
>>>> + d,
>>>> + root=libdir,
>>>> + file_regex=r'^libabsl_(.*)\.so\..*$',
>>>> + output_pattern='libabsl-%s',
>>>> + description="abseil shared library %s",
>>>> + prepend=True,
>>>> + extra_depends='',
>>>> + )
>>>> + if libpackages:
>>>> + d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(libpackages))
>>>> +}
>>>> +
>>>> +ALLOW_EMPTY:${PN} = "1"
>>>> +
>>>> +BBCLASSEXTEND = "native nativesdk"
>>>> --
>>>> 2.39.2
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX
2025-01-22 16:30 ` Ryan Eatmon
@ 2025-01-24 21:14 ` Andrew Davis
0 siblings, 0 replies; 16+ messages in thread
From: Andrew Davis @ 2025-01-24 21:14 UTC (permalink / raw)
To: Ryan Eatmon, Chirag Shilwant, meta-arago; +Cc: Denys Dmytriyenko
On 1/22/25 10:30 AM, Ryan Eatmon wrote:
>
>
> On 1/21/2025 12:59 PM, Andrew Davis wrote:
>> On 1/18/25 1:48 PM, Chirag Shilwant wrote:
>>> Hi Andrew,
>>>
>>> On 17/01/25 05:55, Andrew Davis wrote:
>>>> 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 ++++
>>>> .../recipes-framework/onnx/onnx_1.16.1.bb | 107 ++++++++++++++++++
>>>> 2 files changed, 132 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_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_1.16.1.bb b/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
>>>> new file mode 100644
>>>> index 00000000..9624d061
>>>> --- /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"
>>>> +SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
>>>> +
>>>> +S = "${WORKDIR}/git"
>>>> +
>>>> +DEPENDS += "\
>>>> + abseil-cpp \
>>>> + protobuf \
>>>> + protobuf-native \
>>>> + python3-protobuf \
>>>> + python3-protobuf-native \
>>>> +"
>>>> +
>>>> +PYTHON_DEPENDS = "\
>>>> + python3 \
>>>
>>>
>>>
>>> Nitpick,
>>>
>>> To have a consistency across the entire recipe,
>>> I think it would be better to use PYTHON_PN (as done at PACKAGE_BEFORE_PN)
>>> OR keep it static as python3 for all references
>>>
>>
>> Good idea, seems most recipes just use "python3" and not PYTHON_PN, so I'll
>> switch to that. Better to be explicit on which python we need. (I just hope
>> we never have to deal with a python4 someday :D)
>>
>> Andrew
>
> Does this mean a v2 is coming for this series? I'm getting a little lost since you keep sending some of the same patches under new series names... I'll wait to process all of these until we get the v2.
>
Yes, I'll send a v2 once things settle down in -next/-wip. I see my
ArmNN package got dropped (which is fine, I have a newer version anyway),
but it also means until something goes into master I can't consider it
done and drop from my queue. Which means I'll end up resending it if I
send against scarthgap/master.
I could base my series against your -next/-wip branches, but as above
they are not stable branches and things can get lost..
Scarthgap/master have not moved in ~7 weeks now, so my patch backlog
is getting a bit out of hand now. Maybe we should look into a manual
promotion if LTS migration/testing is going to hold us up this long :/
Andrew
>
>
>>>
>>> --
>>> Chirag
>>>
>>>
>>>
>>>> + 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 += "${PYTHON_PN}-${PN}"
>>>> +FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
>>>> +RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
>>>> +
>>>> +# Output library is unversioned
>>>> +SOLIBS = ".so"
>>>> +FILES_SOLIBSDEV = ""
>>>> +
>>>> +# TODO: ONNXConfig.cmake in package onnx-dev contains reference to TMPDIR
>>>> +INSANE_SKIP:${PN}-dev = "buildpaths"
>
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2025-01-24 21:14 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 0:25 [meta-arago][scarthgap/master][PATCH 0/6] Add ONNX Runtime Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 1/6] flatbuffers: Remove this recipe Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 2/6] meta-arago-extras: Add recipe for arm-compute-library Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 3/6] meta-arago-extras: Add recipe for Arm NN Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master Andrew Davis
2025-01-22 23:02 ` Denys Dmytriyenko
2025-01-23 15:49 ` Andrew Davis
2025-01-23 15:56 ` Ryan Eatmon
2025-01-23 16:28 ` Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX Andrew Davis
2025-01-18 19:48 ` Chirag Shilwant
2025-01-21 18:59 ` Andrew Davis
2025-01-21 19:25 ` Denys Dmytriyenko
2025-01-22 16:30 ` Ryan Eatmon
2025-01-24 21:14 ` Andrew Davis
2025-01-17 0:25 ` [meta-arago][scarthgap/master][PATCH 6/6] 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.