summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Zhang2017-03-16 03:50:01 +0800
committerStephen Zhang2017-03-16 03:50:01 +0800
commitbdf7526bbe985454c03997d750e8c00234dfa85d (patch)
treef9e6a893d65f2b1b04a2947d4f70f22e7e650784
downloadaur-bdf7526bbe985454c03997d750e8c00234dfa85d.tar.gz
initial commit
-rw-r--r--.SRCINFO33
-rw-r--r--PKGBUILD76
2 files changed, 109 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..9191010d59e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,33 @@
+# Generated by mksrcinfo v8
+# Wed Mar 15 19:48:33 UTC 2017
+pkgbase = python-pytorch-git
+ pkgdesc = Tensors and Dynamic neural networks in Python with strong GPU acceleration
+ pkgver = 0.1.10.r46.gbe6322e4
+ pkgrel = 1
+ url = https://github.com/pytorch/pytorch
+ arch = x86_64
+ license = BSD
+ makedepends = python
+ makedepends = python-setuptools
+ makedepends = python2
+ makedepends = python2-setuptools
+ makedepends = gcc5
+ source = git://github.com/pytorch/pytorch
+ sha256sums = SKIP
+
+pkgname = python-pytorch-git
+ depends =
+ depends = python
+ depends = python-ymal
+ depends = python-numpy
+ provides = python-pytorch
+ conflicts = python-pytorch
+
+pkgname = python2-pytorch-git
+ depends =
+ depends = python2
+ depends = python2-ymal
+ depends = python2-numpy
+ provides = python2-pytorch
+ conflicts = python2-pytorch
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..030a9eeee98
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,76 @@
+# Maintainer: Stephen Zhang <zsrkmyn at gmail dot com>
+
+pkgbase="python-pytorch-git"
+pkgname=("python-pytorch-git" "python2-pytorch-git")
+_pkgname="pytorch"
+pkgver=0.1.10.r46.gbe6322e4
+pkgrel=1
+pkgdesc="Tensors and Dynamic neural networks in Python with strong GPU acceleration"
+arch=('x86_64')
+url="https://github.com/pytorch/pytorch"
+license=('BSD')
+makedepends=('python' 'python-setuptools' 'python2' 'python2-setuptools' 'gcc5')
+depennds=('cuda' 'cudnn')
+source=("git://github.com/pytorch/pytorch")
+sha256sums=('SKIP')
+
+pkgver () {
+ cd "${_pkgname}"
+ (
+ set -o pipefail
+ git describe --tag 2>/dev/null | sed -e 's/\([^-]*-g\)/r\1/;s/-/./g' -e 's/^v//g'
+ )
+}
+
+
+prepare() {
+ cd "$srcdir/"
+ cp -a "${_pkgname}" "${_pkgname}-py2"
+ cd "${_pkgname}"
+ sed -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
+ -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
+ -e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
+ -i $(find . -name '*.py')
+}
+
+build() {
+ msg "Building Python 2"
+ cd "$srcdir/${_pkgname}-py2"
+ CC=gcc-5 \
+ 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"
+ cd "$srcdir/${_pkgname}"
+ CC=gcc-5 \
+ 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-git() {
+ conflicts=('python2-pytorch')
+ provides=('python2-pytorch')
+ depends+=('python2' 'python2-ymal' 'python2-numpy')
+ cd "$srcdir/${_pkgname}-py2"
+ python2 setup.py install --root="$pkgdir"/ --optimize=1
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+}
+
+package_python-pytorch-git() {
+ conflicts=('python-pytorch')
+ provides=('python-pytorch')
+ depends+=('python' 'python-ymal' 'python-numpy')
+ cd "$srcdir/${_pkgname}"
+ python setup.py install --root="$pkgdir"/ --optimize=1
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+}
+
+# vim:set ts=2 sw=2 et: