diff options
author | Alfredo Tupone <tupone@gentoo.org> | 2024-11-14 21:07:11 +0100 |
---|---|---|
committer | Alfredo Tupone <tupone@gentoo.org> | 2024-11-14 21:13:25 +0100 |
commit | ee206a9be4541beb3e60a8f3cbccb00ab0ac9e46 (patch) | |
tree | dd8e59933874fe5a4adec402634a71e8f82a0da2 /sci-libs/caffe2 | |
parent | sys-kernel/gentoo-kernel-bin: Bump to 6.11.8 (diff) | |
download | gentoo-ee206a9be4541beb3e60a8f3cbccb00ab0ac9e46.tar.gz gentoo-ee206a9be4541beb3e60a8f3cbccb00ab0ac9e46.tar.bz2 gentoo-ee206a9be4541beb3e60a8f3cbccb00ab0ac9e46.zip |
sci-libs/caffe2: fix xnnpack use, add deps and other
Closes: https://bugs.gentoo.org/943501
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'sci-libs/caffe2')
-rw-r--r-- | sci-libs/caffe2/caffe2-2.5.1-r1.ebuild (renamed from sci-libs/caffe2/caffe2-2.5.1.ebuild) | 42 | ||||
-rw-r--r-- | sci-libs/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 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) |