After installation of sci-libs/caffe2, if I run the following command: $ cmake --find-package -DNAME=Torch -DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=COMPILE it outputs: -I/usr/include -I/usr/include/torch/csrc/api/include However, the second directory does not exist, as current ebuild moves torch headers from /usr/include/torch to /usr/lib/python3.11/site-packages/torch/include/ It causes issues with compilation of https://github.com/intel/intel-extension-for-pytorch, as it uses common CMake logic (find_package, target_link_libraries) to link with pytorch. I suggest to store headers in /usr/include/torch, and have a symlink in /usr/lib/python3.11/site-packages/torch/include/, this covers multiple scenarios and allows to build intel-extension-for-pytorch (with minor patches, unrelated to Gentoo).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f6128143a5f8bb3dd26c112a1269099d7cde9c9 commit 1f6128143a5f8bb3dd26c112a1269099d7cde9c9 Author: Sv. Lockal <lockalsash@gmail.com> AuthorDate: 2024-01-29 14:57:18 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2024-02-03 07:22:34 +0000 sci-libs/caffe2: do not move torch headers; symlink them This allows to use provided CMake configuration to build other projects (like intel-extension-for-pytorch). Closes: https://bugs.gentoo.org/923269 Signed-off-by: Sv. Lockal <lockalsash@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/35073 Signed-off-by: Michał Górny <mgorny@gentoo.org> sci-libs/caffe2/{caffe2-2.1.2-r2.ebuild => caffe2-2.1.2-r3.ebuild} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)