Guest User

Untitled

a guest
Apr 18th, 2018
144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Maintainer: Lev Velykoivanenko <velykoivanenko dot lev at gmail dot com>
  2. # Contributor: Adam Gradzki <adam at mm dot st> (previous maintainer)
  3. # Contributor: Flávio Zavan <flavio dot zavan at gmail dot com>
  4. # Contributor: pingplug
  5. # Contributor: perlawk
  6. # Contributor: xsmile
  7.  
  8. pkgname=('python-dlib-cuda' 'python2-dlib-cuda')
  9. _pkgname='dlib'
  10. pkgver=19.10
  11. pkgrel=1
  12. pkgdesc="Dlib is a general purpose cross-platform C++ library designed using contract programming and modern C++ techniques."
  13. arch=('any')
  14. url="http://www.dlib.net/"
  15. license=('Boost Software License')
  16. makedepends=('cmake' 'boost' 'cuda' 'gcc6' 'python' 'python2' 'cudnn')
  17. optdepends=('cblas: for BLAS support'
  18. 'lapack: for LAPACK support'
  19. 'libjpeg-turbo: for JPEG support'
  20. 'libpng: for PNG support'
  21. 'sqlite: for sqlite support')
  22. source=('http://dlib.net/files/dlib-19.10.tar.bz2')
  23. md5sums=('800e83d66fddc5a4387eba6b69374388')
  24.  
  25. # Detecting whether certain cpu optimisations can be made
  26. avx_available=()
  27. if grep -q avx /proc/cpuinfo; then
  28. avx_available=( '--yes' 'USE_AVX_INSTRUCTIONS' )
  29. fi
  30.  
  31. sse2_available=()
  32. if grep -q sse2 /proc/cpuinfo; then
  33. sse2_available=( '--yes' 'USE_SSE2_INSTRUCTIONS' )
  34. fi
  35.  
  36. sse4_available=()
  37. if grep -q sse4 /proc/cpuinfo; then
  38. sse4_available=( '--yes' 'USE_SSE4_INSTRUCTIONS' )
  39. fi
  40.  
  41. build() {
  42. cd "${srcdir}/${_pkgname}-${pkgver}"
  43.  
  44. # Exporting compiler environment variables
  45. # This is necessary to get cuda support
  46. export CC=`which gcc-6`
  47. export CXX=`which g++-6`
  48.  
  49. # Compiling for Python 3
  50. python setup.py build -j $(nproc) "${avx_available[@]}" "${sse2_available[@]}" "${sse4_available[@]}" --yes DLIB_USE_CUDA
  51.  
  52. # Compiling for Python 2
  53. python2 setup.py build "${avx_available[@]}" "${sse2_available[@]}" "${sse4_available[@]}" --yes DLIB_USE_CUDA
  54. }
  55.  
  56. package_python-dlib-cuda() {
  57. depends=('python')
  58.  
  59. cd "${srcdir}/${_pkgname}-${pkgver}"
  60. python setup.py install --skip-build --prefix=/usr --root="$pkgdir" --optimize=1
  61. }
  62.  
  63. package_python2-dlib-cuda() {
  64. depends=('python2')
  65.  
  66. cd "${srcdir}/${_pkgname}-${pkgver}"
  67. python2 setup.py install --skip-build --prefix=/usr --root="$pkgdir" --optimize=1
  68. }
RAW Paste Data