commit:     fa9ca8f66c0bbbabb61ec8574389bab85862741a
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  6 01:07:30 2020 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu Aug  6 01:07:30 2020 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=fa9ca8f6

sci-libs/pytorch: bump to 1.6.0.

Remove virtual/python-typing dependency.  It was removed from tree and only
needed by python-2.

Package-Manager: Portage-2.3.88, Repoman-2.3.18
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 sci-libs/pytorch/files/pytorch-1.6.0-setup.patch   | 14 ++++
 .../pytorch/files/pytorch-1.6.0-skip-tests.patch   | 14 ++++
 .../pytorch-1.6.0-tensorpipe-unbundle-libuv.patch  | 13 ++++
 sci-libs/pytorch/pytorch-1.4.0_p0.ebuild           |  1 -
 ...ytorch-1.4.0_p0.ebuild => pytorch-1.6.0.ebuild} | 87 ++++++++++++++--------
 5 files changed, 96 insertions(+), 33 deletions(-)

diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-setup.patch 
b/sci-libs/pytorch/files/pytorch-1.6.0-setup.patch
new file mode 100644
index 000000000..6a197a907
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.6.0-setup.patch
@@ -0,0 +1,14 @@
+Index: pytorch-1.4.0_p0/setup.py
+===================================================================
+--- pytorch-1.4.0_p0.orig/setup.py
++++ pytorch-1.4.0_p0/setup.py
+@@ -288,9 +288,7 @@ def build_deps():
+             sys.exit(1)
+ 
+     check_file(os.path.join(third_party_path, "gloo", "CMakeLists.txt"))
+-    check_file(os.path.join(third_party_path, "pybind11", "CMakeLists.txt"))
+     check_file(os.path.join(third_party_path, 'cpuinfo', 'CMakeLists.txt'))
+-    check_file(os.path.join(third_party_path, 'tbb', 'Makefile'))
+     check_file(os.path.join(third_party_path, 'onnx', 'CMakeLists.txt'))
+     check_file(os.path.join(third_party_path, 'foxi', 'CMakeLists.txt'))
+     check_file(os.path.join(third_party_path, 'QNNPACK', 'CMakeLists.txt'))

diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-skip-tests.patch 
b/sci-libs/pytorch/files/pytorch-1.6.0-skip-tests.patch
new file mode 100644
index 000000000..3ef2c533f
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.6.0-skip-tests.patch
@@ -0,0 +1,14 @@
+Disable expected test failures.
+
+Reference: https://github.com/pytorch/pytorch/issues/13746
+Reference: https://github.com/pytorch/pytorch/issues/21873
+
+Index: pytorch-1.4.0_p0/caffe2/share/contrib/depthwise/CMakeLists.txt
+===================================================================
+--- pytorch-1.4.0_p0.orig/caffe2/share/contrib/depthwise/CMakeLists.txt
++++ pytorch-1.4.0_p0/caffe2/share/contrib/depthwise/CMakeLists.txt
+@@ -6,4 +6,3 @@ set(Caffe2_CONTRIB_DEPTHWISE3x3_TEST_CPU
+ )
+ 
+ set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} ${Caffe2_CONTRIB_DEPTHWISE3x3_CPU_SRC} 
PARENT_SCOPE)
+-set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} 
${Caffe2_CONTRIB_DEPTHWISE3x3_TEST_CPU_SRC} PARENT_SCOPE)

diff --git 
a/sci-libs/pytorch/files/pytorch-1.6.0-tensorpipe-unbundle-libuv.patch 
b/sci-libs/pytorch/files/pytorch-1.6.0-tensorpipe-unbundle-libuv.patch
new file mode 100644
index 000000000..a4ba38322
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.6.0-tensorpipe-unbundle-libuv.patch
@@ -0,0 +1,13 @@
+Index: tensorpipe/cmake/pytorch.cmake
+===================================================================
+--- tensorpipe.orig/cmake/pytorch.cmake
++++ tensorpipe/cmake/pytorch.cmake
+@@ -138,7 +138,7 @@ endif()
+ 
+ add_library(tensorpipe ${TENSORPIPE_SRC})
+ 
+-set(TP_BUILD_LIBUV ON)
++set(TP_BUILD_LIBUV OFF)
+ find_package(uv REQUIRED)
+ target_link_libraries(tensorpipe PRIVATE uv::uv)
+ 

