From: James Hilliard <james.hilliard1@gmail.com>
To: buildroot@buildroot.org
Cc: Stefan Hager <stefan.hager@ginzinger.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
James Hilliard <james.hilliard1@gmail.com>
Subject: [Buildroot] [PATCH v8 07/10] package/xnnpack: new package
Date: Tue, 28 Jan 2025 10:01:50 -0700 [thread overview]
Message-ID: <20250128170153.2298242-7-james.hilliard1@gmail.com> (raw)
In-Reply-To: <20250128170153.2298242-1-james.hilliard1@gmail.com>
This package is required by tensorflow-lite.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
Changes v7 -> v8:
- update to latest version
- build with PIC
- disable broken arm32/aarch64 architectures
Changes v5 -> v6:
- add architecture dependency
- update to latest version
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/xnnpack/Config.in | 25 +++++++++++++++++++++++++
package/xnnpack/xnnpack.hash | 4 ++++
package/xnnpack/xnnpack.mk | 21 +++++++++++++++++++++
5 files changed, 52 insertions(+)
create mode 100644 package/xnnpack/Config.in
create mode 100644 package/xnnpack/xnnpack.hash
create mode 100644 package/xnnpack/xnnpack.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index a5d0b2ddb3..2be4990676 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3039,6 +3039,7 @@ F: package/gemmlowp/
F: package/psimd/
F: package/pthreadpool/
F: package/ruy/
+F: package/xnnpack/
N: Stefan Nickl <Stefan.Nickl@gmail.com>
F: board/freescale/imx8dxlevk/
diff --git a/package/Config.in b/package/Config.in
index cccb95b869..74cd3e9815 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2318,6 +2318,7 @@ endif
source "package/uvw/Config.in"
source "package/volk/Config.in"
source "package/xapian/Config.in"
+ source "package/xnnpack/Config.in"
endmenu
menu "Security"
diff --git a/package/xnnpack/Config.in b/package/xnnpack/Config.in
new file mode 100644
index 0000000000..e4b92f61e8
--- /dev/null
+++ b/package/xnnpack/Config.in
@@ -0,0 +1,25 @@
+config BR2_PACKAGE_XNNPACK_ARCH_SUPPORTS
+ bool
+ default y if BR2_i386
+ default y if BR2_x86_64
+ depends on BR2_PACKAGE_CPUINFO_ARCH_SUPPORTS
+
+config BR2_PACKAGE_XNNPACK
+ bool "xnnpack"
+ depends on BR2_PACKAGE_XNNPACK_ARCH_SUPPORTS
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++14
+ depends on BR2_TOOLCHAIN_HAS_THREADS # cpuinfo
+ select BR2_PACKAGE_CPUINFO
+ select BR2_PACKAGE_FP16
+ select BR2_PACKAGE_FXDIV
+ select BR2_PACKAGE_PTHREADPOOL
+ help
+ XNNPACK is a highly optimized solution for neural network
+ inference on ARM, x86, WebAssembly, and RISC-V platforms.
+
+ https://github.com/google/XNNPACK
+
+comment "xnnpack needs a toolchain w/ C++14, threads"
+ depends on !BR2_INSTALL_LIBSTDCPP || \
+ !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/xnnpack/xnnpack.hash b/package/xnnpack/xnnpack.hash
new file mode 100644
index 0000000000..576b73aec0
--- /dev/null
+++ b/package/xnnpack/xnnpack.hash
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256 0ed35a104a697abbae72b02b967e057883ff57b388178649c453b68cffb81f72 xnnpack-d7f398ee5e135ef4f7045802eea973cc6cb26c6c.tar.gz
+# License files, locally calculated
+sha256 63f519e15726f4c4f830bd958f694c84fecb4e0a4cacc527d2696bb71ef95ada LICENSE
diff --git a/package/xnnpack/xnnpack.mk b/package/xnnpack/xnnpack.mk
new file mode 100644
index 0000000000..bb53188f9e
--- /dev/null
+++ b/package/xnnpack/xnnpack.mk
@@ -0,0 +1,21 @@
+################################################################################
+#
+# xnnpack
+#
+################################################################################
+
+XNNPACK_VERSION = d7f398ee5e135ef4f7045802eea973cc6cb26c6c
+XNNPACK_SITE = $(call github,google,XNNPACK,$(XNNPACK_VERSION))
+XNNPACK_LICENSE = BSD-3-Clause
+XNNPACK_LICENSE_FILES = LICENSE
+XNNPACK_INSTALL_STAGING = YES
+XNNPACK_DEPENDENCIES = cpuinfo fp16 fxdiv pthreadpool
+XNNPACK_CONF_OPTS = \
+ -DCPUINFO_SOURCE_DIR=$(STAGING_DIR)/usr \
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+ -DXNNPACK_BUILD_TESTS=OFF \
+ -DXNNPACK_BUILD_BENCHMARKS=OFF \
+ -DXNNPACK_ENABLE_KLEIDIAI=OFF \
+ -DXNNPACK_USE_SYSTEM_LIBS=ON
+
+$(eval $(cmake-package))
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2025-01-28 17:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 17:01 [Buildroot] [PATCH v8 01/10] package/cpuinfo: new package James Hilliard
2025-01-28 17:01 ` [Buildroot] [PATCH v8 02/10] package/ruy: " James Hilliard
2025-01-28 17:01 ` [Buildroot] [PATCH v8 03/10] package/gemmlowp: " James Hilliard
2025-01-28 17:01 ` [Buildroot] [PATCH v8 04/10] package/pthreadpool: " James Hilliard
2025-01-28 17:01 ` [Buildroot] [PATCH v8 05/10] package/psimd: " James Hilliard
2025-01-28 17:01 ` [Buildroot] [PATCH v8 06/10] package/fp16: " James Hilliard
2025-01-28 17:01 ` James Hilliard [this message]
2025-01-28 17:01 ` [Buildroot] [PATCH v8 08/10] package/fft2d: " James Hilliard
2025-01-28 17:01 ` [Buildroot] [PATCH v8 09/10] package/farmhash: " James Hilliard
2025-01-28 17:01 ` [Buildroot] [PATCH v8 10/10] package/tensorflow-lite: " James Hilliard
2025-01-28 22:40 ` Julien Olivain
2025-01-28 23:00 ` James Hilliard
2025-01-28 22:36 ` [Buildroot] [PATCH v8 01/10] package/cpuinfo: " Julien Olivain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250128170153.2298242-7-james.hilliard1@gmail.com \
--to=james.hilliard1@gmail.com \
--cc=buildroot@buildroot.org \
--cc=stefan.hager@ginzinger.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox