summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2017-06-15 20:40:58 -0300
committerDaniel Bermond2017-06-15 20:40:58 -0300
commit7763c6338fffb7b14d658807338904a7b59e0992 (patch)
treec195772b472c502c026bed21808a3b87ccfe238c
parentec8b04ae392bbb0f19404ef514aefcbcc1913534 (diff)
downloadaur-7763c6338fffb7b14d658807338904a7b59e0992.tar.gz
Added nnpack support
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD18
-rw-r--r--external-nnpack-fix.patch24
3 files changed, 47 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index aaf79c914638..aaf2d3e1aa46 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,18 @@
# Generated by mksrcinfo v8
-# Thu Jun 15 22:48:25 UTC 2017
+# Thu Jun 15 23:40:35 UTC 2017
pkgbase = caffe2
pkgdesc = A new lightweight, modular, and scalable deep learning framework (gpu enabled)
pkgver = 0.7.0
- pkgrel = 9
+ pkgrel = 10
url = http://caffe2.ai/
arch = x86_64
license = BSD
+ makedepends = git
makedepends = cmake
makedepends = gcc5
+ makedepends = ninja
+ makedepends = confu-git
+ makedepends = python-peachpy-git
depends = google-glog
depends = protobuf
depends = python2
@@ -54,6 +58,7 @@ pkgbase = caffe2
noextract = thirdparty-protobuf-3.1.0.tar.gz
options = !emptydirs
source = caffe2-0.7.0.tar.gz::https://github.com/caffe2/caffe2/archive/v0.7.0.tar.gz
+ source = external-nnpack-fix.patch
source = thirdparty-android-cmake-git::git+https://github.com/taka-no-me/android-cmake.git#commit=556cc14296c226f753a3778d99d8b60778b7df4f
source = thirdparty-benchmark-git::git+https://github.com/google/benchmark.git#commit=4bf28e611b55de8a2d4eece3c335e014f8b0f630
source = thirdparty-cnmem-git::git+https://github.com/NVIDIA/cnmem.git#commit=28a182d49529da49f4ac4e3941cec3edf16b3540
@@ -72,6 +77,7 @@ pkgbase = caffe2
source = thirdparty-NNPACK_deps-psimd-git::git+https://github.com/Maratyszcza/psimd.git#commit=0b26a3fb98dd6af7e1f4e0796c56df6b32b1c016
source = thirdparty-NNPACK_deps-pthreadpool-git::git+https://github.com/Maratyszcza/pthreadpool.git#commit=9e17903a3fc963fe86b151aaddae7cf1b1d34815
sha256sums = b8f266ed283efc172fa96c06c878ed7f125755f89cde480580b754c1f03c0bab
+ sha256sums = 1c94a1ecc0fe2a52c50c9d1a7bfca655d60c08d48995b27c73aa22b6c375da54
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index 35d2021c95b5..46fb2aea0cdc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -23,7 +23,7 @@ _protobuf_version='3.1.0' # commit 'a428e42072765993ff674fda72863c9f1aa2d268' is
pkgname=caffe2
pkgver=0.7.0
-pkgrel=9
+pkgrel=10
pkgdesc='A new lightweight, modular, and scalable deep learning framework (gpu enabled)'
arch=('x86_64')
url='http://caffe2.ai/'
@@ -49,13 +49,19 @@ depends=(
# missing:
# 'python2-nvd3'
)
-makedepends=('cmake' 'gcc5')
+makedepends=(
+ # official repositories:
+ 'git' 'cmake' 'gcc5' 'ninja'
+ # AUR:
+ 'confu-git' 'python-peachpy-git'
+)
conflicts=('caffe' 'caffe-cpu' 'caffe-git' 'caffe-cpu-git'
'caffe2-git' 'caffe2-cpu' 'caffe2-cpu-git')
options=('!emptydirs')
source=(
# main source:
"${pkgname}-${pkgver}.tar.gz"::"https://github.com/${pkgname}/${pkgname}/archive/v${pkgver}.tar.gz"
+ 'external-nnpack-fix.patch'
# third party:
'thirdparty-android-cmake-git'::"git+https://github.com/taka-no-me/android-cmake.git#commit=${_android_cmake_commit}"
'thirdparty-benchmark-git'::"git+https://github.com/google/benchmark.git#commit=${_benchmark_commit}"
@@ -78,6 +84,7 @@ source=(
noextract=("thirdparty-eigen-${_eigen_version}.tar.gz"
"thirdparty-protobuf-${_protobuf_version}.tar.gz")
sha256sums=('b8f266ed283efc172fa96c06c878ed7f125755f89cde480580b754c1f03c0bab'
+ '1c94a1ecc0fe2a52c50c9d1a7bfca655d60c08d48995b27c73aa22b6c375da54'
'SKIP'
'SKIP'
'SKIP'
@@ -126,6 +133,11 @@ prepare() {
done
unset _component
+
+ # avoid compile errors with nnpack if system library is found
+ # https://github.com/caffe2/caffe2/pull/808
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i "${srcdir}/external-nnpack-fix.patch"
}
build() {
@@ -193,7 +205,7 @@ build() {
-DUSE_MPI:BOOL=ON \
-DUSE_NCCL:BOOL=ON \
-DUSE_NERVANA_GPU:BOOL=ON \
- -DUSE_NNPACK:BOOL=OFF \
+ -DUSE_NNPACK:BOOL=ON \
-DUSE_OPENCV:BOOL=OFF \
-DUSE_OPENMP:BOOL=ON \
-DUSE_REDIS:BOOL=ON \
diff --git a/external-nnpack-fix.patch b/external-nnpack-fix.patch
new file mode 100644
index 000000000000..08a4e0c4ca29
--- /dev/null
+++ b/external-nnpack-fix.patch
@@ -0,0 +1,24 @@
+diff --git a/cmake/Modules/FindNNPACK.cmake b/cmake/Modules/FindNNPACK.cmake
+index 547bf88f..29cf5dce 100644
+--- a/cmake/Modules/FindNNPACK.cmake
++++ b/cmake/Modules/FindNNPACK.cmake
+@@ -21,12 +21,17 @@ find_library(NNPACK_LIBRARY nnpack
+ PATHS ${NNPACK_ROOT_DIR}
+ PATH_SUFFIXES lib lib64)
+
+-find_package_handle_standard_args(NNPACK DEFAULT_MSG NNPACK_INCLUDE_DIR NNPACK_LIBRARY)
++find_library(PTHREADPOOL_LIBRARY pthreadpool
++ PATHS ${NNPACK_ROOT_DIR}
++ PATH_SUFFIXES lib lib64)
++
++find_package_handle_standard_args(NNPACK DEFAULT_MSG NNPACK_INCLUDE_DIR NNPACK_LIBRARY PTHREADPOOL_LIBRARY)
+
+ if(NNPACK_FOUND)
+ set(NNPACK_INCLUDE_DIRS ${NNPACK_INCLUDE_DIR})
+- set(NNPACK_LIBRARIES ${NNPACK_LIBRARY})
++ set(NNPACK_LIBRARIES ${NNPACK_LIBRARY} ${PTHREADPOOL_LIBRARY})
+ message(STATUS "Found NNPACK (include: ${NNPACK_INCLUDE_DIR}, library: ${NNPACK_LIBRARY})")
++ message(STATUS "Found PTHREADPOOL (library: ${PTHREADPOOL_LIBRARY})")
+ mark_as_advanced(NNPACK_ROOT_DIR NNPACK_LIBRARY_RELEASE NNPACK_LIBRARY_DEBUG
+ NNPACK_LIBRARY NNPACK_INCLUDE_DIR)
+ endif()