diff --git a/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild 
b/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild
index e77582078..762608507 100644
--- a/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild
+++ b/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild
@@ -50,7 +50,6 @@ REQUIRED_USE="
 DEPEND="
        dev-libs/protobuf
        dev-python/pyyaml[${PYTHON_USEDEP}]
-       virtual/python-typing[${PYTHON_USEDEP}]
        atlas? ( sci-libs/atlas )
        cuda? ( dev-libs/cudnn
                dev-cpp/eigen[cuda] )

diff --git a/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild 
b/sci-libs/pytorch/pytorch-1.6.0.ebuild
similarity index 63%
copy from sci-libs/pytorch/pytorch-1.4.0_p0.ebuild
copy to sci-libs/pytorch/pytorch-1.6.0.ebuild
index e77582078..c59b248e2 100644
--- a/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild
+++ b/sci-libs/pytorch/pytorch-1.6.0.ebuild
@@ -12,34 +12,56 @@ MPV=${PV/_p/a}
 DESCRIPTION="Tensors and Dynamic neural networks in Python with strong GPU 
acceleration"
 HOMEPAGE="https://pytorch.org/";
 SRC_URI="https://github.com/pytorch/${PN}/archive/v${MPV}.tar.gz -> ${P}.tar.gz
