Update xnnpack.cmake for WASM build
Description
This change updates the xnnpack.cmake file to reflect changes in XNNPACK's CMake and Bazel build files.
Motivation and Context
Fixes the WASM build issue with --use_xnnpack (https://github.com/microsoft/onnxruntime/issues/23460).
could you please merge to latest main branch (which fixes the web CI)
@fs-eire , Thank you for reminding me! This change is rebased.
After rebasing to the current head, I'm seeing build failure on both x64(linux) and WASM target with --use_xnnpack. This failure comes with a recent commit (https://github.com/microsoft/onnxruntime/commit/e55ce526b4404d6f2d0135dada83f716920aad0c). Bypass it at https://github.com/microsoft/onnxruntime/blob/main/cmake/CMakeLists.txt#L1930 seems to help keep the main build green.
@microsoft-github-policy-service agree company="Intel"
@fanchenkong1 what is your full build commandline and platform?
I ran into a problem related to https://github.com/google/XNNPACK/issues/8488 when I try to build with XNNPACK. ONNX Runtime handled this issue https://github.com/microsoft/onnxruntime/blob/main/cmake/external/abseil-cpp.cmake#L13-L21 but this causes other problem:
CMake Error: install(EXPORT "onnxruntimeTargets" ...) includes target "onnxruntime_common" which requires target "absl_absl_log" that is not in any export set.
This error is expected since absl installation is disabled explicitly.
we probably need to patch the XNNPACK CMakeLists.txt and revert the change in cmake/external/abseil-cpp.cmake.
(Seems not happening on Linux/macOS, so maybe this is a Windows only problem?)
@fanchenkong1 what is your full build commandline and platform?
I ran into a problem related to google/XNNPACK#8488 when I try to build with XNNPACK. ONNX Runtime handled this issue https://github.com/microsoft/onnxruntime/blob/main/cmake/external/abseil-cpp.cmake#L13-L21 but this causes other problem:
CMake Error: install(EXPORT "onnxruntimeTargets" ...) includes target "onnxruntime_common" which requires target "absl_absl_log" that is not in any export set.This error is expected since absl installation is disabled explicitly.
we probably need to patch the XNNPACK CMakeLists.txt and revert the change in cmake/external/abseil-cpp.cmake.
(Seems not happening on Linux/macOS, so maybe this is a Windows only problem?)
That's the issue I encountered. I build for x64 native and wasm on ubuntu. The command I use is,
x64: ./build.sh --build_dir=build_native_testing --config RelWithDebInfo --use_xnnpack wasm: ./build.sh --parallel --build_dir build_wasm_testing --config Release --build_wasm --enable_wasm_simd --enable_wasm_threads --use_xnnpack --disable_rtti --enable_wasm_exception_throwing
@fs-eire, I noticed your fix has been merged into XNNPACK (https://github.com/google/XNNPACK/pull/8552). Do you have plans to upgrade the XNNPACK here soon? Once that’s done, I can rebase and verify my changes accordingly.
@fs-eire, I noticed your fix has been merged into XNNPACK (google/XNNPACK#8552). Do you have plans to upgrade the XNNPACK here soon? Once that’s done, I can rebase and verify my changes accordingly.
Sorry for the late reply. I will work on a change to bump the XNNPACK version to include it.
@fs-eire, I noticed your fix has been merged into XNNPACK (google/XNNPACK#8552). Do you have plans to upgrade the XNNPACK here soon? Once that’s done, I can rebase and verify my changes accordingly.
Sorry for the late reply. I will work on a change to bump the XNNPACK version to include it.
Thank you for your help despite being so busy. If anything we can do to offload you a little bit, feel free to let us know.