Skip to content

Instantly share code, notes, and snippets.

@chengscott
Created October 21, 2023 04:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chengscott/d279f3f898f0c09921b598cf38a9f889 to your computer and use it in GitHub Desktop.
Save chengscott/d279f3f898f0c09921b598cf38a9f889 to your computer and use it in GitHub Desktop.
python-apex-git
# Maintainer: Leo Mao <leomaoyw at gmail dot com>
pkgname=python-apex-git
_pkgname=apex
pkgver=23.08
pkgrel=1
pkgdesc="A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch"
arch=('x86_64')
url="https://github.com/NVIDIA/apex"
_github='NVIDIA/apex'
license=('BSD')
depends=('python' 'cuda' 'python-pytorch-cuda' 'python-sympy')
makedepends=('git' 'numactl' 'python-setuptools' 'python-pip')
provides=('python-apex')
conflicts=('python-apex')
source=("$_pkgname"::"git+$url#tag=${pkgver}")
sha256sums=('SKIP')
pkgver () {
cd "$srcdir/${_pkgname}"
git describe --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
}
build() {
cd "$srcdir/${_pkgname}"
CC=/opt/cuda/bin/gcc CXX=/opt/cuda/bin/g++ \
python setup.py build --cuda_ext --cpp_ext
}
package() {
cd "$srcdir/${_pkgname}"
CC=/opt/cuda/bin/gcc CXX=/opt/cuda/bin/g++ \
python setup.py install --cuda_ext --cpp_ext --root="$pkgdir"/ --optimize=1
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
# vim:set ts=2 sw=2 et:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment