[arch-commits] Commit in python-pytorch (4 files)
Sven-Hendrik Haase
svenstaro at archlinux.org
Sat Sep 16 23:10:00 UTC 2017
Date: Saturday, September 16, 2017 @ 23:09:59
Author: svenstaro
Revision: 258580
archrelease: copy trunk to community-x86_64
Added:
python-pytorch/repos/
python-pytorch/repos/community-x86_64/
python-pytorch/repos/community-x86_64/2334.patch
(from rev 258579, python-pytorch/trunk/2334.patch)
python-pytorch/repos/community-x86_64/PKGBUILD
(from rev 258579, python-pytorch/trunk/PKGBUILD)
------------+
2334.patch | 21 ++++++++++
PKGBUILD | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 141 insertions(+)
Copied: python-pytorch/repos/community-x86_64/2334.patch (from rev 258579, python-pytorch/trunk/2334.patch)
===================================================================
--- repos/community-x86_64/2334.patch (rev 0)
+++ repos/community-x86_64/2334.patch 2017-09-16 23:09:59 UTC (rev 258580)
@@ -0,0 +1,21 @@
+From 5e2b1b975bf758b67a190444a1d4a6f18c997095 Mon Sep 17 00:00:00 2001
+From: Mo Zhou <cdluminate at gmail.com>
+Date: Tue, 8 Aug 2017 09:58:23 +0000
+Subject: [PATCH] THD: add a missing header to fix build failure
+
+---
+ torch/lib/THD/base/ChannelUtils.hpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/torch/lib/THD/base/ChannelUtils.hpp b/torch/lib/THD/base/ChannelUtils.hpp
+index 563e68297e..e03e8bd132 100644
+--- a/torch/lib/THD/base/ChannelUtils.hpp
++++ b/torch/lib/THD/base/ChannelUtils.hpp
+@@ -5,6 +5,7 @@
+ #include <sys/types.h>
+ #include <cstdlib>
+ #include <cstdint>
++#include <functional>
+ #include <limits>
+ #include <string>
+ #include <system_error>
Copied: python-pytorch/repos/community-x86_64/PKGBUILD (from rev 258579, python-pytorch/trunk/PKGBUILD)
===================================================================
--- repos/community-x86_64/PKGBUILD (rev 0)
+++ repos/community-x86_64/PKGBUILD 2017-09-16 23:09:59 UTC (rev 258580)
@@ -0,0 +1,120 @@
+# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
+# Contributor: Stephen Zhang <zsrkmyn at gmail dot com>
+
+pkgbase="python-pytorch"
+pkgname=("python-pytorch" "python2-pytorch" "python-pytorch-cuda" "python2-pytorch-cuda")
+_pkgname="pytorch"
+pkgver=0.2.0
+pkgrel=1
+pkgdesc="Tensors and Dynamic neural networks in Python with strong GPU acceleration"
+arch=('x86_64')
+url="http://pytorch.org"
+license=('BSD')
+makedepends=('python' 'python-setuptools' 'python2' 'python2-setuptools'
+ 'python-yaml' 'python2-yaml' 'python-numpy' 'python2-numpy'
+ 'gcc5' 'cmake' 'cuda' 'cudnn')
+source=("https://github.com/pytorch/pytorch/archive/v${pkgver}.tar.gz"
+ 2334.patch)
+sha256sums=('b76d61aaa8fc18b928ca3c910c398687be08f5661d6615884c4faba3e8742a26'
+ '1933b0e73785cc3d24013815c79f36267380239f2cbf0561b7702e0d5af61daf')
+
+prepare() {
+ cd "${_pkgname}-${pkgver}"
+ sed -i -e '144icp -r nccl gloo/third-party/' torch/lib/build_all.sh
+ sed -i -e '470,475d' setup.py
+
+ patch -Np1 < ${srcdir}/2334.patch
+
+ cd ..
+
+ cp -a "${_pkgname}-${pkgver}" "${_pkgname}-${pkgver}-py2"
+ cp -a "${_pkgname}-${pkgver}" "${_pkgname}-${pkgver}-py3"
+ cp -a "${_pkgname}-${pkgver}" "${_pkgname}-${pkgver}-py2-cuda"
+ cp -a "${_pkgname}-${pkgver}" "${_pkgname}-${pkgver}-py3-cuda"
+}
+
+build() {
+ msg "Building Python 2 without cuda"
+ cd "$srcdir/${_pkgname}-${pkgver}-py2"
+ # Uncomment and modify the following line to enable Intel MKL and magma support
+ #CMAKE_PREFIX_PATH=/opt/intel/mkl/include:/opt/intel/mkl/lib/intel64:/opt/magma \
+ CFLAGS="${CFLAGS/-fno-plt/}" \
+ CXXFLAGS="${CFLAGS/-fno-plt/}" \
+ NO_CUDA=1 \
+ WITH_CUDA=0 \
+ WITH_CUDNN=0 \
+ python2 setup.py build
+
+ msg "Building Python 3 without cuda"
+ cd "$srcdir/${_pkgname}-${pkgver}-py3"
+ # Uncomment and modify the following line to enable Intel MKL and magma support
+ #CMAKE_PREFIX_PATH=/opt/intel/mkl/include:/opt/intel/mkl/lib/intel64:/opt/magma \
+ CFLAGS="${CFLAGS/-fno-plt/}" \
+ CXXFLAGS="${CFLAGS/-fno-plt/}" \
+ NO_CUDA=1 \
+ WITH_CUDA=0 \
+ WITH_CUDNN=0 \
+ python setup.py build
+
+ msg "Building Python 2 with cuda"
+ cd "$srcdir/${_pkgname}-${pkgver}-py2-cuda"
+ # Uncomment and modify the following line to enable Intel MKL and magma support
+ #CMAKE_PREFIX_PATH=/opt/intel/mkl/include:/opt/intel/mkl/lib/intel64:/opt/magma \
+ CC=gcc-5 \
+ CXX=g++-5 \
+ CFLAGS="${CFLAGS/-fno-plt/}" \
+ CXXFLAGS="${CFLAGS/-fno-plt/}" \
+ WITH_CUDA=1 \
+ CUDA_HOME=/opt/cuda \
+ WITH_CUDNN=1 \
+ CUDNN_LIB_DIR=/opt/cuda/lib64 \
+ CUDNN_INCLUDE_DIR=/opt/cuda/include \
+ python2 setup.py build
+
+ msg "Building Python 3 with cuda"
+ cd "$srcdir/${_pkgname}-${pkgver}-py3-cuda"
+ # Uncomment and modify the following line to enable Intel MKL and magma support
+ #CMAKE_PREFIX_PATH=/opt/intel/mkl/include:/opt/intel/mkl/lib/intel64:/opt/magma \
+ CC=gcc-5 \
+ CXX=g++-5 \
+ CFLAGS="${CFLAGS/-fno-plt/}" \
+ CXXFLAGS="${CFLAGS/-fno-plt/}" \
+ WITH_CUDA=1 \
+ CUDA_HOME=/opt/cuda \
+ WITH_CUDNN=1 \
+ CUDNN_LIB_DIR=/opt/cuda/lib64 \
+ CUDNN_INCLUDE_DIR=/opt/cuda/include \
+ python setup.py build
+}
+
+package_python2-pytorch() {
+ depends+=('python2' 'python2-yaml' 'python2-numpy')
+ cd "$srcdir/${_pkgname}-${pkgver}-py2"
+ python2 setup.py install --root="$pkgdir"/ --optimize=1 --skip-build
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+}
+
+package_python-pytorch() {
+ depends+=('python' 'python-yaml' 'python-numpy')
+ cd "$srcdir/${_pkgname}-${pkgver}-py3"
+ python setup.py install --root="$pkgdir"/ --optimize=1 --skip-build
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+}
+
+package_python2-pytorch-cuda() {
+ depends+=('python2' 'python2-yaml' 'python2-numpy')
+ optdepends=('cuda' 'cudnn')
+ cd "$srcdir/${_pkgname}-${pkgver}-py2-cuda"
+ python2 setup.py install --root="$pkgdir"/ --optimize=1 --skip-build
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+}
+
+package_python-pytorch-cuda() {
+ depends+=('python' 'python-yaml' 'python-numpy')
+ optdepends=('cuda' 'cudnn')
+ cd "$srcdir/${_pkgname}-${pkgver}-py3-cuda"
+ python setup.py install --root="$pkgdir"/ --optimize=1 --skip-build
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+}
+
+# vim:set ts=2 sw=2 et:
More information about the arch-commits
mailing list