Skip to content

Conversation

@zboszor
Copy link
Contributor

@zboszor zboszor commented Jul 17, 2025

Set TENSORFLOW_TARGET_ARCH for every target arch from ${TARGET_ARCH}.

This fixes the configure warning when building for x86_64:

CMake Warning at .../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/CMakeLists.txt:93 (MESSAGE):
Target processor architecture is not specified. cpuinfo will compile, but
cpuinfo_initialize() will always fail.

and the subsequent build error:

In file included from .../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/src/cpuinfo/internal-api.h:11,
from .../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/src/api.c:5:
.../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/src/api.c: In function 'cpuinfo_get_current_processor': .../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/src/api.c:318:30: error: implicit declaration of function 'syscall' [-Wimplicit-function-declaration]
318 | if CPUINFO_UNLIKELY (syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
| ^~~~~~~
.../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/src/cpuinfo/common.h:15:58: note: in definition of macro 'CPUINFO_UNLIKELY'
15 | #define CPUINFO_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))
| ^~~~~~~~~

@zboszor
Copy link
Contributor Author

zboszor commented Jul 17, 2025

FWIW, this also fixes the build of libedgetpu-std and libedgetpu-max for x86_64.

@NobuoTsukamoto
Copy link
Owner

Thank you very much for adding the target.

@zboszor
Copy link
Contributor Author

zboszor commented Jul 19, 2025

Thank you very much for adding the target.

* Would it be possible to add a description to the README?
  -> Add x86_64 to "Available BSP"

* Would it be possible to add build CI to GitHub Actions?
  Or, could you add documentation for building?

Added.

zboszor added 6 commits July 21, 2025 07:10
…T_ARCH for every target arch

Set TENSORFLOW_TARGET_ARCH for every target arch from ${TARGET_ARCH}.

This fixes the configure warning when building for x86_64:

CMake Warning at .../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/CMakeLists.txt:93 (MESSAGE):
  Target processor architecture is not specified.  cpuinfo will compile, but
  cpuinfo_initialize() will always fail.

and the subsequent build error:

In file included from .../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/src/cpuinfo/internal-api.h:11,
                 from .../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/src/api.c:5:
.../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/src/api.c: In function 'cpuinfo_get_current_processor':
.../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/src/api.c:318:30: error: implicit declaration of function 'syscall' [-Wimplicit-function-declaration]
  318 |         if CPUINFO_UNLIKELY (syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
      |                              ^~~~~~~
.../corei7-64-oe-linux/python3-tensorflow-lite/2.19.0/build/cpuinfo/src/cpuinfo/common.h:15:58: note: in definition of macro 'CPUINFO_UNLIKELY'
   15 | #define CPUINFO_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))
      |                                                          ^~~~~~~~~

Signed-off-by: Zoltán Böszörményi <[email protected]>
Fixes the build for x86_64.

Signed-off-by: Zoltán Böszörményi <[email protected]>
…_XNNPACK on x86-64

This fixes the runtime error for x86-64 targets:

>>> import tflite_runtime.interpreter as tflite
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    import tflite_runtime.interpreter as tflite
  File "/usr/lib/python3.13/site-packages/tflite_runtime/interpreter.py", line 34, in <module>
    from tflite_runtime import _pywrap_tensorflow_interpreter_wrapper as _interpreter_wrapper
ImportError: /usr/lib/python3.13/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so: undefined symbol: TfLiteXNNPackDelegateOptionsDefault

Signed-off-by: Zoltán Böszörményi <[email protected]>
…apper lib

This fixes the runtime error when importing tflite_runtime.interpreter:

Traceback (most recent call last):
  File "/usr/share/tensorflow/lite/examples/python/label_image.py", line 22, in <module>
    import tflite_runtime.interpreter as tflite
  File "/usr/lib/python3.13/site-packages/tflite_runtime/interpreter.py", line 34, in <module>
    from tflite_runtime import _pywrap_tensorflow_interpreter_wrapper as _interpreter_wrapper
ImportError: /usr/lib/python3.13/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so: cannot enable executable stack as shared object requires: Invalid argument

Signed-off-by: Zoltán Böszörményi <[email protected]>
Signed-off-by: Zoltán Böszörményi <[email protected]>
@zboszor
Copy link
Contributor Author

zboszor commented Jul 21, 2025

Rebased over the RISC-V fixes.

Should I open a separate PR for main?

@NobuoTsukamoto NobuoTsukamoto merged commit 9706a4d into NobuoTsukamoto:walnascar Jul 21, 2025
17 checks passed
@NobuoTsukamoto
Copy link
Owner

Thank you very much for the pull request.

@NobuoTsukamoto
Copy link
Owner

Should I open a separate PR for main?

Please make the PR for main if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants