Skip to contentSkip to conversation

package/cpuinfo: new package

PATCH Superseded James Hilliard 2 participants 16 messages Jan 30, 2023 – Feb 6, 2023

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/10 package/cpuinfo: new package

From: Stefan Hager <[email protected]>

This package is required by tensorflow-lite.

Add a patch removing cpp requirement when not building tests.

---
Changes v4 -> v5:
- don't require cpp
Changes v2 -> v3:
- move to libraries->hardware handling

---
 DEVELOPERS                                    |  3 ++
 package/Config.in                             |  1 +
 ...nable-CXX-only-when-needed-for-tests.patch | 36 +++++++++++++++++++
 package/cpuinfo/Config.in                     |  8 +++++
 package/cpuinfo/cpuinfo.hash                  |  4 +++
 package/cpuinfo/cpuinfo.mk                    | 17 +++++++++
 6 files changed, 69 insertions(+)
 create mode 100644 package/cpuinfo/0001-Enable-CXX-only-when-needed-for-tests.patch
 create mode 100644 package/cpuinfo/Config.in
 create mode 100644 package/cpuinfo/cpuinfo.hash
 create mode 100644 package/cpuinfo/cpuinfo.mk
DEVELOPERS +3 -0
index 706ee80ece..53f1052b07 100644
@@ -2723,6 +2723,9 @@ F:	package/libvpx/
 F:	package/mesa3d-demos/
 F:	package/ti-gfx/
 
+N:	Stefan Hager <[email protected]>
+F:	package/cpuinfo/
+
 N:	Stefan Ott <[email protected]>
 F:	package/unbound/
 
package/Config.in +1 -0
index 83fddf316f..3a07074b10 100644
@@ -1645,6 +1645,7 @@ menu "Hardware handling"
 	source "package/bcm2835/Config.in"
 	source "package/c-periphery/Config.in"
 	source "package/ccid/Config.in"
+	source "package/cpuinfo/Config.in"
 	source "package/dtc/Config.in"
 	source "package/gnu-efi/Config.in"
 	source "package/hackrf/Config.in"
