repo/gentoo:master commit in: sci-ml/pytorch/files/, sci-ml/pytorch/
"Alfredo Tupone" <[email protected]>
| Newsgroups | gmane.linux.gentoo.cvs |
|---|---|
| Message-ID | <1785954502.17faa2ddff8e4b2f62656db2bcf4770c192ec850.tupone@gentoo> |
commit: 17faa2ddff8e4b2f62656db2bcf4770c192ec850
Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Wed Aug 5 18:16:46 2026 +0000
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Wed Aug 5 18:28:22 2026 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17faa2dd
sci-ml/pytorch: unbundle dev-cpp/cpp-httplib for distributed build
Link to system shared httplib instead of using bundled header-only version
Closes: https://bugs.gentoo.org/980398
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/46650
Closes: https://github.com/gentoo/gentoo/pull/46650
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
.../files/pytorch-2.13.0-unbundle_httplib.patch | 32 ++++++++++++++++++++++
...h-2.13.0-r2.ebuild => pytorch-2.13.0-r3.ebuild} | 3 +-
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/sci-ml/pytorch/files/pytorch-2.13.0-unbundle_httplib.patch b/sci-ml/pytorch/files/pytorch-2.13.0-unbundle_httplib.patch
new file mode 100644
index 000000000000..679973a2d23e
--- /dev/null
+++ b/sci-ml/pytorch/files/pytorch-2.13.0-unbundle_httplib.patch
@@ -0,0 +1,32 @@
+Link to system shared httplib instead of using bundled header-only version
+
+Bug: https://bugs.gentoo.org/980398
+--- a/caffe2/CMakeLists.txt
++++ b/caffe2/CMakeLists.txt
+@@ -1338,8 +1338,9 @@ if(USE_KINETO)
+ ${TORCH_ROOT}/third_party/kineto/libkineto/src)
+ endif()
+
+-target_include_directories(torch_cpu PRIVATE
+- ${TORCH_ROOT}/third_party/cpp-httplib)
++if(USE_DISTRIBUTED)
++ target_link_libraries(torch_cpu PRIVATE httplib)
++endif()
+
+ target_include_directories(torch_cpu PRIVATE
+ ${TORCH_ROOT}/third_party/nlohmann/include)
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -1732,8 +1732,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/FlatBuffers.cmake)
+ include(${CMAKE_CURRENT_LIST_DIR}/FlatBuffers.cmake)
+
+ # Include cpp-httplib
+-add_library(httplib INTERFACE IMPORTED)
+-target_include_directories(httplib SYSTEM INTERFACE ${PROJECT_SOURCE_DIR}/third_party/cpp-httplib)
++if(USE_DISTRIBUTED)
++ find_package(httplib REQUIRED)
++ add_library(httplib ALIAS httplib::httplib)
++endif()
+
+ # Include nlohmann-json
+ add_library(nlohmann INTERFACE IMPORTED)
diff --git a/sci-ml/pytorch/pytorch-2.13.0-r2.ebuild b/sci-ml/pytorch/pytorch-2.13.0-r3.ebuild
similarity index 99%
rename from sci-ml/pytorch/pytorch-2.13.0-r2.ebuild
rename to sci-ml/pytorch/pytorch-2.13.0-r3.ebuild
index 3a5d5c55e69c..54f1028a0e7d 100644
--- a/sci-ml/pytorch/pytorch-2.13.0-r2.ebuild
+++ b/sci-ml/pytorch/pytorch-2.13.0-r3.ebuild
@@ -85,6 +85,7 @@ RDEPEND="
)
distributed? (
!rocm? ( sci-ml/tensorpipe[cuda?] )
+ dev-cpp/cpp-httplib:=
)
fbgemm? ( >=sci-ml/FBGEMM-1.4 )
gloo? ( >=sci-ml/gloo-2025.06.04[cuda?,rocm?] )
@@ -148,7 +149,6 @@ DEPEND="
dev-python/typing-extensions[${PYTHON_USEDEP}]
')
cuda? ( ~dev-libs/cutlass-4.4.2[tools(+)] )
- distributed? ( dev-cpp/cpp-httplib:= )
onednn? ( sci-ml/ideep )
rocm? (
>=sci-libs/hipCUB-6.3:= <sci-libs/hipCUB-7.3:=
@@ -169,6 +169,7 @@ PATCHES=(
"${FILESDIR}"/${P}-unbundle_flatbuffers.patch
"${FILESDIR}"/${P}-unbundle_fmt.patch
"${FILESDIR}"/${P}-unbundle_fxdiv.patch
+ "${FILESDIR}"/${P}-unbundle_httplib.patch
"${FILESDIR}"/${P}-unbundle_kineto.patch
"${FILESDIR}"/${P}-unbundle_mkldnn.patch
"${FILESDIR}"/${P}-unbundle_nnpack.patch