-https://github.com/facebookincubator/gloo/archive/ca528e32.tar.gz -> 
gloo-ca528e32.tar.gz
-https://github.com/google/benchmark/archive/505be96a.tar.gz -> 
benchmark-505be96a.tar.gz
-https://github.com/google/gemmlowp/archive/3fb5c176.tar.gz -> 
gemmlowp-3fb5c176.tar.gz
-https://github.com/google/googletest/archive/2fe3bd99.tar.gz -> 
googletest-2fe3bd99.tar.gz
-https://github.com/houseroad/foxi/archive/8f74bc4d.tar.gz -> 
foxi-8f74bc4d.tar.gz
-https://github.com/intel/ideep/archive/78eafa5d.tar.gz -> ideep-78eafa5d.tar.gz
-https://github.com/Maratyszcza/FP16/archive/febbb1c1.tar.gz -> 
FP16-febbb1c1.tar.gz
-https://github.com/Maratyszcza/FXdiv/archive/b742d114.tar.gz -> 
FXdiv-b742d114.tar.gz
-https://github.com/Maratyszcza/NNPACK/archive/c039579a.tar.gz -> 
NNPACK-c039579a.tar.gz
-https://github.com/Maratyszcza/PeachPy/archive/07d8fde8.tar.gz -> 
PeachPy-07d8fde8.tar.gz
-https://github.com/Maratyszcza/psimd/archive/90a938f3.tar.gz -> 
psimd-90a938f3.tar.gz
-https://github.com/Maratyszcza/pthreadpool/archive/13da0b4c.tar.gz -> 
pthreadpool-13da0b4c.tar.gz
-cuda? ( https://github.com/NVIDIA/nccl/archive/7c72dee6.tar.gz -> 
nccl-7c72dee6.tar.gz )
-https://github.com/NVlabs/cub/archive/285aeeba.tar.gz -> cub-285aeeba.tar.gz
-https://github.com/onnx/onnx/archive/2891e145.tar.gz -> onnx-2891e145.tar.gz
-https://github.com/onnx/onnx-tensorrt/archive/cb3d8066.tar.gz -> 
onnx-tensorrt-cb3d8066.tar.gz
-https://github.com/pytorch/cpuinfo/archive/89fe1695.tar.gz -> 
cpuinfo-89fe1695.tar.gz
-https://github.com/pytorch/fbgemm/archive/82d259da.tar.gz -> 
fbgemm-82d259da.tar.gz
-https://github.com/pytorch/QNNPACK/archive/7d2a4e99.tar.gz -> 
QNNPACK-7d2a4e99.tar.gz
-https://github.com/shibatch/sleef/archive/7f523de6.tar.gz -> 
sleef-7f523de6.tar.gz
-https://github.com/asmjit/asmjit/archive/17556b2d.tar.gz -> 
asmjit-17556b2d.tar.gz
+https://github.com/google/benchmark/archive/505be96ab.tar.gz -> 
benchmark-505be96ab.tar.gz
+https://github.com/pytorch/cpuinfo/archive/63b254577.tar.gz -> 
cpuinfo-63b254577.tar.gz
+https://github.com/NVlabs/cub/archive/d106ddb99.tar.gz -> cub-d106ddb99.tar.gz
+https://github.com/pytorch/fbgemm/archive/87c378172.tar.gz -> 
fbgemm-87c378172.tar.gz
+https://github.com/fmtlib/fmt/archive/9bdd1596c.tar.gz -> fmt-9bdd1596c.tar.gz
+https://github.com/houseroad/foxi/archive/8015abb72.tar.gz -> 
foxi-8015abb72.tar.gz
+https://github.com/Maratyszcza/FP16/archive/4dfe081cf.tar.gz -> 
FP16-4dfe081cf.tar.gz
+https://github.com/Maratyszcza/FXdiv/archive/b408327ac.tar.gz -> 
FXdiv-b408327ac.tar.gz
+https://github.com/google/gemmlowp/archive/3fb5c176c.tar.gz -> 
gemmlowp-3fb5c176c.tar.gz
+https://github.com/facebookincubator/gloo/archive/3d08580f9.tar.gz -> 
gloo-3d08580f9.tar.gz
+https://github.com/google/googletest/archive/2fe3bd994.tar.gz -> 
googletest-2fe3bd994.tar.gz
+https://github.com/intel/ideep/archive/938cc6889.tar.gz -> 
ideep-938cc6889.tar.gz
+cuda? ( https://github.com/NVIDIA/nccl/archive/5949d96f3.tar.gz -> 
nccl-5949d96f3.tar.gz )
+https://github.com/Maratyszcza/NNPACK/archive/24b55303f.tar.gz -> 
NNPACK-24b55303f.tar.gz
+https://github.com/onnx/onnx/archive/a82c6a701.tar.gz -> onnx-a82c6a701.tar.gz
+https://github.com/onnx/onnx-tensorrt/archive/c15321141.tar.gz -> 
onnx-tensorrt-c15321141.tar.gz
+https://github.com/Maratyszcza/psimd/archive/072586a71.tar.gz -> 
psimd-072586a71.tar.gz
+https://github.com/Maratyszcza/pthreadpool/archive/029c88620.tar.gz -> 
pthreadpool-029c88620.tar.gz
+https://github.com/Maratyszcza/PeachPy/archive/07d8fde8a.tar.gz -> 
PeachPy-07d8fde8a.tar.gz
+https://github.com/pytorch/QNNPACK/archive/7d2a4e993.tar.gz -> 
QNNPACK-7d2a4e993.tar.gz
+https://github.com/shibatch/sleef/archive/7f523de65.tar.gz -> 
sleef-7f523de65.tar.gz
+https://github.com/pytorch/tensorpipe/archive/3b8089c9c.tar.gz -> 
tensorpipe-3b8089c9c.tar.gz
+https://github.com/google/XNNPACK/archive/1b354636b.tar.gz -> 
XNNPACK-1b354636b.tar.gz
+https://github.com/asmjit/asmjit/archive/9057aa30.tar.gz -> 
asmjit-9057aa30.tar.gz
        "
 
