diff options
author | Godisemo | 2017-02-14 11:25:43 +0100 |
---|---|---|
committer | Godisemo | 2017-02-14 11:25:43 +0100 |
commit | 8a64e493819927d4ca8ce152d13632e2bcdb5cb9 (patch) | |
tree | 43eba848d7a4e7724ac3bf0fa8cb74f061a1a4be | |
parent | 0d8e3b427e3ef8d5ff4d5728a44dabeb09f05461 (diff) | |
download | aur-8a64e493819927d4ca8ce152d13632e2bcdb5cb9.tar.gz |
Better dependency handling
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 39 |
2 files changed, 36 insertions, 11 deletions
@@ -5,8 +5,12 @@ pkgbase = mxnet url = http://mxnet.io/ arch = x86_64 license = Apache2 - depends = cuda - depends = cudnn + makedepends = git + optdepends = cuda: GPU support + optdepends = cudnn: GPU support + optdepends = intel-mkl: MKL support + optdepends = opencv: computer vision support + provides = libmxnet source = mxnet::git+https://github.com/dmlc/mxnet md5sums = SKIP @@ -6,22 +6,44 @@ pkgdesc="Flexible and Efficient Library for Deep Learning" arch=('x86_64') url="http://mxnet.io/" license=('Apache2') -depends=(cuda cudnn) -# makedepends=() +depends=() +optdepends=('cuda: GPU support' + 'cudnn: GPU support' + 'intel-mkl: MKL support' + 'opencv: computer vision support') +makedepends=(git) # checkdepends=() -# optdepends=() -# provides=() +provides=(libmxnet) source=("$pkgname::git+https://github.com/dmlc/mxnet") md5sums=('SKIP') prepare() { - cd "$pkgname" + cd "$srcdir/$pkgname" git checkout "v$pkgver" git submodule update --init --recursive cp make/config.mk . - echo "USE_CUDA=1" >>config.mk - echo "USE_CUDA_PATH=/opt/cuda" >>config.mk - echo "USE_CUDNN=1" >>config.mk + if (pacman -Q cuda &>/dev/null && pacman -Q cudnn &>/dev/null); then + msg2 "CUDA support enabled" + echo "USE_CUDA=1" >>config.mk + echo "USE_CUDA_PATH=/opt/cuda" >>config.mk + echo "USE_CUDNN=1" >>config.mk + else + msg2 "CUDA support disabled" + fi + if (pacman -Q intel-mkl &>/dev/null); then + msg2 "MKL support enabled" + echo "USE_BLAS=mkl" >>config.mk + echo "USE_INTEL_PATH=/opt/intel/composerxe/linux" >>config.mk + echo "USE_STATIC_MKL=1" >>config.mk + else + msg2 "MKL support disabled" + fi + if (pacman -Q opencv &>/dev/null); then + msg2 "OpenCV support enabled" + else + msg2 "OpenCV support disabled" + echo "USE_OPENCV=0" >>config.mk + fi } build() { @@ -33,4 +55,3 @@ package() { cd "$pkgdir" install -D "$srcdir/$pkgname/lib/libmxnet.so" "$pkgdir/usr/lib/libmxnet.so" } - |