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.96
First Submitted: 2011-04-05 02:06
Last Updated: 2020-04-19 05:05

Dependencies (7)

Required by (14)

Sources (1)

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

1 2 3 4 5 6 Next › Last »

flipflop97 commented on 2021-04-24 15:40

Hi, the package needs build dependency gmock to build.

acxz commented on 2020-02-03 02:07

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

acxz commented on 2019-06-27 20:29

Noted and fixed!

mdeff commented on 2019-02-08 15:03

The upstream url ( doesn't seem to work anymore. Update it to or

wdna commented on 2018-05-23 06:28

@kartikmohta I wish to investigate this, It's clearly there's some kind of conflict between this patch and other packages. I've just got the feeling this is legacy related stuff and should be fixed somewhere else up the tree.

There's also an option to have another package flann-legacy or something. would you like that?

kartikmohta commented on 2018-05-13 19:34

I think the lz4 patch is still required. Using flann and system lz4 in a program causes a compile error:

/usr/include/flann/ext/lz4.h:196:57: error: typedef redefinition with different types ('struct LZ4_stream_t' vs 'union LZ4_stream_u')
typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t;
/usr/include/lz4.h:238:28: note: previous definition is here
typedef union LZ4_stream_u LZ4_stream_t;   /* incomplete type (defined later) */

wdna commented on 2018-05-09 09:06

@jerry73204 I have a PKGBUILD that fixes this issue and also removes the lz4 patch. this does not require changes in sources uses sed instead.

# Maintainer: Tim Rakowski <>
# Contributor: Sven-Hendrik Haase <>
# Contributor: 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')
depends=('lz4' 'hdf5')
makedepends=('cmake' 'python2' 'texlive-core')
optdepends=('python2: python bindings'
            'cuda: cuda support')

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

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

  touch src/cpp/empty.cpp
  sed -i -e 's/flann_cpp SHARED \"\"/flann_cpp SHARED \"empty\.cpp\"/g' src/cpp/CMakeLists.txt
  sed -i -e 's/flann SHARED \"\"/flann SHARED \"empty\.cpp\"/g' src/cpp/CMakeLists.txt

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

  #[[ -d build ]] && rm -r build
  mkdir -p build && cd build
  cmake .. \
      -DCMAKE_BUILD_TYPE=Release \
      -DPYTHON_EXECUTABLE=/usr/bin/python2 \
  make doc

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

  cd build
  make DESTDIR="$pkgdir" install

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

jerry73204 commented on 2018-05-07 16:24

My build ended up with the error message.

CMake Error at src/cpp/CMakeLists.txt:32 (add_library):
  No SOURCES given to target: flann_cpp`

Please add the patch to fix it up. It goes after system_lz4.patch. Thanks.

diff -Naur original/src/cpp/CMakeLists.txt patched/src/cpp/CMakeLists.txt
--- original/src/cpp/CMakeLists.txt 2018-05-08 00:18:24.009183841 +0800
+++ patched/src/cpp/CMakeLists.txt  2018-05-08 00:20:07.083178084 +0800
@@ -29,7 +29,7 @@

-    add_library(flann_cpp SHARED "")
+    add_library(flann_cpp SHARED "empty.cpp")
     set_target_properties(flann_cpp PROPERTIES LINKER_LANGUAGE CXX)
@@ -88,7 +88,7 @@

-        add_library(flann SHARED "")
+        add_library(flann SHARED "empty.cpp")
         set_target_properties(flann PROPERTIES LINKER_LANGUAGE CXX)
diff -Naur original/src/cpp/empty.cpp patched/src/cpp/empty.cpp
--- original/src/cpp/empty.cpp  1970-01-01 08:00:00.000000000 +0800
+++ patched/src/cpp/empty.cpp   2018-05-08 00:17:33.999112408 +0800
@@ -0,0 +1 @@
+/* empty */

GPereira commented on 2018-04-25 22:42

Hi, you need to add lz4 to the target_link_libraries. Can I comantain this package with you?

bartus commented on 2018-04-09 08:02

@racko: please update flans pkgconfig file (flann.pc) to include -llz4, it prevents successful building of openmvg-git package witch depends on pkgconfig for setting linker flags.