package/cpuinfo/0001-Enable-CXX-only-when-needed-for-tests.patch new file +36 -0
new file mode 100644
index 0000000000..ebd6ed36cd
@@ -0,0 +1,36 @@
+From b1261baefd2bb9095af56859c1cac6b1166fb13f Mon Sep 17 00:00:00 2001
+From: James Hilliard <[email protected]>
+Date: Sun, 29 Jan 2023 16:55:08 -0700
+Subject: [PATCH] Enable CXX only when needed for tests
+
+Signed-off-by: James Hilliard <[email protected]>
+[Upstream status:
+https://github.com/pytorch/cpuinfo/pull/133]
+---
+ CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b2f9434..879c9fa 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,7 +3,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
+ # ---[ Setup project
+ PROJECT(
+     cpuinfo
+-    LANGUAGES C CXX
++    LANGUAGES C
+     )
+ 
+ # ---[ Options.
+@@ -763,6 +763,7 @@ ENDIF()
+ 
+ # ---[ cpuinfo unit tests
+ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_UNIT_TESTS)
++  ENABLE_LANGUAGE(CXX)
+   ADD_EXECUTABLE(init-test test/init.cc)
+   CPUINFO_TARGET_ENABLE_CXX11(init-test)
+   CPUINFO_TARGET_RUNTIME_LIBRARY(init-test)
+-- 
+2.34.1
+
package/cpuinfo/Config.in new file +8 -0
new file mode 100644
index 0000000000..d3c3b08400
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_CPUINFO
+	bool "cpuinfo"
+	help
+	  CPU INFOrmation library, cpuinfo is a library to detect
+	  essential for performance optimization information about
+	  host CPU.
+
+	  https://github.com/pytorch/cpuinfo
package/cpuinfo/cpuinfo.hash new file +4 -0
new file mode 100644
index 0000000000..c3f70fa90f
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  0936848904943381b2c01321101614776e43d583840ee0f3ceeea1e3fb7405f7  cpuinfo-de2fa78ebb431db98489e78603e4f77c1f6c5c57.tar.gz
+# License files, locally calculated
+sha256  8e7e60636c3aa0cb03571a1a841ce5697f9551ff92b3c426c2561613d15ade70  LICENSE
package/cpuinfo/cpuinfo.mk new file +17 -0
new file mode 100644
index 0000000000..ab6a0269ec
@@ -0,0 +1,17 @@
+################################################################################
+#
+# cpuinfo
+#
+################################################################################
+
+CPUINFO_VERSION = de2fa78ebb431db98489e78603e4f77c1f6c5c57
+CPUINFO_SITE = $(call github,pytorch,cpuinfo,$(CPUINFO_VERSION))
+CPUINFO_LICENSE = BSD-2-Clause
+CPUINFO_LICENSE_FILES = LICENSE
+CPUINFO_INSTALL_STAGING = YES
+CPUINFO_CONF_OPTS = \
+	-DCPUINFO_BUILD_UNIT_TESTS=OFF \
+	-DCPUINFO_BUILD_MOCK_TESTS=OFF \
+	-DCPUINFO_BUILD_BENCHMARKS=OFF
+
+$(eval $(cmake-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH v5 2/10 package/ruy: new package

From: Stefan Hager <[email protected]>

This package is required by tensorflow-lite.

---
Changes v2 -> v3:
- add C++14 dependency

---
 DEVELOPERS            |  1 +
 package/Config.in     |  1 +
 package/ruy/Config.in | 16 ++++++++++++++++
 package/ruy/ruy.hash  |  4 ++++
 package/ruy/ruy.mk    | 18 ++++++++++++++++++
 5 files changed, 40 insertions(+)
 create mode 100644 package/ruy/Config.in
 create mode 100644 package/ruy/ruy.hash
 create mode 100644 package/ruy/ruy.mk
DEVELOPERS +1 -0
index 53f1052b07..57d364012c 100644
@@ -2725,6 +2725,7 @@ F:	package/ti-gfx/
 
 N:	Stefan Hager <[email protected]>
 F:	package/cpuinfo/
+F:	package/ruy/
 
 N:	Stefan Ott <[email protected]>
 F:	package/unbound/
package/Config.in +1 -0
index 3a07074b10..0d3fd37796 100644
@@ -2120,6 +2120,7 @@ endif
 	source "package/qhull/Config.in"
 	source "package/qlibc/Config.in"
 	source "package/riemann-c-client/Config.in"
+	source "package/ruy/Config.in"
 	source "package/shapelib/Config.in"
 	source "package/skalibs/Config.in"
 	source "package/sphinxbase/Config.in"
package/ruy/Config.in new file +16 -0
new file mode 100644
index 0000000000..c46f5c6cc9
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_RUY
+	bool "ruy"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++14
+	select BR2_PACKAGE_CPUINFO
+	help
+	  Ruy is a matrix multiplication library. Its focus is to cover
+	  the matrix multiplication needs of neural network inference
+	  engines. Its initial user has been TensorFlow Lite, where it
+	  is used by default on the ARM CPU architecture.
+
+	  https://github.com/google/ruy
+
+comment "ruy needs a toolchain w/ C++14"
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
package/ruy/ruy.hash new file +4 -0
new file mode 100644
index 0000000000..98266b5881
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  4da8572946007603378c5d0280f48c5b77f4d38763209f5306b57c7513d9a82e  ruy-3168a5c8f4c447fd8cea94078121ee2e2cd87df0.tar.gz
+# License files, locally calculated
+sha256  cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE
package/ruy/ruy.mk new file +18 -0
new file mode 100644
index 0000000000..ceeea8cd58
@@ -0,0 +1,18 @@
+################################################################################
+#
+# ruy
+#
+################################################################################
+
+RUY_VERSION = 3168a5c8f4c447fd8cea94078121ee2e2cd87df0
+RUY_SITE = $(call github,google,ruy,$(RUY_VERSION))
+RUY_LICENSE = Apache-2.0
+RUY_LICENSE_FILES = LICENSE
+RUY_INSTALL_STAGING = YES
+RUY_DEPENDENCIES = cpuinfo
+RUY_CONF_OPTS = \
+	-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+	-DRUY_FIND_CPUINFO=ON \
+	-DRUY_MINIMAL_BUILD=ON
+
+$(eval $(cmake-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH v5 3/10 package/gemmlowp: new package

In reply to James Hilliard

From: Stefan Hager <[email protected]>

This package is required by tensorflow-lite.

---
Changes v4 -> v5:
- add comment indicating library is header only
Changes v2 -> v3:
- add C++11 dependency

---
 DEVELOPERS                     |  1 +
 package/Config.in              |  1 +
 package/gemmlowp/Config.in     | 12 ++++++++++++
 package/gemmlowp/gemmlowp.hash |  4 ++++
 package/gemmlowp/gemmlowp.mk   | 16 ++++++++++++++++
 5 files changed, 34 insertions(+)
 create mode 100644 package/gemmlowp/Config.in
 create mode 100644 package/gemmlowp/gemmlowp.hash
 create mode 100644 package/gemmlowp/gemmlowp.mk
DEVELOPERS +1 -0
index 57d364012c..01e64e5fc5 100644
@@ -2725,6 +2725,7 @@ F:	package/ti-gfx/
 
 N:	Stefan Hager <[email protected]>
 F:	package/cpuinfo/
+F:	package/gemmlowp/
 F:	package/ruy/
 
 N:	Stefan Ott <[email protected]>
package/Config.in +1 -0
index 0d3fd37796..8fd8f05bd6 100644
@@ -2018,6 +2018,7 @@ menu "Other"
 	source "package/fxdiv/Config.in"
 	source "package/gconf/Config.in"
 	source "package/gdal/Config.in"
+	source "package/gemmlowp/Config.in"
 	source "package/gflags/Config.in"
 	source "package/gli/Config.in"
 	source "package/glibmm/Config.in"
package/gemmlowp/Config.in new file +12 -0
new file mode 100644
index 0000000000..379450d1b0
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_GEMMLOWP
+	bool "gemmlowp"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	help
+	  Low-precision matrix multiplication.
+
+	  https://github.com/google/gemmlowp
+
+comment "gemmlowp needs a toolchain w/ C++11"
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
package/gemmlowp/gemmlowp.hash new file +4 -0
new file mode 100644
index 0000000000..7c56a18bb6
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  cc8a22b6f071c3781e6b4b72654c89b1cdc198e72ebadebb17638eac205344c1  gemmlowp-08e4bb339e34017a0835269d4a37c4ea04d15a69.tar.gz
+# License files, locally calculated
+sha256  cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE
package/gemmlowp/gemmlowp.mk new file +16 -0
new file mode 100644
index 0000000000..9489dccbe5
@@ -0,0 +1,16 @@
+################################################################################
+#
+# gemmlowp
+#
+################################################################################
+
+GEMMLOWP_VERSION = 08e4bb339e34017a0835269d4a37c4ea04d15a69
+GEMMLOWP_SITE = $(call github,google,gemmlowp,$(GEMMLOWP_VERSION))
+GEMMLOWP_LICENSE = Apache-2.0
+GEMMLOWP_LICENSE_FILES = LICENSE
+GEMMLOWP_INSTALL_STAGING = YES
+# Only installs a header
+GEMMLOWP_INSTALL_TARGET = NO
+GEMMLOWP_SUBDIR = contrib
+
+$(eval $(cmake-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Re: [Buildroot] [PATCH v5 03/10] package/gemmlowp: new package

Hello James,

Le 30/01/2023 à 01:28, James Hilliard a écrit :

Quoted 84 lines

From: Stefan Hager <[email protected]>

This package is required by tensorflow-lite.

---
Changes v4 -> v5:
- add comment indicating library is header only
Changes v2 -> v3:
- add C++11 dependency

---
 DEVELOPERS                     |  1 +
 package/Config.in              |  1 +
 package/gemmlowp/Config.in     | 12 ++++++++++++
 package/gemmlowp/gemmlowp.hash |  4 ++++
 package/gemmlowp/gemmlowp.mk   | 16 ++++++++++++++++
 5 files changed, 34 insertions(+)
 create mode 100644 package/gemmlowp/Config.in
 create mode 100644 package/gemmlowp/gemmlowp.hash
 create mode 100644 package/gemmlowp/gemmlowp.mk
DEVELOPERS +1 -0
index 57d364012c..01e64e5fc5 100644
@@ -2725,6 +2725,7 @@ F:	package/ti-gfx/
 
 N:	Stefan Hager <[email protected]>
 F:	package/cpuinfo/
+F:	package/gemmlowp/
 F:	package/ruy/
 
 N:	Stefan Ott <[email protected]>
package/Config.in +1 -0
index 0d3fd37796..8fd8f05bd6 100644
@@ -2018,6 +2018,7 @@ menu "Other"
 	source "package/fxdiv/Config.in"
 	source "package/gconf/Config.in"
 	source "package/gdal/Config.in"
+	source "package/gemmlowp/Config.in"
 	source "package/gflags/Config.in"
 	source "package/gli/Config.in"
 	source "package/glibmm/Config.in"
package/gemmlowp/Config.in new file +12 -0
new file mode 100644
index 0000000000..379450d1b0
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_GEMMLOWP
+	bool "gemmlowp"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	help
+	  Low-precision matrix multiplication.
+
+	  https://github.com/google/gemmlowp
+
+comment "gemmlowp needs a toolchain w/ C++11"
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
package/gemmlowp/gemmlowp.hash new file +4 -0
new file mode 100644
index 0000000000..7c56a18bb6
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  cc8a22b6f071c3781e6b4b72654c89b1cdc198e72ebadebb17638eac205344c1  gemmlowp-08e4bb339e34017a0835269d4a37c4ea04d15a69.tar.gz
+# License files, locally calculated
+sha256  cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE
package/gemmlowp/gemmlowp.mk new file +3 -0
new file mode 100644
index 0000000000..9489dccbe5
@@ -0,0 +1,16 @@
+################################################################################
+#
+# gemmlowp

package/gemmlowp/gemmlowp.mk line 13

Quoted 10 lines
package/gemmlowp/gemmlowp.mk new file +10 -0
+#
+################################################################################
+
+GEMMLOWP_VERSION = 08e4bb339e34017a0835269d4a37c4ea04d15a69
+GEMMLOWP_SITE = $(call github,google,gemmlowp,$(GEMMLOWP_VERSION))
+GEMMLOWP_LICENSE = Apache-2.0
+GEMMLOWP_LICENSE_FILES = LICENSE
+GEMMLOWP_INSTALL_STAGING = YES
+# Only installs a header
+GEMMLOWP_INSTALL_TARGET = NO

Ok but libeight_bit_int_gemm.so is installed in staging. What can go wrong if something is linking against it ?

Best regards,
Romain

package/gemmlowp/gemmlowp.mk line 16

Quoted 3 lines
package/gemmlowp/gemmlowp.mk new file +3 -0
+GEMMLOWP_SUBDIR = contrib
+
+$(eval $(cmake-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

PATCH v5 4/10 package/pthreadpool: new package

In reply to James Hilliard

This package is required by tensorflow-lite.

---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/pthreadpool/Config.in        |  8 +++++++
 package/pthreadpool/pthreadpool.hash |  4 ++++
 package/pthreadpool/pthreadpool.mk   | 33 ++++++++++++++++++++++++++++
 5 files changed, 47 insertions(+)
 create mode 100644 package/pthreadpool/Config.in
 create mode 100644 package/pthreadpool/pthreadpool.hash
 create mode 100644 package/pthreadpool/pthreadpool.mk
DEVELOPERS +1 -0
index 01e64e5fc5..6d25f44dcd 100644
@@ -2726,6 +2726,7 @@ F:	package/ti-gfx/
 N:	Stefan Hager <[email protected]>
 F:	package/cpuinfo/
 F:	package/gemmlowp/
+F:	package/pthreadpool/
 F:	package/ruy/
 
 N:	Stefan Ott <[email protected]>
package/Config.in +1 -0
index 8fd8f05bd6..873aade1a6 100644
@@ -2118,6 +2118,7 @@ endif
 	source "package/protobuf/Config.in"
 	source "package/protobuf-c/Config.in"
 	source "package/protozero/Config.in"
+	source "package/pthreadpool/Config.in"
 	source "package/qhull/Config.in"
 	source "package/qlibc/Config.in"
 	source "package/riemann-c-client/Config.in"
package/pthreadpool/Config.in new file +8 -0
new file mode 100644
index 0000000000..194ae33f85
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PTHREADPOOL
+	bool "pthreadpool"
+	select BR2_PACKAGE_FXDIV
+	help
+	  Pthreadpool is a portable and efficient thread pool
+	  implementation.
+
+	  https://github.com/Maratyszcza/pthreadpool
package/pthreadpool/pthreadpool.hash new file +4 -0
new file mode 100644
index 0000000000..164ac55390
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  ae75adb19807ea28582683b38dd4e79a6b287751452564b42e214bb21216ef14  pthreadpool-43edadc654d6283b4b6e45ba09a853181ae8e850.tar.gz
+# License files, locally calculated
+sha256  57814a606b4d0fb087d9a534919084b6c11b58a4174cb5a4aef200187780dc3a  LICENSE
package/pthreadpool/pthreadpool.mk new file +33 -0
new file mode 100644
index 0000000000..4ef7949da2
@@ -0,0 +1,33 @@
+################################################################################
+#
+# pthreadpool
+#
+################################################################################
+
+PTHREADPOOL_VERSION = 43edadc654d6283b4b6e45ba09a853181ae8e850
+PTHREADPOOL_SITE = $(call github,Maratyszcza,pthreadpool,$(PTHREADPOOL_VERSION))
+PTHREADPOOL_LICENSE = BSD-2-Clause
+PTHREADPOOL_LICENSE_FILES = LICENSE
+PTHREADPOOL_INSTALL_STAGING = YES
+PTHREADPOOL_DEPENDENCIES = fxdiv
+
+PTHREADPOOL_CFLAGS = $(TARGET_CFLAGS)
+PTHREADPOOL_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_PACKAGE_CPUINFO),y)
+PTHREADPOOL_DEPENDENCIES += cpuinfo
+PTHREADPOOL_CFLAGS += -DPTHREADPOOL_USE_CPUINFO=1
+PTHREADPOOL_CXXFLAGS += -DPTHREADPOOL_USE_CPUINFO=1
+else
+PTHREADPOOL_CFLAGS += -DPTHREADPOOL_USE_CPUINFO=0
+PTHREADPOOL_CXXFLAGS += -DPTHREADPOOL_USE_CPUINFO=0
+endif
+
+PTHREADPOOL_CONF_OPTS = \
+	-DCMAKE_C_FLAGS="$(PTHREADPOOL_CFLAGS)" \
+	-DCMAKE_CXX_FLAGS="$(PTHREADPOOL_CXXFLAGS)" \
+	-DFXDIV_SOURCE_DIR="$(FXDIV_DIR)" \
+	-DPTHREADPOOL_BUILD_TESTS=OFF \
+	-DPTHREADPOOL_BUILD_BENCHMARKS=OFF
+
+$(eval $(cmake-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Re: [Buildroot] [PATCH v5 04/10] package/pthreadpool: new package

Le 30/01/2023 à 01:28, James Hilliard a écrit :

Quoted 44 lines

This package is required by tensorflow-lite.

---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/pthreadpool/Config.in        |  8 +++++++
 package/pthreadpool/pthreadpool.hash |  4 ++++
 package/pthreadpool/pthreadpool.mk   | 33 ++++++++++++++++++++++++++++
 5 files changed, 47 insertions(+)
 create mode 100644 package/pthreadpool/Config.in
 create mode 100644 package/pthreadpool/pthreadpool.hash
 create mode 100644 package/pthreadpool/pthreadpool.mk
DEVELOPERS +1 -0
index 01e64e5fc5..6d25f44dcd 100644
@@ -2726,6 +2726,7 @@ F:	package/ti-gfx/
 N:	Stefan Hager <[email protected]>
 F:	package/cpuinfo/
 F:	package/gemmlowp/
+F:	package/pthreadpool/
 F:	package/ruy/
 
 N:	Stefan Ott <[email protected]>
package/Config.in +1 -0
index 8fd8f05bd6..873aade1a6 100644
@@ -2118,6 +2118,7 @@ endif
 	source "package/protobuf/Config.in"
 	source "package/protobuf-c/Config.in"
 	source "package/protozero/Config.in"
+	source "package/pthreadpool/Config.in"
 	source "package/qhull/Config.in"
 	source "package/qlibc/Config.in"
 	source "package/riemann-c-client/Config.in"
package/pthreadpool/Config.in new file +0 -0
new file mode 100644
index 0000000000..194ae33f85

package/pthreadpool/Config.in line 2

Quoted 2 lines
package/pthreadpool/Config.in new file +2 -0
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PTHREADPOOL
+	bool "pthreadpool"

The CMakelists.txt requires C++ support:

PROJECT(pthreadpool C CXX)

Toolchain with threads support seems to be required:

src/pthreads.c:#include <pthread.h>
src/threadpool-object.h:#include <pthread.h>

Best regards,
Romain

Quoted 45 lines
package/pthreadpool/Config.in new file +6 -0
+	select BR2_PACKAGE_FXDIV
+	help
+	  Pthreadpool is a portable and efficient thread pool
+	  implementation.
+
+	  https://github.com/Maratyszcza/pthreadpool
package/pthreadpool/pthreadpool.hash new file +4 -0
new file mode 100644
index 0000000000..164ac55390
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  ae75adb19807ea28582683b38dd4e79a6b287751452564b42e214bb21216ef14  pthreadpool-43edadc654d6283b4b6e45ba09a853181ae8e850.tar.gz
+# License files, locally calculated
+sha256  57814a606b4d0fb087d9a534919084b6c11b58a4174cb5a4aef200187780dc3a  LICENSE
package/pthreadpool/pthreadpool.mk new file +23 -0
new file mode 100644
index 0000000000..4ef7949da2
@@ -0,0 +1,33 @@
+################################################################################
+#
+# pthreadpool
+#
+################################################################################
+
+PTHREADPOOL_VERSION = 43edadc654d6283b4b6e45ba09a853181ae8e850
+PTHREADPOOL_SITE = $(call github,Maratyszcza,pthreadpool,$(PTHREADPOOL_VERSION))
+PTHREADPOOL_LICENSE = BSD-2-Clause
+PTHREADPOOL_LICENSE_FILES = LICENSE
+PTHREADPOOL_INSTALL_STAGING = YES
+PTHREADPOOL_DEPENDENCIES = fxdiv
+
+PTHREADPOOL_CFLAGS = $(TARGET_CFLAGS)
+PTHREADPOOL_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_PACKAGE_CPUINFO),y)
+PTHREADPOOL_DEPENDENCIES += cpuinfo
+PTHREADPOOL_CFLAGS += -DPTHREADPOOL_USE_CPUINFO=1
+PTHREADPOOL_CXXFLAGS += -DPTHREADPOOL_USE_CPUINFO=1
+else
+PTHREADPOOL_CFLAGS += -DPTHREADPOOL_USE_CPUINFO=0
+PTHREADPOOL_CXXFLAGS += -DPTHREADPOOL_USE_CPUINFO=0

package/pthreadpool/pthreadpool.mk line 33

Quoted 10 lines
package/pthreadpool/pthreadpool.mk new file +10 -0
+endif
+
+PTHREADPOOL_CONF_OPTS = \
+	-DCMAKE_C_FLAGS="$(PTHREADPOOL_CFLAGS)" \
+	-DCMAKE_CXX_FLAGS="$(PTHREADPOOL_CXXFLAGS)" \
+	-DFXDIV_SOURCE_DIR="$(FXDIV_DIR)" \
+	-DPTHREADPOOL_BUILD_TESTS=OFF \
+	-DPTHREADPOOL_BUILD_BENCHMARKS=OFF
+
+$(eval $(cmake-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw

PATCH v5 5/10 package/psimd: new package

In reply to James Hilliard

This package is required by tensorflow-lite.

---
Changes v4 -> v5:
- add comment indicating library is header only

---
 DEVELOPERS               |  1 +
 package/Config.in        |  1 +
 package/psimd/Config.in  |  6 ++++++
 package/psimd/psimd.hash |  4 ++++
 package/psimd/psimd.mk   | 15 +++++++++++++++
 5 files changed, 27 insertions(+)
 create mode 100644 package/psimd/Config.in
 create mode 100644 package/psimd/psimd.hash
 create mode 100644 package/psimd/psimd.mk
DEVELOPERS +1 -0
index 6d25f44dcd..67187f29ac 100644
@@ -2726,6 +2726,7 @@ F:	package/ti-gfx/
 N:	Stefan Hager <[email protected]>
 F:	package/cpuinfo/
 F:	package/gemmlowp/
+F:	package/psimd/
 F:	package/pthreadpool/
 F:	package/ruy/
 
package/Config.in +1 -0
index 873aade1a6..186c7403ef 100644
@@ -2118,6 +2118,7 @@ endif
 	source "package/protobuf/Config.in"
 	source "package/protobuf-c/Config.in"
 	source "package/protozero/Config.in"
+	source "package/psimd/Config.in"
 	source "package/pthreadpool/Config.in"
 	source "package/qhull/Config.in"
 	source "package/qlibc/Config.in"
package/psimd/Config.in new file +6 -0
new file mode 100644
index 0000000000..c5c51ca2ef
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PSIMD
+	bool "psimd"
+	help
+	  Portable 128-bit SIMD intrinsics.
+
+	  https://github.com/Maratyszcza/psimd
package/psimd/psimd.hash new file +4 -0
new file mode 100644
index 0000000000..5692e79bd6
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  f6c4dab91ae9a03b3019e7cab0572743afd0e1b6e75b97fcca50259c737c924e  psimd-072586a71b55b7f8c584153d223e95687148a900.tar.gz
+# License files, locally calculated
+sha256  984ce1e0b8ee89d234e28b960381f240e03a07a8031f35012f9c3256f56964e2  LICENSE
package/psimd/psimd.mk new file +15 -0
new file mode 100644
index 0000000000..be0090a32f
@@ -0,0 +1,15 @@
+################################################################################
+#
+# psimd
+#
+################################################################################
+
+PSIMD_VERSION = 072586a71b55b7f8c584153d223e95687148a900
+PSIMD_SITE = $(call github,Maratyszcza,psimd,$(PSIMD_VERSION))
+PSIMD_LICENSE = MIT
+PSIMD_LICENSE_FILES = LICENSE
+PSIMD_INSTALL_STAGING = YES
+# Only installs a header
+PSIMD_INSTALL_TARGET = NO
+
+$(eval $(cmake-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw

PATCH v5 6/10 package/fp16: new package

In reply to James Hilliard

This package is required by tensorflow-lite.

---
Changes v4 -> v5:
- add comment indicating library is header only

---
 DEVELOPERS             |  1 +
 package/Config.in      |  1 +
 package/fp16/Config.in |  8 ++++++++
 package/fp16/fp16.hash |  4 ++++
 package/fp16/fp16.mk   | 20 ++++++++++++++++++++
 5 files changed, 34 insertions(+)
 create mode 100644 package/fp16/Config.in
 create mode 100644 package/fp16/fp16.hash
 create mode 100644 package/fp16/fp16.mk
DEVELOPERS +1 -0
index 67187f29ac..daf0f89430 100644
@@ -2725,6 +2725,7 @@ F:	package/ti-gfx/
 
 N:	Stefan Hager <[email protected]>
 F:	package/cpuinfo/
+F:	package/fp16/
 F:	package/gemmlowp/
 F:	package/psimd/
 F:	package/pthreadpool/
package/Config.in +1 -0
index 186c7403ef..867159fa2b 100644
@@ -2015,6 +2015,7 @@ menu "Other"
 	source "package/flann/Config.in"
 	source "package/flatbuffers/Config.in"
 	source "package/flatcc/Config.in"
+	source "package/fp16/Config.in"
 	source "package/fxdiv/Config.in"
 	source "package/gconf/Config.in"
 	source "package/gdal/Config.in"
package/fp16/Config.in new file +8 -0
new file mode 100644
index 0000000000..e07c6ebb8a
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_FP16
+	bool "fp16"
+	select BR2_PACKAGE_PSIMD
+	help
+	  Header-only library for conversion to/from half-precision
+	  floating point formats.
+
+	  https://github.com/Maratyszcza/FP16
package/fp16/fp16.hash new file +4 -0
new file mode 100644
index 0000000000..63634eb2cf
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  a91f4770ff9c39f4d72e339c379f566b3bbb359fa66122d85fc0bae3dde7abc7  fp16-0a92994d729ff76a58f692d3028ca1b64b145d91.tar.gz
+# License files, locally calculated
+sha256  17e4f539024be2749ee729d1e2f01d24cef12ece8c9bf18e91a4349be29c80bf  LICENSE
package/fp16/fp16.mk new file +20 -0
new file mode 100644
index 0000000000..80710523fb
@@ -0,0 +1,20 @@
+################################################################################
+#
+# fp16
+#
+################################################################################
+
+FP16_VERSION = 0a92994d729ff76a58f692d3028ca1b64b145d91
+FP16_SITE = $(call github,Maratyszcza,FP16,$(FP16_VERSION))
+FP16_LICENSE = MIT
+FP16_LICENSE_FILES = LICENSE
+FP16_INSTALL_STAGING = YES
+# Only installs a header
+FP16_INSTALL_TARGET = NO
+FP16_DEPENDENCIES = psimd
+FP16_CONF_OPTS = \
+	-DFP16_BUILD_TESTS=OFF \
+	-DFP16_BUILD_BENCHMARKS=OFF \
+	-DPSIMD_SOURCE_DIR="$(PSIMD_DIR)"
+
+$(eval $(cmake-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw

PATCH v5 7/10 package/xnnpack: new package

In reply to James Hilliard

This package is required by tensorflow-lite.

---
 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/xnnpack/Config.in    | 17 +++++++++++++++++
 package/xnnpack/xnnpack.hash |  4 ++++
 package/xnnpack/xnnpack.mk   | 18 ++++++++++++++++++
 5 files changed, 41 insertions(+)
 create mode 100644 package/xnnpack/Config.in
 create mode 100644 package/xnnpack/xnnpack.hash
 create mode 100644 package/xnnpack/xnnpack.mk
DEVELOPERS +1 -0
index daf0f89430..5e4daa7b3e 100644
@@ -2730,6 +2730,7 @@ F:	package/gemmlowp/
 F:	package/psimd/
 F:	package/pthreadpool/
 F:	package/ruy/
+F:	package/xnnpack/
 
 N:	Stefan Ott <[email protected]>
 F:	package/unbound/
package/Config.in +1 -0
index 867159fa2b..7fa5bb867e 100644
@@ -2136,6 +2136,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"
package/xnnpack/Config.in new file +17 -0
new file mode 100644
index 0000000000..2016ce9817
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_XNNPACK
+	bool "xnnpack"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++14
+	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"
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
package/xnnpack/xnnpack.hash new file +4 -0
new file mode 100644
index 0000000000..249f553f2a
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  5d70dde70c0b1aef9e608f5d193c148aa1e538574a98d912278b51e60f2457f2  xnnpack-1f7f6131f7be587d0a657d03bdd0161d67ba2700.tar.gz
+# License files, locally calculated
+sha256  63f519e15726f4c4f830bd958f694c84fecb4e0a4cacc527d2696bb71ef95ada  LICENSE
package/xnnpack/xnnpack.mk new file +18 -0
new file mode 100644
index 0000000000..d46b4c22de
@@ -0,0 +1,18 @@
+################################################################################
+#
+# xnnpack
+#
+################################################################################
+
+XNNPACK_VERSION = 1f7f6131f7be587d0a657d03bdd0161d67ba2700
+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 = \
+	-DXNNPACK_BUILD_TESTS=OFF \
+	-DXNNPACK_BUILD_BENCHMARKS=OFF \
+	-DXNNPACK_USE_SYSTEM_LIBS=ON
+
+$(eval $(cmake-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw

PATCH v5 8/10 package/fft2d: new package

In reply to James Hilliard

From: Stefan Hager <[email protected]>

This package is required by tensorflow-lite.

This package doesn't provide a conventional install mechanism so we need to install it manually.

---
Changes v4 -> v5:
- add comment indicating library is header/source only
Changes v3 -> v4:
- fix license

---
 DEVELOPERS               |  1 +
 package/Config.in        |  1 +
 package/fft2d/Config.in  |  7 +++++++
 package/fft2d/fft2d.hash |  4 ++++
 package/fft2d/fft2d.mk   | 23 +++++++++++++++++++++++
 5 files changed, 36 insertions(+)
 create mode 100644 package/fft2d/Config.in
 create mode 100644 package/fft2d/fft2d.hash
 create mode 100644 package/fft2d/fft2d.mk
DEVELOPERS +1 -0
index 5e4daa7b3e..dcd7513a87 100644
@@ -2726,6 +2726,7 @@ F:	package/ti-gfx/
 N:	Stefan Hager <[email protected]>
 F:	package/cpuinfo/
 F:	package/fp16/
+F:	package/fft2d/
 F:	package/gemmlowp/
 F:	package/psimd/
 F:	package/pthreadpool/
package/Config.in +1 -0
index 7fa5bb867e..115659256f 100644
@@ -2011,6 +2011,7 @@ menu "Other"
 	source "package/elfutils/Config.in"
 	source "package/ell/Config.in"
 	source "package/falcosecurity-libs/Config.in"
+	source "package/fft2d/Config.in"
 	source "package/fftw/Config.in"
 	source "package/flann/Config.in"
 	source "package/flatbuffers/Config.in"
package/fft2d/Config.in new file +7 -0
new file mode 100644
index 0000000000..38394f6170
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_FFT2D
+	bool "fft2d"
+	help
+	  This is a package to calculate Discrete Fourier/Cosine/Sine
+	  Transforms of 2,3-dimensional sequences of length 2^N.
+
+	  http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html
package/fft2d/fft2d.hash new file +4 -0
new file mode 100644
index 0000000000..a1b1a326ae
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  ada7e99087c4ed477bfdf11413f2ba8db8a840ba9bbf8ac94f4f3972e2a7cec9  fft2d.tgz
+# License files, locally calculated
+sha256  0b2a2082537735a2a576dbec2e8f9c1a09812eac6df6a389502a6ba860072906  readme2d.txt
package/fft2d/fft2d.mk new file +23 -0
new file mode 100644
index 0000000000..781b545e2e
@@ -0,0 +1,23 @@
+################################################################################
+#
+# fft2d
+#
+################################################################################
+
+FFT2D_VERSION = 2006.12.28
+FFT2D_SITE = https://www.kurims.kyoto-u.ac.jp/~ooura
+FFT2D_SOURCE = fft2d.tgz
+FFT2D_LICENSE = MIT-like
+FFT2D_LICENSE_FILES = readme2d.txt
+FFT2D_INSTALL_STAGING = YES
+# Only installs headers/sources
+FFT2D_INSTALL_TARGET = NO
+
+define FFT2D_INSTALL_STAGING_CMDS
+	mkdir -p $(STAGING_DIR)/usr/include/fft2d
+	$(INSTALL) -m 0644 $(@D)/*.c $(STAGING_DIR)/usr/include/fft2d
+	$(INSTALL) -m 0644 $(@D)/*.f $(STAGING_DIR)/usr/include/fft2d
+	$(INSTALL) -m 0644 $(@D)/*.h $(STAGING_DIR)/usr/include/fft2d
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#10 lore raw

PATCH v5 9/10 package/farmhash: new package

In reply to James Hilliard

From: Stefan Hager <[email protected]>

This package is required by tensorflow-lite.

---
Changes v2 -> v3:
- add C++11 dependency

---
 DEVELOPERS                     |  1 +
 package/Config.in              |  1 +
 package/farmhash/Config.in     | 12 ++++++++++++
 package/farmhash/farmhash.hash |  4 ++++
 package/farmhash/farmhash.mk   | 14 ++++++++++++++
 5 files changed, 32 insertions(+)
 create mode 100644 package/farmhash/Config.in
 create mode 100644 package/farmhash/farmhash.hash
 create mode 100644 package/farmhash/farmhash.mk
DEVELOPERS +1 -0
index dcd7513a87..12d4dc2014 100644
@@ -2725,6 +2725,7 @@ F:	package/ti-gfx/
 
 N:	Stefan Hager <[email protected]>
 F:	package/cpuinfo/
+F:	package/farmhash/
 F:	package/fp16/
 F:	package/fft2d/
 F:	package/gemmlowp/
package/Config.in +1 -0
index 115659256f..e79f6fe28f 100644
@@ -2011,6 +2011,7 @@ menu "Other"
 	source "package/elfutils/Config.in"
 	source "package/ell/Config.in"
 	source "package/falcosecurity-libs/Config.in"
+	source "package/farmhash/Config.in"
 	source "package/fft2d/Config.in"
 	source "package/fftw/Config.in"
 	source "package/flann/Config.in"
package/farmhash/Config.in new file +12 -0
new file mode 100644
index 0000000000..ef22898774
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_FARMHASH
+	bool "farmhash"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	help
+	  FarmHash, a family of hash functions.
+
+	  https://github.com/google/farmhash
+
+comment "farmhash needs a toolchain w/ C++11"
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
package/farmhash/farmhash.hash new file +4 -0
new file mode 100644
index 0000000000..afdfc0f994
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  18392cf0736e1d62ecbb8d695c31496b6507859e8c75541d7ad0ba092dc52115  farmhash-0d859a811870d10f53a594927d0d0b97573ad06d.tar.gz
+# License files, locally calculated
+sha256  4162dd091caae234f72d3b57e138174f733e736b2430a4c51b098b17d866fcb6  COPYING
package/farmhash/farmhash.mk new file +14 -0
new file mode 100644
index 0000000000..6ab7d1a88b
@@ -0,0 +1,14 @@
+################################################################################
+#
+# farmhash
+#
+################################################################################
+
+FARMHASH_VERSION = 0d859a811870d10f53a594927d0d0b97573ad06d
+FARMHASH_SITE = $(call github,google,farmhash,$(FARMHASH_VERSION))
+FARMHASH_LICENSE = MIT
+FARMHASH_LICENSE_FILES = COPYING
+FARMHASH_INSTALL_STAGING = YES
+FARMHASH_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11"
+
+$(eval $(autotools-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#11 lore raw

PATCH v5 10/10 package/tensorflow-lite: new package

In reply to James Hilliard

From: Stefan Hager <[email protected]>

This package adds the tensorflow lite runtime to buildroot.

---
Changes v3 -> v4:
- fix min gcc version
- enable xnnpack
Changes v2 -> v3:
- drop architecture restrictions which appear inaccurate after adding neon-2-sse
- disable android only nnapi
Changes v1 -> v2:
- fix label_image build
- more explicit cmake config

---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 .../0001-lite-Update-CMakeLists.txt.patch     | 49 ++++++++++++++++++
 .../0002-Fix-FindFlatBuffers-cmake-file.patch | 37 ++++++++++++++
 ...ink-tensorflow-lite-against-gemmlowp.patch | 32 ++++++++++++
 package/tensorflow-lite/Config.in             | 27 ++++++++++
 package/tensorflow-lite/tensorflow-lite.hash  |  4 ++
 package/tensorflow-lite/tensorflow-lite.mk    | 51 +++++++++++++++++++
 8 files changed, 202 insertions(+)
 create mode 100644 package/tensorflow-lite/0001-lite-Update-CMakeLists.txt.patch
 create mode 100644 package/tensorflow-lite/0002-Fix-FindFlatBuffers-cmake-file.patch
 create mode 100644 package/tensorflow-lite/0003-Don-t-link-tensorflow-lite-against-gemmlowp.patch
 create mode 100644 package/tensorflow-lite/Config.in
 create mode 100644 package/tensorflow-lite/tensorflow-lite.hash
 create mode 100644 package/tensorflow-lite/tensorflow-lite.mk
DEVELOPERS +1 -0
index 12d4dc2014..d18ab04329 100644
@@ -2732,6 +2732,7 @@ F:	package/gemmlowp/
 F:	package/psimd/
 F:	package/pthreadpool/
 F:	package/ruy/
+F:	package/tensorflow-lite/
 F:	package/xnnpack/
 
 N:	Stefan Ott <[email protected]>
package/Config.in +1 -0
index e79f6fe28f..6aa5e2640c 100644
@@ -2132,6 +2132,7 @@ endif
 	source "package/sphinxbase/Config.in"
 	source "package/startup-notification/Config.in"
 	source "package/tbb/Config.in"
+	source "package/tensorflow-lite/Config.in"
 	source "package/tinycbor/Config.in"
 	source "package/tz/Config.in"
 	source "package/tzdata/Config.in"
package/tensorflow-lite/0001-lite-Update-CMakeLists.txt.patch new file +49 -0

49 lines not on this page · raw message

package/tensorflow-lite/0002-Fix-FindFlatBuffers-cmake-file.patch new file +37 -0
new file mode 100644
index 0000000000..e97bb3e52f
@@ -0,0 +1,37 @@
+From a4ff4b5e952a22906ac0ed01e73f84f42926c325 Mon Sep 17 00:00:00 2001
+From: James Hilliard <[email protected]>
+Date: Thu, 24 Nov 2022 14:29:06 -0700
+Subject: [PATCH] Fix FindFlatBuffers cmake file
+
+Capitalization needs to match for system cmake override to work:
+https://github.com/google/flatbuffers/blob/v22.11.23/CMake/FindFlatBuffers.cmake
+
+Signed-off-by: James Hilliard <[email protected]>
+[Upstream status:
+https://github.com/tensorflow/tensorflow/pull/58677]
+---
+ tensorflow/lite/CMakeLists.txt                                  | 2 +-
+ .../modules/{FindFlatbuffers.cmake => FindFlatBuffers.cmake}    | 0
+ 2 files changed, 1 insertion(+), 1 deletion(-)
+ rename tensorflow/lite/tools/cmake/modules/{FindFlatbuffers.cmake => FindFlatBuffers.cmake} (100%)
+
+diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
+index f9c30d6a046..c2ee9edfb61 100644
+--- a/tensorflow/lite/CMakeLists.txt
++++ b/tensorflow/lite/CMakeLists.txt
+@@ -143,7 +143,7 @@ find_package(absl REQUIRED)
+ find_package(Eigen3 REQUIRED)
+ find_package(farmhash REQUIRED)
+ find_package(fft2d REQUIRED)
+-find_package(Flatbuffers REQUIRED)
++find_package(FlatBuffers REQUIRED)
+ find_package(gemmlowp REQUIRED)
+ find_package(NEON_2_SSE REQUIRED)
+ find_package(cpuinfo REQUIRED)  #CPUINFO is used by XNNPACK and RUY library
+diff --git a/tensorflow/lite/tools/cmake/modules/FindFlatbuffers.cmake b/tensorflow/lite/tools/cmake/modules/FindFlatBuffers.cmake
+similarity index 100%
+rename from tensorflow/lite/tools/cmake/modules/FindFlatbuffers.cmake
+rename to tensorflow/lite/tools/cmake/modules/FindFlatBuffers.cmake
+-- 
+2.34.1
+
package/tensorflow-lite/0003-Don-t-link-tensorflow-lite-against-gemmlowp.patch new file +32 -0
new file mode 100644
index 0000000000..dbee9942b3
@@ -0,0 +1,32 @@
+From fb584589f707853d85a081c99b1b82598c2631c1 Mon Sep 17 00:00:00 2001
+From: James Hilliard <[email protected]>
+Date: Thu, 24 Nov 2022 15:10:27 -0700
+Subject: [PATCH] Don't link tensorflow-lite against gemmlowp
+
+We can't link against gemmlowp as it is a header only library.
+
+Fixes:
+/bin/ld: cannot find -lgemmlowp: No such file or directory
+
+Signed-off-by: James Hilliard <[email protected]>
+[Upstream status:
+https://github.com/tensorflow/tensorflow/pull/58678]
+---
+ tensorflow/lite/CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
+index f9c30d6a046..3fe5ed15605 100644
+--- a/tensorflow/lite/CMakeLists.txt
++++ b/tensorflow/lite/CMakeLists.txt
+@@ -560,7 +560,6 @@ target_link_libraries(tensorflow-lite
+     farmhash
+     fft2d_fftsg2d
+     flatbuffers::flatbuffers
+-    gemmlowp
+     ruy::ruy
+     pthreadpool
+     ${CMAKE_DL_LIBS}
+-- 
+2.34.1
+
package/tensorflow-lite/Config.in new file +27 -0
new file mode 100644
index 0000000000..92a364ca36
@@ -0,0 +1,27 @@
+config BR2_PACKAGE_TENSORFLOW_LITE
+	bool "tensorflow-lite"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # C++17
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on BR2_SHARED_LIBS
+	select BR2_PACKAGE_CPUINFO
+	select BR2_PACKAGE_EIGEN
+	select BR2_PACKAGE_FARMHASH
+	select BR2_PACKAGE_FFT2D
+	select BR2_PACKAGE_FLATBUFFERS
+	select BR2_PACKAGE_GEMMLOWP
+	select BR2_PACKAGE_LIBABSEIL_CPP
+	select BR2_PACKAGE_NEON_2_SSE
+	select BR2_PACKAGE_RUY
+	select BR2_PACKAGE_XNNPACK
+	help
+	  Tensorflow Lite dynamic library and headers: Inference engine
+	  to run previously trained machine learning models.
+
+comment "tensorflow-lite needs a toolchain w/ glibc, C++17, threads"
+	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP || \
+			!BR2_TOOLCHAIN_GCC_AT_LEAST_7 || !BR2_TOOLCHAIN_HAS_THREADS
+
+comment "tensorflow-lite needs a toolchain w/ shared libraries"
+	depends on !BR2_SHARED_LIBS
package/tensorflow-lite/tensorflow-lite.hash new file +4 -0
new file mode 100644
index 0000000000..7d9035707b
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  99c732b92b1b37fc243a559e02f9aef5671771e272758aa4aec7f34dc92dac48  tensorflow-lite-2.11.0.tar.gz
+# License files, locally calculated
+sha256  71c6915d04265772a0339bed47276942c678b45cc01534210ebe6984fd1aec65  LICENSE
package/tensorflow-lite/tensorflow-lite.mk new file +51 -0

51 lines not on this page · raw message

Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#12 lore raw
In reply to James Hilliard

Hello James,

Le 30/01/2023 à 01:28, James Hilliard a écrit :

Quoted 101 lines

From: Stefan Hager <[email protected]>

This package is required by tensorflow-lite.

Add a patch removing cpp requirement when not building tests.

---
Changes v4 -> v5:
- don't require cpp
Changes v2 -> v3:
- move to libraries->hardware handling

---
 DEVELOPERS                                    |  3 ++
 package/Config.in                             |  1 +
 ...nable-CXX-only-when-needed-for-tests.patch | 36 +++++++++++++++++++
 package/cpuinfo/Config.in                     |  8 +++++
 package/cpuinfo/cpuinfo.hash                  |  4 +++
 package/cpuinfo/cpuinfo.mk                    | 17 +++++++++
 6 files changed, 69 insertions(+)
 create mode 100644 package/cpuinfo/0001-Enable-CXX-only-when-needed-for-tests.patch
 create mode 100644 package/cpuinfo/Config.in
 create mode 100644 package/cpuinfo/cpuinfo.hash
 create mode 100644 package/cpuinfo/cpuinfo.mk
DEVELOPERS +3 -0
index 706ee80ece..53f1052b07 100644
@@ -2723,6 +2723,9 @@ F:	package/libvpx/
 F:	package/mesa3d-demos/
 F:	package/ti-gfx/
 
+N:	Stefan Hager <[email protected]>
+F:	package/cpuinfo/
+
 N:	Stefan Ott <[email protected]>
 F:	package/unbound/
 
package/Config.in +1 -0
index 83fddf316f..3a07074b10 100644
@@ -1645,6 +1645,7 @@ menu "Hardware handling"
 	source "package/bcm2835/Config.in"
 	source "package/c-periphery/Config.in"
 	source "package/ccid/Config.in"
+	source "package/cpuinfo/Config.in"
 	source "package/dtc/Config.in"
 	source "package/gnu-efi/Config.in"
 	source "package/hackrf/Config.in"
package/cpuinfo/0001-Enable-CXX-only-when-needed-for-tests.patch new file +36 -0
new file mode 100644
index 0000000000..ebd6ed36cd
@@ -0,0 +1,36 @@
+From b1261baefd2bb9095af56859c1cac6b1166fb13f Mon Sep 17 00:00:00 2001
+From: James Hilliard <[email protected]>
+Date: Sun, 29 Jan 2023 16:55:08 -0700
+Subject: [PATCH] Enable CXX only when needed for tests
+
+Signed-off-by: James Hilliard <[email protected]>
+[Upstream status:
+https://github.com/pytorch/cpuinfo/pull/133]
+---
+ CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b2f9434..879c9fa 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,7 +3,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
+ # ---[ Setup project
+ PROJECT(
+     cpuinfo
+-    LANGUAGES C CXX
++    LANGUAGES C
+     )
+ 
+ # ---[ Options.
+@@ -763,6 +763,7 @@ ENDIF()
+ 
+ # ---[ cpuinfo unit tests
+ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_UNIT_TESTS)
++  ENABLE_LANGUAGE(CXX)
+   ADD_EXECUTABLE(init-test test/init.cc)
+   CPUINFO_TARGET_ENABLE_CXX11(init-test)
+   CPUINFO_TARGET_RUNTIME_LIBRARY(init-test)
+-- 
+2.34.1
+
package/cpuinfo/Config.in new file +0 -0
new file mode 100644
index 0000000000..d3c3b08400

package/cpuinfo/Config.in line 2

Quoted 2 lines
package/cpuinfo/Config.in new file +2 -0
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_CPUINFO
+	bool "cpuinfo"

Have you checked cpuinfo dependencies ?

It seems XNNPack used by cpuinfo is 64bits architectures only:

CMake Warning at CMakeLists.txt:69 (MESSAGE):
Target processor architecture "l" is not supported in cpuinfo. cpuinfo will compile, but cpuinfo_initialize() will always fail.

hint:
https://github.com/NobuoTsukamoto/meta-tensorflow-lite/blob/main/recipes-tools/tensorflow-lite/tensorflow-lite-benchmark_2.11.0.bb#L33

And trigger a build issue on uClibc-ng due to missing header:

cpuinfo-de2fa78ebb431db98489e78603e4f77c1f6c5c57/src/arm/linux/hwcap.c:19:11:
fatal error: sys/auxv.h: No such file or directory
19 | #include <sys/auxv.h>

Also static build is not likely supported:

cpuinfo-de2fa78ebb431db98489e78603e4f77c1f6c5c57/src/arm/linux/hwcap.c:8:10:
fatal error: dlfcn.h: No such file or directory

    8 | #include <dlfcn.h>

Best regards,
Romain

Quoted 29 lines
package/cpuinfo/Config.in new file +6 -0
+	help
+	  CPU INFOrmation library, cpuinfo is a library to detect
+	  essential for performance optimization information about
+	  host CPU.
+
+	  https://github.com/pytorch/cpuinfo
package/cpuinfo/cpuinfo.hash new file +4 -0
new file mode 100644
index 0000000000..c3f70fa90f
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  0936848904943381b2c01321101614776e43d583840ee0f3ceeea1e3fb7405f7  cpuinfo-de2fa78ebb431db98489e78603e4f77c1f6c5c57.tar.gz
+# License files, locally calculated
+sha256  8e7e60636c3aa0cb03571a1a841ce5697f9551ff92b3c426c2561613d15ade70  LICENSE
package/cpuinfo/cpuinfo.mk new file +7 -0
new file mode 100644
index 0000000000..ab6a0269ec
@@ -0,0 +1,17 @@
+################################################################################
+#
+# cpuinfo
+#
+################################################################################
+
+CPUINFO_VERSION = de2fa78ebb431db98489e78603e4f77c1f6c5c57

package/cpuinfo/cpuinfo.mk line 17

Quoted 10 lines
package/cpuinfo/cpuinfo.mk new file +10 -0
+CPUINFO_SITE = $(call github,pytorch,cpuinfo,$(CPUINFO_VERSION))
+CPUINFO_LICENSE = BSD-2-Clause
+CPUINFO_LICENSE_FILES = LICENSE
+CPUINFO_INSTALL_STAGING = YES
+CPUINFO_CONF_OPTS = \
+	-DCPUINFO_BUILD_UNIT_TESTS=OFF \
+	-DCPUINFO_BUILD_MOCK_TESTS=OFF \
+	-DCPUINFO_BUILD_BENCHMARKS=OFF
+
+$(eval $(cmake-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#13 lore raw

Hello James,

Le 06/02/2023 à 16:53, Romain Naour a écrit :

Quoted 18 lines

Hello James,

Le 30/01/2023 à 01:28, James Hilliard a écrit :

Quoted 15 lines

From: Stefan Hager <[email protected]>

This package is required by tensorflow-lite.

Add a patch removing cpp requirement when not building tests.

---
Changes v4 -> v5:
- don't require cpp
Changes v2 -> v3:
- move to libraries->hardware handling
---

[...]

Quoted 26 lines

package/cpuinfo/Config.in line 2

Quoted 8 lines
package/cpuinfo/Config.in new file +2 -0
new file mode 100644
index 0000000000..d3c3b08400
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_CPUINFO
+	bool "cpuinfo"

Have you checked cpuinfo dependencies ?

It seems XNNPack used by cpuinfo is 64bits architectures only:

CMake Warning at CMakeLists.txt:69 (MESSAGE):
Target processor architecture "l" is not supported in cpuinfo. cpuinfo will compile, but cpuinfo_initialize() will always fail.

hint:
https://github.com/NobuoTsukamoto/meta-tensorflow-lite/blob/main/recipes-tools/tensorflow-lite/tensorflow-lite-benchmark_2.11.0.bb#L33

And trigger a build issue on uClibc-ng due to missing header:

cpuinfo-de2fa78ebb431db98489e78603e4f77c1f6c5c57/src/arm/linux/hwcap.c:19:11:
fatal error: sys/auxv.h: No such file or directory
19 | #include <sys/auxv.h>

Quoted 5 lines

Also static build is not likely supported:

cpuinfo-de2fa78ebb431db98489e78603e4f77c1f6c5c57/src/arm/linux/hwcap.c:8:10:
fatal error: dlfcn.h: No such file or directory

    8 | #include <dlfcn.h>

Actually there is an architecture dependency: x86, x86_64, arm, aarch64. Also it requires threads support:

https://github.com/pytorch/cpuinfo/blob/main/src/init.c#L24

Best regards,
Romain

Quoted 4 lines

Best regards,
Romain

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#14 lore raw
Quoted 53 lines · Romain Naour

Hello James,

Quoted 18 lines · Romain Naour

Hello James,

Quoted 15 lines · James Hilliard

From: Stefan Hager <[email protected]>

This package is required by tensorflow-lite.

Add a patch removing cpp requirement when not building tests.

---
Changes v4 -> v5:
- don't require cpp
Changes v2 -> v3:
- move to libraries->hardware handling
---

[...]

Quoted 28 lines

package/cpuinfo/Config.in line 2

Quoted 8 lines
package/cpuinfo/Config.in new file +2 -0
new file mode 100644
index 0000000000..d3c3b08400
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_CPUINFO
+    bool "cpuinfo"

Have you checked cpuinfo dependencies ?

It seems XNNPack used by cpuinfo is 64bits architectures only:

CMake Warning at CMakeLists.txt:69 (MESSAGE):
Target processor architecture "l" is not supported in cpuinfo. cpuinfo will compile, but cpuinfo_initialize() will always fail.

hint:
https://github.com/NobuoTsukamoto/meta-tensorflow-lite/blob/main/recipes-tools/tensorflow-lite/tensorflow-lite-benchmark_2.11.0.bb#L33

And trigger a build issue on uClibc-ng due to missing header:

cpuinfo-de2fa78ebb431db98489e78603e4f77c1f6c5c57/src/arm/linux/hwcap.c:19:11:
fatal error: sys/auxv.h: No such file or directory
19 | #include <sys/auxv.h>

Also static build is not likely supported:

Quoted 8 lines
Quoted 3 lines

cpuinfo-de2fa78ebb431db98489e78603e4f77c1f6c5c57/src/arm/linux/hwcap.c:8:10:
fatal error: dlfcn.h: No such file or directory

    8 | #include <dlfcn.h>

Actually there is an architecture dependency: x86, x86_64, arm, aarch64. Also it requires threads support:

https://github.com/pytorch/cpuinfo/blob/main/src/init.c#L24

Well...those architecture dependencies kinda look like runtime deps to me...a consuming application could call cpuinfo_initialize() with error handling and fallback to some other codepath automatically on failure.

So probably we don't want to apply an architecture restriction unless there's an actual build failure.

Quoted 8 lines

Best regards,
Romain

Quoted 4 lines

Best regards,
Romain

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#15 lore raw

Le 06/02/2023 à 17:33, James Hilliard a écrit :

Quoted 63 lines · Romain Naour
Quoted 53 lines

Hello James,

Quoted 18 lines · Romain Naour

Hello James,

Quoted 15 lines · James Hilliard

From: Stefan Hager <[email protected]>

This package is required by tensorflow-lite.

Add a patch removing cpp requirement when not building tests.

---
Changes v4 -> v5:
- don't require cpp
Changes v2 -> v3:
- move to libraries->hardware handling
---

[...]

Quoted 28 lines

package/cpuinfo/Config.in line 2

Quoted 8 lines
package/cpuinfo/Config.in new file +2 -0
new file mode 100644
index 0000000000..d3c3b08400
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_CPUINFO
+    bool "cpuinfo"

Have you checked cpuinfo dependencies ?

It seems XNNPack used by cpuinfo is 64bits architectures only:

CMake Warning at CMakeLists.txt:69 (MESSAGE):
Target processor architecture "l" is not supported in cpuinfo. cpuinfo will compile, but cpuinfo_initialize() will always fail.

hint:
https://github.com/NobuoTsukamoto/meta-tensorflow-lite/blob/main/recipes-tools/tensorflow-lite/tensorflow-lite-benchmark_2.11.0.bb#L33

And trigger a build issue on uClibc-ng due to missing header:

cpuinfo-de2fa78ebb431db98489e78603e4f77c1f6c5c57/src/arm/linux/hwcap.c:19:11:
fatal error: sys/auxv.h: No such file or directory
19 | #include <sys/auxv.h>

Also static build is not likely supported:

Quoted 8 lines
Quoted 3 lines

cpuinfo-de2fa78ebb431db98489e78603e4f77c1f6c5c57/src/arm/linux/hwcap.c:8:10:
fatal error: dlfcn.h: No such file or directory

    8 | #include <dlfcn.h>

Actually there is an architecture dependency: x86, x86_64, arm, aarch64. Also it requires threads support:

https://github.com/pytorch/cpuinfo/blob/main/src/init.c#L24

Quoted 7 lines

Well...those architecture dependencies kinda look like runtime deps to me...a consuming application could call cpuinfo_initialize() with error handling and fallback to some other codepath automatically on failure.

So probably we don't want to apply an architecture restriction unless there's an actual build failure.

With the sourcery-arm-armv4t cpuinfo build will fail:

CMake Warning at CMakeLists.txt:69 (MESSAGE):
Target processor architecture "armv4l" is not supported in cpuinfo. cpuinfo will compile, but cpuinfo_initialize() will always fail.

libcpuinfo.so: hidden symbol `cpuinfo_arm_linux_init' isn't defined

The architecture support other than announced (arm,aarch64, x86 and x86_64) seems uncertain. In doubt, it seems to be legit to add architecture dependencies.

Best regards,
Romain

Quoted 9 lines
Quoted 9 lines

Best regards,
Romain

Quoted 4 lines

Best regards,
Romain

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot