Package Details: flann 1.9.1-7

Git Clone URL: (read-only, click to copy)
Package Base: flann
Description: FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces
Upstream URL:
Licenses: BSD
Submitter: None
Maintainer: acxz
Last Packager: acxz
Votes: 44
Popularity: 0.22
First Submitted: 2011-04-05 02:06
Last Updated: 2020-04-19 05:05

Pinned Comments

acxz commented on 2020-02-03 02:07

Development is on Github: Please open issues and PRs there instead of commenting.

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 Next › Last »

kartikmohta commented on 2018-01-09 21:20

flann since v1.8.5 includes a local copy of the lz4 library (in src/cpp/ext). The version included is 1.7.1 while the system version in Arch is 1.8.0. This causes problems in an application using both flann and lz4 due to some API changes in the upstream lz4. I get the following error:

In file included from /usr/include/flann/flann.hpp:41:
In file included from /usr/include/flann/util/matrix.h:35:
In file included from /usr/include/flann/util/serialization.h:9:
/usr/include/flann/ext/lz4.h:249:72: error: typedef redefinition with different types ('struct LZ4_streamDecode_t' vs 'union LZ4_streamDecode_u')
typedef struct { unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t;
/usr/include/lz4.h:280:34: note: previous definition is here
typedef union LZ4_streamDecode_u LZ4_streamDecode_t;   /* incomplete type (defined later) */

This can be avoided by using the system version of lz4 in flann but that requires quite a few changes in the src/cpp/CMakeLists.txt. There is an issue on github reporting this but it hasn't got any replies.

racko commented on 2018-01-05 14:49

I did my best. Here are some notes regarding the update to version 1.9.1-1:

- Added -DBUILD_TESTS=OFF to cmake options because there was no check()
- removed flann-1.8.4-gcc6.patch, since the issue has been fixed
- removed the lib64 -> lib sed call because it is not necessary anymore
- removed the sed calls for the *.cu files because we do not compile the
cuda lib
- Attempted to add a check() function, but the "LshIndex_*" tests are
known to fail: <>
- Attempted to enable BUILD_CUDA_LIB=ON but thrust::gather, used in, has been removed in Thrust v1.4.0 (current is

Svenstaro commented on 2017-11-13 18:06

This has been flagged OOD for a long time. Orphaning this package. Somebody take over.

patrick.luehne commented on 2017-11-13 17:55

I’ve brought this PKGBUILD to 1.9.1, as included below. Note that the patch for GCC 6 doesn’t seem necessary anymore, which is why I removed it.

# Maintainer: Sven-Hendrik Haase <>
# Maintainer: Javier Fuentes <>
# Contributor: Figo.zhang <>
# Contributor: hauptmech

pkgdesc="FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces"
arch=('i686' 'x86_64')
makedepends=('cmake' 'python2')
optdepends=('python2: python bindings'
'cuda: cuda support')

build() {
cd "$srcdir/${pkgname}-${pkgver}"

sed -i 's/lib64/lib/g' cmake/flann_utils.cmake

sed -i '1 i #undef _GLIBCXX_ATOMIC_BUILTINS' src/cpp/flann/algorithms/
sed -i '1 i #undef _GLIBCXX_USE_INT128' src/cpp/flann/algorithms/

sed -i 's|#!/usr/bin/env python|#!/usr/bin/python2|' \
bin/ \
bin/ \
src/python/ \
test/ \
test/ \
test/ \
test/ \

sed -i 's|#!/usr/bin/python|#!/usr/bin/python2|' \
test/ \

sed -i "s|setup\.py install| install --root=$pkgdir --optimize=1|" src/python/CMakeLists.txt

[[ -d build ]] && rm -r build
mkdir build && cd build
cmake .. \
-DPYTHON_EXECUTABLE=/usr/bin/python2 \

package() {
cd "$srcdir/${pkgname}-${pkgver}"

cd build
make DESTDIR="$pkgdir" install

#install license file
install -D -m644 ../COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

# FIXME: awful hack, but I got this error without the fix:
# running install_lib
# copying build/lib/pyflann/ -> /usr/lib/python2.7/site-packages/pyflann
# error: /usr/lib/python2.7/site-packages/pyflann/ Permission denied
_python2libpath="`python2 -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" | tr -d '\n'`"
mkdir -p "${pkgdir}${_python2libpath}"
cp -pr "${pkgdir}/usr/share/flann/python/pyflann" "${pkgdir}${_python2libpath}/pyflann"


patrick.luehne commented on 2017-11-13 17:43

Dear maintainers,

FLANN moved to GitHub and the new version 1.9.1 has been out there for over a year now … [1]

Please update this PKGBUILD soon :). 1.8.4 seems to be almost five years old by now!



puppieeesss commented on 2017-08-27 00:54

Thanks @wdna, those changes worked for me!
5 modifications in PKGBUILD:


build() {
cd "$srcdir/flann-${pkgver}"

package() {
cd "$srcdir/flann-${pkgver}"

wdna commented on 2017-08-21 11:47

Can we update this package to 1.8.5, and removing need for patch at all?
I've tested build it it seems to work just fine (, and remove '-src' prefix on directory).

zootboy commented on 2017-08-11 00:29

The patch URL 404s, it seems to have changed to:

However, the package seemed to compile OK on my system without the patch, so maybe it's not needed?

ncoder-2 commented on 2017-03-07 01:10

Would it be possible to update the PKGBUILD to build on 'any' (it works on aarch64 and armv7h)?

scummos commented on 2016-11-04 15:53

Needs to build-depend on extra/hdf5-cpp-fortran.