Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 921672 - sci-libs/caffe2-2.1.2-r2 USE="-xnnpack" still fails due to not finding XNNPACK
Summary: sci-libs/caffe2-2.1.2-r2 USE="-xnnpack" still fails due to not finding XNNPACK
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Tupone Alfredo
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-09 15:08 UTC by Jason Cooper
Modified: 2024-01-10 21:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,10.36 KB, text/x-log)
2024-01-10 02:08 UTC, Anton Bolshakov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Cooper 2024-01-09 15:08:56 UTC
After installing XNNPACK, caffe2 completes the configuration stage successfully.  Seems to not get turned off properly by the logic `-DUSE_XNNPACK=$(usex xnnpack)`.
Comment 1 Paul Zander 2024-01-09 18:23:39 UTC
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.
Comment 2 Anton Bolshakov 2024-01-10 02:05:41 UTC
I tried 
"MYCMAKEARGS="-DUSE_SYSTEM_XNNPACK=no emerge -1u sci-libs/caffe2", but it still failed with the same error
Comment 3 Anton Bolshakov 2024-01-10 02:08:15 UTC
Created attachment 881796 [details]
build.log
Comment 4 Anton Bolshakov 2024-01-10 02:13:02 UTC
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.
Comment 5 Anton Bolshakov 2024-01-10 02:33:45 UTC
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)
Comment 6 Larry the Git Cow gentoo-dev 2024-01-10 21:15:20 UTC
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(-)