public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alfredo Tupone" <tupone@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/caffe2/files/, sci-libs/caffe2/
Date: Thu, 14 Nov 2024 20:16:54 +0000 (UTC)	[thread overview]
Message-ID: <1731615205.ee206a9be4541beb3e60a8f3cbccb00ab0ac9e46.tupone@gentoo> (raw)

commit:     ee206a9be4541beb3e60a8f3cbccb00ab0ac9e46
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 14 20:07:11 2024 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Thu Nov 14 20:13:25 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee206a9b

sci-libs/caffe2: fix xnnpack use, add deps and other

Closes: https://bugs.gentoo.org/943501
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 ...{caffe2-2.5.1.ebuild => caffe2-2.5.1-r1.ebuild} | 42 +++++++++++++++-------
 .../caffe2/files/caffe2-2.5.1-cpp-httplib.patch    | 13 -------
 2 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/sci-libs/caffe2/caffe2-2.5.1.ebuild b/sci-libs/caffe2/caffe2-2.5.1-r1.ebuild
similarity index 90%
rename from sci-libs/caffe2/caffe2-2.5.1.ebuild
rename to sci-libs/caffe2/caffe2-2.5.1-r1.ebuild
index 81e3a916f3b3..393000c79567 100644
--- a/sci-libs/caffe2/caffe2-2.5.1.ebuild
+++ b/sci-libs/caffe2/caffe2-2.5.1-r1.ebuild
@@ -38,9 +38,10 @@ RDEPEND="
 	dev-cpp/abseil-cpp:=
 	dev-cpp/gflags:=
 	>=dev-cpp/glog-0.5.0
+	dev-cpp/nlohmann_json
+	dev-cpp/opentelemetry-cpp
 	dev-libs/cpuinfo
 	dev-libs/libfmt
-	dev-cpp/opentelemetry-cpp
 	dev-libs/protobuf:=
 	dev-libs/pthreadpool
 	dev-libs/sleef[cpu_flags_x86_avx512f(+),cpu_flags_x86_avx(+)]
@@ -95,6 +96,7 @@ RDEPEND="
 	mkl? ( sci-libs/mkl )
 	openblas? ( sci-libs/openblas )
 "
+
 DEPEND="
 	${RDEPEND}
 	cuda? ( >=dev-libs/cutlass-3.4.1 )
@@ -118,7 +120,7 @@ PATCHES=(
 	"${FILESDIR}"/${P}-fix-functorch-install.patch
 	"${FILESDIR}"/${P}-cudnn_include_fix.patch
 	"${FILESDIR}"/${P}-gentoo.patch
-	"${FILESDIR}"/${P}-cpp-httplib.patch
+	"${FILESDIR}"/${PN}-2.4.0-cpp-httplib.patch
 	"${FILESDIR}"/${P}-glog-0.6.0.patch
 )
 
