After installing XNNPACK, caffe2 completes the configuration stage successfully. Seems to not get turned off properly by the logic `-DUSE_XNNPACK=$(usex xnnpack)`.
Could you pass MYCMAKEARGS="-DUSE_SYSTEM_XNNPACK=no" on the command or by putting it in a package.env and see if that fixes the issue? The relevant code is at https://github.com/pytorch/pytorch/blob/v2.1.2/cmake/Dependencies.cmake#L618-L661.
I tried "MYCMAKEARGS="-DUSE_SYSTEM_XNNPACK=no emerge -1u sci-libs/caffe2", but it still failed with the same error
Created attachment 881796 [details] build.log
https://gitweb.gentoo.org/repo/gentoo.git/commit/sci-libs/caffe2?id=6726d34ce3203d8f0e693ef749836a527929d52b -DUSE_SYSTEM_XNNPACK=$(usex xnnpack) was removed, that must be the problem. FYI, there are few other "DUSE_SYSTEM_*" options were removed, somebody need to review it.
so here it is, the latest commit added "-DUSE_SYSTEM_LIBS=ON" which enables all libs, including xnnpack: CMakeLists.txt:423 if(USE_SYSTEM_LIBS) set(USE_SYSTEM_CPUINFO ON) set(USE_SYSTEM_SLEEF ON) set(USE_SYSTEM_GLOO ON) set(BUILD_CUSTOM_PROTOBUF OFF) set(USE_SYSTEM_EIGEN_INSTALL ON) set(USE_SYSTEM_FP16 ON) set(USE_SYSTEM_PTHREADPOOL ON) set(USE_SYSTEM_PSIMD ON) set(USE_SYSTEM_FXDIV ON) set(USE_SYSTEM_BENCHMARK ON) set(USE_SYSTEM_ONNX ON) set(USE_SYSTEM_XNNPACK ON) set(USE_SYSTEM_PYBIND11 ON) and later: cmake/Dependencies.cmake:660 elseif(NOT TARGET XNNPACK AND USE_SYSTEM_XNNPACK) add_library(XNNPACK SHARED IMPORTED) find_library(XNNPACK_LIBRARY XNNPACK)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba658e30c1e7f2c095391e06d2a77501253dcea2 commit ba658e30c1e7f2c095391e06d2a77501253dcea2 Author: Alfredo Tupone <tupone@gentoo.org> AuthorDate: 2024-01-10 21:14:14 +0000 Commit: Alfredo Tupone <tupone@gentoo.org> CommitDate: 2024-01-10 21:14:55 +0000 sci-libs/caffe2: fix XNNPACK configure Closes: https://bugs.gentoo.org/921672 Signed-off-by: Alfredo Tupone <tupone@gentoo.org> sci-libs/caffe2/caffe2-2.1.2-r2.ebuild | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)