+# git clone [email protected]:pytorch/pytorch.git && cd pytorch
+# src_uri() {
+# join \
+#   <(git config --file .gitmodules --get-regexp url | sed -r -e 
's/^submodule.(.*).url (.*)/\1 \2/' -e 's,NNPACK_deps/,,' -e 
's/third-party/third_party/' | sort) \
+#   <(git submodule status | awk '{print $2 " " $1}' | sort) | \
+# while read path url hash; do
+#         [[ ${path} =~ 
(eigen|six|ios|neon2sse|protobuf|pybind11|enum34|tbb|zstd|fbjni) ]] && continue
+#         u=${url%.git}
+#         h=${hash#-}
+#         h=${h:0:8}
+#         echo "${u}/archive/${h}.tar.gz -> $(basename ${u})-${h}.tar.gz"
+# done
+# }
+# src_uri
+
+# git submodule update --init third_party/fbgemm && cd third_party/fbgemm
+# src_uri | grep asmjit
+# cd ../..
+
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64"
 
-IUSE="asan atlas cuda eigen +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkl 
mkldnn mpi namedtensor +nnpack numa +numpy +observers +openblas opencl opencv 
+openmp +python +qnnpack redis static tbb test tools zeromq"
+IUSE="asan atlas cuda eigen +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkl 
mkldnn mpi namedtensor +nnpack numa +numpy +observers +openblas opencl opencv 
+openmp +python +qnnpack redis static test tools zeromq"
 
 REQUIRED_USE="
        python? ( ${PYTHON_REQUIRED_USE} )
@@ -47,10 +69,9 @@ REQUIRED_USE="
        ^^ ( atlas eigen mkl openblas )
 "
 
-DEPEND="
+RDEPEND="
        dev-libs/protobuf
        dev-python/pyyaml[${PYTHON_USEDEP}]
-       virtual/python-typing[${PYTHON_USEDEP}]
        atlas? ( sci-libs/atlas )
        cuda? ( dev-libs/cudnn
                dev-cpp/eigen[cuda] )
@@ -71,11 +92,11 @@ DEPEND="
        redis? ( dev-db/redis )
        zeromq? ( net-libs/zeromq )
        eigen? ( dev-cpp/eigen )
+       dev-libs/libuv
 "
-RDEPEND="${DEPEND}"
 BDEPEND=""
 
-DEPEND="
+DEPEND="${RDEPEND}
        test? ( dev-python/pytest[${PYTHON_USEDEP}] )
        dev-python/setuptools[${PYTHON_USEDEP}]
        dev-cpp/tbb
@@ -87,9 +108,8 @@ DEPEND="
 "
 
 PATCHES=(
-       "${FILESDIR}"/${PN}-1.2.0-setup.patch
-       "${FILESDIR}"/${PN}-1.4.0-sleef.patch
-       "${FILESDIR}"/${PN}-1.4.0-skip-tests.patch
+       "${FILESDIR}"/${PN}-1.6.0-setup.patch
+       "${FILESDIR}"/${PN}-1.6.0-skip-tests.patch
        "${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.4.0.patch
        
"${FILESDIR}"/0003-Change-path-to-caffe2-build-dir-made-by-libtorch.patch
        
"${FILESDIR}"/0005-Change-library-directory-according-to-CMake-build.patch
@@ -98,7 +118,7 @@ PATCHES=(
 src_unpack() {
        default
 
-       mv -v ${PN}-${MPV} ${P} || die
+       [[ -d ${P} ]] || mv -v ${PN}-${MPV} ${P} || die
 }
 
 src_prepare() {
@@ -133,6 +153,9 @@ src_prepare() {
                cuda_src_prepare
                export CUDAHOSTCXX=$(cuda_gccdir)/g++
        fi
+
+       cd ../tensorpipe || die
+       eapply "${FILESDIR}"/${PN}-1.6.0-tensorpipe-unbundle-libuv.patch
 }
 
 src_configure() {
@@ -192,11 +215,11 @@ src_configure() {
        cmake-utils_src_configure
 
        if use python; then
-               CMAKE_BUILD_DIR=${BUILD_DIR} distutils-r1_src_configure
+               CMAKE_BUILD_DIR="${BUILD_DIR}" distutils-r1_src_configure
        fi
 
        # do not rerun cmake and the build process in src_install
-       sed '/RERUN/,+1d' -i ${BUILD_DIR}/build.ninja || die
+       sed '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die
 }
 
 src_compile() {

Reply via email to