@@ -132,6 +134,7 @@ src_prepare() {
 		cmake/Dependencies.cmake \
 		torch/CMakeLists.txt \
 		|| die
+
 	# Drop third_party from CMake tree
 	sed -i \
 		-e '/add_subdirectory.*third_party/d' \
@@ -140,10 +143,12 @@ src_prepare() {
 		cmake/ProtoBuf.cmake \
 		aten/src/ATen/CMakeLists.txt \
 		|| die
+
 	cmake_src_prepare
 	pushd torch/csrc/jit/serialization || die
 	flatc --cpp --gen-mutable --scoped-enums mobile_bytecode.fbs || die
 	popd
+
 	# prefixify the hardcoded paths, after all patches are applied
 	hprefixify \
 		aten/CMakeLists.txt \
@@ -186,6 +191,7 @@ src_configure() {
 	fi
 
 	local mycmakeargs=(
+		-DBUILD_CUSTOM_PROTOBUF=OFF
 		-DLIBSHM_INSTALL_LIB_SUBDIR="${EPREFIX}"/usr/$(get_libdir)
 		-DPython_EXECUTABLE="${PYTHON}"
 		-DTORCH_INSTALL_LIB_DIR="${EPREFIX}"/usr/$(get_libdir)
@@ -213,7 +219,18 @@ src_configure() {
 		-DUSE_PYTORCH_QNNPACK=$(usex qnnpack)
 		-DUSE_PYTORCH_METAL=OFF
 		-DUSE_ROCM=$(usex rocm)
-		-DUSE_SYSTEM_LIBS=ON
+		-DUSE_SYSTEM_CPUINFO=ON
+		-DUSE_SYSTEM_EIGEN_INSTALL=ON
+		-DUSE_SYSTEM_FP16=ON
+		-DUSE_SYSTEM_FXDIV=ON
+		-DUSE_SYSTEM_GLOO=ON
+		-DUSE_SYSTEM_ONNX=ON
+		-DUSE_SYSTEM_PSIMD=ON
+		-DUSE_SYSTEM_PSIMD=ON
+		-DUSE_SYSTEM_PTHREADPOOL=ON
+		-DUSE_SYSTEM_PYBIND11=ON
+		-DUSE_SYSTEM_SLEEF=ON
+		-DUSE_SYSTEM_XNNPACK=$(usex xnnpack)
 		-DUSE_TENSORPIPE=$(usex distributed)
 		-DUSE_UCC=OFF
 		-DUSE_VALGRIND=OFF
@@ -286,20 +303,19 @@ src_install() {
 	cp torch/version.py python/torch/ || die
 	python_domodule python/torch
 
-	dodir $(python_get_sitedir)/torch/bin
-	dodir $(python_get_sitedir)/torch/lib
-	dodir $(python_get_sitedir)/torch/include
+	mkdir "${D}"$(python_get_sitedir)/torch/bin || die
+	mkdir "${D}"$(python_get_sitedir)/torch/lib || die
+	mkdir "${D}"$(python_get_sitedir)/torch/include || die
 
 	ln -s ../../../../../include/torch \
 		"${D}$(python_get_sitedir)"/torch/include/torch || die # bug 923269
 
+	mv "${D}"/usr/bin/torch_shm_manager \
+		"${D}"/$(python_get_sitedir)/torch/bin/ || die
 
-	mv "${ED}"/usr/bin/torch_shm_manager \
-		"${ED}"/$(python_get_sitedir)/torch/bin/ || die
-
-	mv "${ED}"/usr/$(get_libdir)/libtorch_global_deps.so \
-		"${ED}"/$(python_get_sitedir)/torch/lib/ || die
+	mv "${D}"/usr/$(get_libdir)/libtorch_global_deps.so \
+		"${D}"/$(python_get_sitedir)/torch/lib/ || die
 
-	mv "${ED}"/usr/lib/libc10*.so \
-		"${ED}"/usr/$(get_libdir)/ || die
+	mv "${D}"/usr/lib/libc10*.so \
+		"${D}"/usr/$(get_libdir)/ || die
 }

diff --git a/sci-libs/caffe2/files/caffe2-2.5.1-cpp-httplib.patch b/sci-libs/caffe2/files/caffe2-2.5.1-cpp-httplib.patch
deleted file mode 100644
index 5d684a4a4738..000000000000
--- a/sci-libs/caffe2/files/caffe2-2.5.1-cpp-httplib.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/torch/lib/libshm/CMakeLists.txt	2024-09-04 06:09:51.943752841 +0200
-+++ b/torch/lib/libshm/CMakeLists.txt	2024-09-04 06:10:52.243821438 +0200
-@@ -24,6 +24,10 @@
-   CXX_STANDARD 17)
- target_link_libraries(shm PRIVATE ${TORCH_CPU_LIB})
- 
-+if (USE_DISTRIBUTED)
-+  target_link_libraries(shm PRIVATE cpp-httplib)
-+endif()
-+
- if(UNIX AND NOT APPLE)
-   include(CheckLibraryExists)
-   find_package(Threads REQUIRED)


             reply	other threads:[~2024-11-14 20:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 20:16 Alfredo Tupone [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-12-10 18:04 [gentoo-commits] repo/gentoo:master commit in: sci-libs/caffe2/files/, sci-libs/caffe2/ Alfredo Tupone
2024-09-04  5:02 Alfredo Tupone
2024-08-09 16:17 Alfredo Tupone
2024-07-27 19:14 Alfredo Tupone
2024-03-11 19:28 Alfredo Tupone
2024-03-08 18:46 Alfredo Tupone
2023-12-06 11:55 Alfredo Tupone
2023-04-24  8:36 Alfredo Tupone
2023-04-05  9:07 Alfredo Tupone
2023-02-28 20:38 Alfredo Tupone
2023-02-22  8:07 Alfredo Tupone
2023-01-12 12:08 Alfredo Tupone
2022-09-05  6:40 Alfredo Tupone
2022-07-03  9:57 Alfredo Tupone
2022-07-02 21:12 Alfredo Tupone
2022-06-26  7:47 Alfredo Tupone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1731615205.ee206a9be4541beb3e60a8f3cbccb00ab0ac9e46.tupone@gentoo \
    --to=tupone@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox