Files
buildroot/package/xnnpack/Config.in
Thomas Perale 627af87bda package/pthreadpool: fix thread dependency
On autobuilder config with BR2_TOOLCHAIN_HAS_THREADS not set the
following error happens when building the pthreadpool package:

```
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - no
CMake Error at /home/buildroot/instance-0/output-1/host/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /home/buildroot/instance-0/output-1/host/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /home/buildroot/instance-0/output-1/host/share/cmake-3.31/Modules/FindThreads.cmake:226 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:143 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
```

This can be reproduced with:

```
cat >.config <<EOF
BR2_armeb=y
BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y
BR2_PTHREADS_NONE=y
BR2_PACKAGE_PTHREADPOOL=y
EOF
make olddefconfig
make pthreadpool
```

Since the introduction of this package in [1], the dependency was not
included. Since this package was part of the tensorflow-lite
dependencies that required thread it was not an issue.

This patch adds BR2_TOOLCHAIN_HAS_THREADS in the dependency to avoid
errors when built as a standalone package.

[1] f2486a6cf9 package/pthreadpool: new package

Fixes: https://autobuild.buildroot.org/results/35a/35aa100d72c6875350ad10c57f028f04052cbf79
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
2025-08-09 23:54:53 +02:00

26 lines
813 B
Plaintext

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, pthreadpool
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