summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2017-03-18 23:46:36 -0300
committerDaniel Bermond2017-03-18 23:46:36 -0300
commit7dee8850e0a635d7e860836fa46062c6724e36fc (patch)
tree4c70a4458f1c9ac85fcc7a4b50b4bd1018796c7d
downloadaur-7dee8850e0a635d7e860836fa46062c6724e36fc.tar.gz
Initial commit
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD65
2 files changed, 87 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..6695d026e89
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+# Generated by mksrcinfo v8
+# Sun Mar 19 02:46:03 UTC 2017
+pkgbase = tiny-dnn-git
+ pkgdesc = A C++11 implementation of deep learning for limited computational resource, embedded systems and IoT devices
+ pkgver = 1.0.0a3.r73.gb89239c
+ pkgrel = 1
+ url = https://github.com/tiny-dnn/tiny-dnn
+ arch = any
+ license = BSD
+ makedepends = git
+ makedepends = cmake
+ makedepends = protobuf
+ makedepends = intel-tbb
+ makedepends = opencl-icd-loader
+ makedepends = opencl-headers
+ provides = tiny-dnn
+ conflicts = tiny-dnn
+ source = tiny-dnn-git::git+https://github.com/tiny-dnn/tiny-dnn.git
+ sha256sums = SKIP
+
+pkgname = tiny-dnn-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..398ce64ca8a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,65 @@
+# Maintainer : Daniel Bermond < yahoo-com: danielbermond >
+
+pkgname=tiny-dnn-git
+pkgver=1.0.0a3.r73.gb89239c
+pkgrel=1
+pkgdesc="A C++11 implementation of deep learning for limited computational resource, embedded systems and IoT devices"
+arch=('any')
+url="https://github.com/tiny-dnn/tiny-dnn"
+license=('BSD')
+makedepends=('git' 'cmake' 'protobuf' 'intel-tbb' 'opencl-icd-loader' 'opencl-headers')
+provides=('tiny-dnn')
+conflicts=('tiny-dnn')
+source=("${pkgname}"::"git+https://github.com/tiny-dnn/tiny-dnn.git")
+sha256sums=('SKIP')
+
+pkgver() {
+ cd "${srcdir}/${pkgname}"
+
+ # git, tags available
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//'
+}
+
+build() {
+ cd "${pkgname}"
+
+ # set CPU options
+ if [ "$CARCH" = "x86_64" ]
+ then
+ # get CPU flags (contains supported CPU instruction sets)
+ _cpuflags="$(grep -m1 'flags' /proc/cpuinfo | sed 's/^flags[[:space:]]*:[[:space:]]//')"
+
+ # check if optional instructions are supported by the CPU
+ { printf "%s" "$_cpuflags" | grep -q 'avx' && _avx="-DUSE_AVX:BOOL=ON" ; } || _avx="-DUSE_AVX:BOOL=OFF"
+ { printf "%s" "$_cpuflags" | grep -q 'avx2' && _avx2="-DUSE_AVX2:BOOL=ON" ; } || _avx2="-DUSE_AVX2:BOOL=OFF"
+
+ _cpuopts="-DUSE_SSE:BOOL=ON ${_avx} ${_avx2}"
+ else
+ _cpuopts="-DUSE_SSE:BOOL=OFF -DUSE_AVX:BOOL=OFF -DUSE_AVX2:BOOL=OFF"
+ fi
+
+ cmake \
+ -DCMAKE_BUILD_TYPE:STRING=Release \
+ -DCMAKE_COLOR_MAKEFILE:BOOL=ON \
+ -DCMAKE_INSTALL_PREFIX:PATH="/usr" \
+ -DUSE_TBB=ON \
+ -DUSE_OMP:BOOL=OFF \
+ $_cpuopts \
+ -DUSE_DOUBLE:BOOL=ON \
+ -DUSE_NNPACK:BOOL=OFF \
+ -DUSE_OPENCL:BOOL=ON \
+ -DUSE_LIBDNN:BOOL=OFF \
+ -DUSE_SERIALIZER:BOOL=ON \
+ -DBUILD_TESTS:BOOL=OFF \
+ -DBUILD_EXAMPLES:BOOL=OFF \
+ -DBUILD_DOCS:BOOL=OFF \
+ -Wno-dev \
+ .
+ make
+}
+
+package() {
+ cd "${pkgname}"
+ make DESTDIR="${pkgdir}" install
+ install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}