tensorflow: XNNPack Error configuring CMake to build an installable package
Click to expand!
Issue Type
Build/Install
Source
source
Tensorflow Version
latest master (commit 9906c67e30c2def772d2a9057c98265d904d8b97)
Custom Code
No
OS Platform and Distribution
MacOS 12.4
Mobile device
No response
Python version
No response
Bazel version
No response
GCC/Compiler version
Apple clang version 13.1.6 (clang-1316.0.21.2.5) Target: arm64-apple-darwin21.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
CUDA/cuDNN version
No response
GPU model and memory
No response
Current Behaviour?
When configuring a build to produce an installable package per the instructions (https://www.tensorflow.org/lite/guide/build_cmake#build_installable_package), I get the following error:
CMake Error: install(EXPORT "tensorflow-liteTargets" ...) includes target "tensorflow-lite" which requires target "XNNPACK" that is not in any export set.
### Standalone code to reproduce the issue
```shell
This is my command to generate my build files that produces the error I pasted above:
cmake -GNinja -S ./third_party/tensorflow/tensorflow/lite -B ./deps/build/tensorflow \
-DTFLITE_ENABLE_INSTALL:BOOL=ON \
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG:BOOL=ON \
-DCMAKE_INSTALL_PREFIX:PATH=./deps/install/tensorflow \
-Dcpuinfo_DIR:PATH=./deps/install/cpuinfo/share/cpuinfo \
-Druy_DIR:PATH=./deps/install/ruy/lib/cmake/ruy \
-Dabsl_DIR:PATH=./deps/install/abseil-cpp/lib/cmake/absl \
-DEigen3_DIR:PATH=./deps/install/eigen/share/eigen3/cmake \
-DNEON_2_SSE_DIR:PATH=./deps/install/ARM_NEON_2_x86_SSE/lib/cmake/NEON_2_SSE \
-DFlatbuffers_DIR:PATH=./deps/install/flatbuffers/lib/cmake/flatbuffers
All the dependencies (cpuinfo, ruy, absl, eigen, NEON_2_SSE, Flatbuffers) are built from source and installed at the paths specified.
If I add -DTFLITE_ENABLE_XNNPACK:BOOL=OFF
then then everything works.
### Relevant log output
_No response_</details>
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (1 by maintainers)
TL;DR
The error
results from two repos
How to fix
XNNPACK
XNNPACK’s
CMakeList.txt
failed to integrate with theFetchContent
build flow. To make it works, modify XNNPACK’sCMakeList.txt
and
pthreadpool
After fixing the issue of XNNPACK, pthreadpool’s error will show.
To fix it, modify pthreadpool’s
CMakeList.txt
as follow@sachinprasadhs I am willing to create PR if the relevant repositories are accepting them.
However, even if the PR is accepted and the issue is fixed, we still need to update the
xnnpack.cmake
file in thetensorflow/lite/tools/cmake/modules/
.we need to modify the
GIT_TAG
to reference the commit that fixes the issue. This will ensure that the fix is pulled into the codebase when building the project in the future.So, I recommend keeping this issue open until the
xnnpack.cmake
file is updated to the correct commit