microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.7k stars 2.93k forks source link

[Build] `libXNNPACK.a` not built when building with `vcpkg` and `onnxruntime_BUILD_UNIT_TESTS=off` #22789

Open cyanic-selkie opened 6 days ago

cyanic-selkie commented 6 days ago

Describe the issue

When building onnxruntime==v1.20.0 with the XNNPACK EP using vcpkg, the libXNNPACK.a doesn't get built. It gets built normally when not using vcpkg.

build/linux/Release/_deps/googlexnnpack-build/CMakeFiles/XNNPACK.dir exists, but the built library itself doesn't.

Urgency

No response

Target platform

x86 Linux

Build script

./build.sh --config Release --parallel --compile_no_warning_as_error --skip_submodule_sync --update --build --build_dir build/linux --use_xnnpack --use_vcpkg --cmake_extra_defines CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake onnxruntime_BUILD_UNIT_TESTS=off

Error / output

logs.txt

Visual Studio Version

No response

GCC / Compiler Version

No response

cyanic-selkie commented 6 days ago

It turns out that the root cause for this is actually the onnxruntime_BUILD_UNIT_TESTS=off. If I leave it out, it actually tries to build XNNPACK, but fails with the logs below.

logs.txt