summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtakar Jašek2019-03-14 12:18:34 +0100
committerOtakar Jašek2019-03-14 12:18:34 +0100
commit3ef0db490ab67512f20a5ed2207e95c01fe5ad01 (patch)
treea10060854e2625ca8f72efee67b514bfc21accfa
downloadaur-3ef0db490ab67512f20a5ed2207e95c01fe5ad01.tar.gz
First commit
-rw-r--r--.SRCINFO34
-rw-r--r--PKGBUILD84
2 files changed, 118 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..5a20d8fe2a99
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,34 @@
+pkgbase = faiss-cuda-git
+ pkgdesc = A library for efficient similarity search and clustering of dense vectors.
+ pkgver = v1.5.0.r17.g7b07685
+ pkgrel = 1
+ url = https://github.com/facebookresearch/faiss
+ arch = i686
+ arch = x86_64
+ license = BSD
+ depends = blas
+ depends = lapack
+ depends = cuda
+ source = faiss::git+https://github.com/facebookresearch/faiss.git
+ sha256sums = SKIP
+
+pkgname = faiss-cuda-git
+ provides = faiss
+ conflicts = faiss
+
+pkgname = python-faiss-cuda-git
+ depends = python
+ depends = python-setuptools
+ depends = python-numpy
+ depends = swig
+ provides = python-faiss
+ conflicts = python-faiss
+
+pkgname = python2-faiss-cuda-git
+ depends = python2
+ depends = python2-setuptools
+ depends = python2-numpy
+ depends = swig
+ provides = python2-faiss
+ conflicts = python2-faiss
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..91dcbd3d0bf2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,84 @@
+# Maintainer: otaj <jasek.ota@gmail.com>
+# If you want to set only one GPU target compute capability, set _GPU_TARGET, otherwise leave it commented out and it will build default targets (35, 52, 60 and 61)
+
+_GPU_TARGET=61
+_pkgname=faiss
+pkgbase=faiss-cuda-git
+pkgname=('faiss-cuda-git' 'python-faiss-cuda-git' 'python2-faiss-cuda-git')
+pkgdesc='A library for efficient similarity search and clustering of dense vectors.'
+arch=('i686' 'x86_64')
+url="https://github.com/facebookresearch/faiss"
+license=('BSD')
+pkgver=v1.5.0.r17.g7b07685
+pkgrel=1
+source=(${_pkgname}::git+https://github.com/facebookresearch/faiss.git)
+sha256sums=('SKIP')
+depends=('blas' 'lapack' 'cuda')
+
+pkgver() {
+ cd "${_pkgname}"
+ git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+
+prepare() {
+ cd "${srcdir}/${_pkgname}"
+ cp -ar python python2
+}
+
+
+build() {
+ cd "${srcdir}/${_pkgname}"
+ ./configure --prefix=/usr --with-cuda=/opt/cuda
+ if ! [ -z "$_GPU_TARGET" ]
+ then
+ sed -i "s/compute_[0-9][0-9]/compute_${_GPU_TARGET}/g" makefile.inc
+ sed -i '$!N; /^\(.*\)\n\1$/!P; D' makefile.inc
+ fi
+ make
+ make -C gpu
+}
+
+package_faiss-cuda-git() {
+ provides=('faiss')
+ conflicts=('faiss')
+ cd "${srcdir}/${_pkgname}"
+ make DESTDIR="$pkgdir" install
+ make -C gpu DESTDIR="$pkgdir" install
+}
+
+package_python-faiss-cuda-git() {
+ provides=('python-faiss')
+ conflicts=('python-faiss')
+ depends=('python' 'python-setuptools' 'python-numpy' 'swig')
+
+ cd "${srcdir}/${_pkgname}"
+ ./configure --prefix=/usr --with-python=python --with-cuda=/opt/cuda
+ if ! [ -z "$_GPU_TARGET" ]
+ then
+ sed -i "s/compute_[0-9][0-9]/compute_${_GPU_TARGET}/g" makefile.inc
+ sed -i '$!N; /^\(.*\)\n\1$/!P; D' makefile.inc
+ fi
+ cd python
+ make cpu
+ make gpu
+ python setup.py install --root="$pkgdir/" --optimize=1
+}
+
+package_python2-faiss-cuda-git() {
+ provides=('python2-faiss')
+ conflicts=('python2-faiss')
+ depends=('python2' 'python2-setuptools' 'python2-numpy' 'swig')
+
+ cd "${srcdir}/${_pkgname}"
+ ./configure --prefix=/usr --with-python=python2 --with-cuda=/opt/cuda
+ if ! [ -z "$_GPU_TARGET" ]
+ then
+ sed -i "s/compute_[0-9][0-9]/compute_${_GPU_TARGET}/g" makefile.inc
+ sed -i '$!N; /^\(.*\)\n\1$/!P; D' makefile.inc
+ fi
+ cd python2
+ make cpu
+ make gpu
+ python2 setup.py install --root="$pkgdir/" --optimize=1
+}