Skip to content

XNNPack Error configuring CMake to build an installable package  #57658

@spather

Description

@spather
Click to expand!

Issue Type

Build/Install

Source

source

Tensorflow Version

latest master (commit 9906c67)

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>

Metadata

Metadata

Labels

comp:liteTF Lite related issuesstaleThis label marks the issue/pr stale - to be closed automatically if no activitystat:awaiting responseStatus - Awaiting response from authorsubtype:macOSmacOS Build/Installation issuestype:build/installBuild and install issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions