blob: 56ccdbdcada1d6d050aea03390713222c17fed69 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# 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). You can also set multiple targets separated by semicolon
#_GPU_TARGET="75"
_pkgname=faiss
pkgbase=faiss-cuda-git
pkgname=('faiss-cuda-git' 'python-faiss-cuda-git')
arch=('i686' 'x86_64')
url="https://github.com/facebookresearch/faiss"
license=('MIT')
pkgver=v1.6.1.r87.gc97f890
pkgrel=1
source=(${_pkgname}::git+https://github.com/facebookresearch/faiss.git
'compiler.patch')
sha256sums=('SKIP'
'3739947d39ebffb2775607f135743cd30489aa12f41c14e3aec42fbe79822fd3')
depends=('blas' 'lapack' 'cuda')
makedepends=('git' 'python' 'python-numpy' 'swig' 'python-setuptools' 'openmp' 'gcc9')
optdepends=('intel-mkl')
pkgver() {
cd "${_pkgname}"
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "${srcdir}/${_pkgname}"
patch -p1 < ../compiler.patch
mkdir -p build
cd build
_CMAKE_FLAGS="-DFAISS_ENABLE_GPU=ON -DFAISS_ENABLE_PYTHON=ON -DCUDAToolkit_ROOT=/opt/cuda -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr "
if ! [ -z "$_GPU_TARGET" ]
then
$_CMAKE_FLAGS=$_CMAKE_FLAGS"-DCMAKE_CUDA_ARCHITECTURES=\""$_GPU_TARGET"\""
fi
cmake $_CMAKE_FLAGS ..
}
build() {
cd "${srcdir}/${_pkgname}/build"
make
}
package_faiss-cuda-git() {
pkgdesc='A library for efficient similarity search and clustering of dense vectors, CUDA version.'
provides=('faiss')
conflicts=('faiss')
cd "${srcdir}/${_pkgname}/build"
make DESTDIR="$pkgdir" install
cd ..
install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
package_python-faiss-cuda-git() {
pkgdesc='A library for efficient similarity search and clustering of dense vectors, CUDA version. Python wrappers'
provides=('python-faiss')
conflicts=('python-faiss')
depends=('python' 'python-numpy')
cd "${srcdir}/${_pkgname}/build/faiss/python"
python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
cd ../../..
install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|