diff options
-rwxr-xr-x | .SRCINFO | 25 | ||||
-rwxr-xr-x | PKGBUILD | 70 |
2 files changed, 43 insertions, 52 deletions
@@ -1,6 +1,6 @@ pkgbase = python-dlib-cuda pkgdesc = Dlib is a general purpose cross-platform C++ library designed using contract programming and modern C++ techniques. - pkgver = 19.16 + pkgver = 19.22 pkgrel = 1 url = http://www.dlib.net/ arch = x86_64 @@ -10,33 +10,26 @@ pkgbase = python-dlib-cuda makedepends = cudnn makedepends = libx11 makedepends = python - makedepends = python2 depends = cuda depends = cudnn depends = libx11 - optdepends = cblas: for BLAS support + depends = cblas + depends = lapack + depends = blas optdepends = giflib: for GIF support - optdepends = lapack: for LAPACK support optdepends = libjpeg-turbo: for JPEG support optdepends = libpng: for PNG support - optdepends = neon: for neon support optdepends = sqlite: for sqlite support - source = http://dlib.net/files/dlib-19.16.tar.bz2 - sha256sums = 37308406c2b1459a70f21ec2fd7bdc922277659534c708323cb28d6e8e4764a8 + optdepends = ccache-ext: for ccache support during compiling + optdepends = python-numpy: for running numpy based tests + source = http://dlib.net/files/dlib-19.22.tar.bz2 + sha256sums = 20b8aad5d65594a34e22f59abbf0bf89450cb4a2a6a8c3b9eb49c8308f51d572 pkgname = python-dlib-cuda depends = python depends = cuda depends = cudnn depends = libx11 - provides = python-dlib=19.16 + provides = python-dlib=19.22 conflicts = python-dlib -pkgname = python2-dlib-cuda - depends = python2 - depends = cuda - depends = cudnn - depends = libx11 - provides = python2-dlib=19.16 - conflicts = python2-dlib - @@ -7,64 +7,71 @@ # Contributor: p00h <p00hzone at gmail dot com> # Contributor: MichaĆ Walenciak <Kicer86 at gmail dot com> -pkgname=('python-dlib-cuda' 'python2-dlib-cuda') +pkgname=('python-dlib-cuda') _pkgname='dlib' -pkgver=19.16 +pkgver=19.22 pkgrel=1 pkgdesc="Dlib is a general purpose cross-platform C++ library designed using contract programming and modern C++ techniques." arch=('x86_64') url="http://www.dlib.net/" license=('Boost') -depends=('cuda' 'cudnn' 'libx11') -makedepends=('cmake' 'cuda' 'cudnn' 'libx11' 'python' 'python2') -optdepends=('cblas: for BLAS support' - 'giflib: for GIF support' - 'lapack: for LAPACK support' +depends=('cuda' + 'cudnn' + 'libx11' + 'cblas' + 'lapack' + 'blas') +makedepends=('cmake' 'cuda' 'cudnn' 'libx11' 'python') +optdepends=('giflib: for GIF support' 'libjpeg-turbo: for JPEG support' 'libpng: for PNG support' - 'neon: for neon support' - 'sqlite: for sqlite support') + 'sqlite: for sqlite support' + 'ccache-ext: for ccache support during compiling' + 'python-numpy: for running numpy based tests') source=("http://dlib.net/files/${_pkgname}-${pkgver}.tar.bz2") -sha256sums=('37308406c2b1459a70f21ec2fd7bdc922277659534c708323cb28d6e8e4764a8') +sha256sums=('20b8aad5d65594a34e22f59abbf0bf89450cb4a2a6a8c3b9eb49c8308f51d572') build() { cd "${srcdir}/${_pkgname}-${pkgver}" _compiler_opts=() # Detecting whether certain cpu optimisations can be made - if grep -q avx /proc/cpuinfo; then - _compiler_opts+=( '--yes' 'USE_AVX_INSTRUCTIONS' ) + # Note: from dlib version 19.17 the default is to enable all options, so this + # is a check if they need to be turned off + if ! grep -q avx /proc/cpuinfo; then + _compiler_opts+=( '--no' 'USE_AVX_INSTRUCTIONS' ) fi - if grep -q sse2 /proc/cpuinfo; then - _compiler_opts+=( '--yes' 'USE_SSE2_INSTRUCTIONS' ) + if ! grep -q sse2 /proc/cpuinfo; then + _compiler_opts+=( '--no' 'USE_SSE2_INSTRUCTIONS' ) fi - if grep -q sse4 /proc/cpuinfo; then - _compiler_opts+=( '--yes' 'USE_SSE4_INSTRUCTIONS' ) - fi - - # Checking if neon is installed - if [[ -f '/usr/lib/libneon.so' ]]; then - _compiler_opts+=( '--yes' 'USE_NEON_INSTRUCTIONS' ) + if ! grep -q sse4 /proc/cpuinfo; then + _compiler_opts+=( '--no' 'USE_SSE4_INSTRUCTIONS' ) fi # Preparing array of variables setting the compiler for CUDA and optionally # ccache support. # Code based on the dlib package found in the AUR. - # To enable ccache support you need to install the following package: - # https://github.com/pingplug/PKGBUILDs/tree/master/others/ccache-ext - _compiler_vars=( '--set' 'CUDA_HOST_COMPILER=/opt/cuda/bin/gcc' ) + _compiler_vars=() if [[ -f "/usr/lib/ccache/bin/nvcc-ccache" ]]; then _compiler_vars+=( '--set' 'CUDA_NVCC_EXECUTABLE=/usr/lib/ccache/bin/nvcc-ccache' ) - _compiler_vars+=( '--set' 'CUDA_HOST_COMPILER=/usr/lib/ccache/bin/gcc-7' ) + _compiler_vars+=( '--set' 'CUDA_HOST_COMPILER=/usr/lib/ccache/bin/gcc' ) + else + _compiler_vars+=( '--set' 'CUDA_HOST_COMPILER=/opt/cuda/bin/gcc' ) fi # Compiling for Python 3 python setup.py build "${_compiler_opts[@]}" "${_compiler_vars[@]}" +} + + +check() { + cd "${srcdir}/${_pkgname}-${pkgver}" - # Compiling for Python 2 - python2 setup.py build "${_compiler_opts[@]}" "${_compiler_vars[@]}" + # The PYTHONPATH is cleared to avoid custom user paths getting in the way + # of importing the right versions of packages + PYTHONPATH="" python setup.py test } package_python-dlib-cuda() { @@ -76,12 +83,3 @@ package_python-dlib-cuda() { python setup.py install --skip-build --prefix=/usr --root="${pkgdir}" --optimize=1 } -package_python2-dlib-cuda() { - depends=('python2' 'cuda' 'cudnn' 'libx11') - provides=("python2-dlib=$pkgver") - conflicts=('python2-dlib') - - cd "${srcdir}/${_pkgname}-${pkgver}" - python2 setup.py install --skip-build --prefix=/usr --root="${pkgdir}" --optimize=1 -} - |