Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error when including XNNPACK using FetchContent #5669

Open
skottmckay opened this issue Oct 19, 2023 · 4 comments
Open

Build error when including XNNPACK using FetchContent #5669

skottmckay opened this issue Oct 19, 2023 · 4 comments

Comments

@skottmckay
Copy link

If I include XNNPACK as a checksummed archive for security reasons using FetchContent

e.g.

FetchContent_Declare(googlexnnpack URL https://github.com/google/XNNPACK/archive/21df17dd436635621588ce9de1e79bae4c9d4a4b.zip URL_HASH SHA1=dbd0c6c161894d35f17df07e892f434b10146b07)
FetchContent_MakeAvailable(googlexnnpack)

the recent change in #5031 results in the build breaking as CMAKE_PROJECT_NAME is set to my project's name and cmake/<my arbitrary project name>Config.cmake.in does not exist:

"${CMAKE_CURRENT_SOURCE_DIR}/cmake/${CMAKE_PROJECT_NAME}Config.cmake.in"

@ConnorBaker Is this expected?

@ConnorBaker
Copy link
Contributor

Thanks for the report! That is very much not expected — sorry about that!

I’ll try to get out a PR asap to fix that.

Out of curiosity, does changing it to PROJECT_NAME work?

@skottmckay
Copy link
Author

skottmckay commented Oct 20, 2023

Replacing all the CMAKE_PROJECT_NAME usages with PROJECT_NAME in CMakeLists.txt works for the Config.cmake.in filename but I get errors about the install. I don't actually need/want to install but I don't think there's an option to disable that.

CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "allocator" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "cache" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "hardware-config" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "indirection" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "jit" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "logging" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "memory" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "microkernel-utils" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "microparams-init" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "mutex" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "normalization" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "operators" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "operator-run" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "operator-utils" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "packing" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "post-operation" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "microkernels-prod" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "subgraph" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "pthreadpool" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "fxdiv" that is not in any export set.
CMake Error: install(EXPORT "XNNPACKTargets" ...) includes target "XNNPACK" which requires target "fp16" that is not in any export set.

@ConnorBaker
Copy link
Contributor

Can you try with 0da379f (the commit after the one you used in your original post) or newer? It looks like my change was reverted since then.

Let me know if that works and I'll submit a PR to re-land my changes and tag you to ask you to review to ensure there's no breakage. Again, sorry about this!

@skottmckay
Copy link
Author

No issues with that commit.

I tried with the changes in #5676 applied to the latest master but still get the export errors. If I comment out these lines I can avoid that (but that's probably expected).

  INSTALL(EXPORT XNNPACKTargets
    FILE "XNNPACKConfig.cmake"
    DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/XNNPACK")

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

No branches or pull requests

2 participants