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 4 years ago
- Comments: 16 (1 by maintainers)
Commits related to this issue
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok 2 years ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
- WIP: attempt to use CMake EXPORT The CMake EXPORT feature seems like it's supposed to make target_compile_options etc. work nicely for both in-project builds and also projects that consume your proje... — committed to pytorch/executorch by swolchok a year ago
TL;DR
The error
results from two repos
How to fix
XNNPACK
XNNPACK’s
CMakeList.txtfailed to integrate with theFetchContentbuild flow. To make it works, modify XNNPACK’sCMakeList.txtand
pthreadpool
After fixing the issue of XNNPACK, pthreadpool’s error will show.
To fix it, modify pthreadpool’s
CMakeList.txtas followHi @spather I am running into the exact same issue. Did you managed to solve this? Thanks!
@eesaber I finally had a chance to try your fix today and I’m having some problems. I’m aware I may not be doing it correctly, so appreciate any guidance. Steps I used:
build/tensorflow/xnnpack/CMakeLists.txtandbuild/tensorflow/pthreadpool-source/CMakeLists.txt.Can you help me figure out what I’m doing wrong? Thanks for your time on this.
@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.cmakefile in thetensorflow/lite/tools/cmake/modules/.we need to modify the
GIT_TAGto 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.cmakefile is updated to the correct commit