Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 923269 - sci-libs/caffe2-2.1.2-r2: headers of torch are not /usr/include/torch, but CMake config links to there
Summary: sci-libs/caffe2-2.1.2-r2: headers of torch are not /usr/include/torch, but CM...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tupone Alfredo
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-01-29 14:41 UTC by Sv. Lockal
Modified: 2024-02-03 07:22 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sv. Lockal 2024-01-29 14:41:07 UTC
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).
Comment 1 Larry the Git Cow gentoo-dev 2024-02-03 07:22:46 UTC
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(-)