Package Details: flann 1.9.1-3

Git Clone URL: https://aur.archlinux.org/flann.git (read-only)
Package Base: flann
Description: FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces
Upstream URL: http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN
Licenses: BSD
Submitter: None
Maintainer: racko (GPereira)
Last Packager: GPereira
Votes: 39
Popularity: 1.764910
First Submitted: 2011-04-05 02:06
Last Updated: 2018-05-09 09:14

Dependencies (7)

Required by (8)

Sources (1)

Latest Comments

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 <tim.rakowski@gmail.com>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Javier Fuentes <0xffaa.rm@gmail.com>
# Contributor: Figo.zhang <figo1802@gmail.com>
# Contributor: hauptmech

pkgname=flann
pkgver=1.9.1
pkgrel=2
pkgdesc="FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces"
arch=('i686' 'x86_64')
url='http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN'
license=('BSD')
depends=('lz4' 'hdf5')
makedepends=('cmake' 'python2' 'texlive-core')
optdepends=('python2: python bindings'
            'cuda: cuda support')
source=("https://github.com/mariusmuja/flann/archive/${pkgver}.tar.gz")
md5sums=('73adef1c7bf8e8b978987e7860926ea6')

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

  sed -i "s|setup\.py install|setup.py 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 \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DBUILD_MATLAB_BINDINGS=OFF \
      -DBUILD_PYTHON_BINDINGS=ON \
      -DPYTHON_EXECUTABLE=/usr/bin/python2 \
      -DBUILD_TESTS=OFF \
      -DBUILD_EXAMPLES=OFF
  make
  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 @@
 endif()

 if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
-    add_library(flann_cpp SHARED "")
+    add_library(flann_cpp SHARED "empty.cpp")
     set_target_properties(flann_cpp PROPERTIES LINKER_LANGUAGE CXX)
     target_link_libraries(flann_cpp
         -Wl,-whole-archive
@@ -88,7 +88,7 @@
     set_property(TARGET flann_s PROPERTY COMPILE_DEFINITIONS FLANN_STATIC)

     if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
-        add_library(flann SHARED "")
+        add_library(flann SHARED "empty.cpp")
         set_target_properties(flann PROPERTIES LINKER_LANGUAGE CXX)
         target_link_libraries(flann
             -Wl,-whole-archive
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.

clynamen commented on 2018-03-25 21:31

the static libraries libflann_s.a and libflann_cpp.a are not copied in the built package

racko commented on 2018-03-06 21:49

Fixed. I messed up the library order in the target_link_libraries call. The linker would think that lz4 is unneeded. Since "--as-needed" is included in LDFLAGS in the default /etc/makepkg.conf, lz4 was removed.

I removed "--as-needed" a long time ago because some other AUR package messed up, so the error didn't occur on my main machine.

Thanks for bringing up the issue again.

racko commented on 2018-03-06 06:27

Hmm ... I can reproduce this now as well.

Even after building with make VERBOSE=1 and seeing (note -llz4)

c++ -fPIC -march=native -O3 -pipe -fstack-protector-strong -fopenmp -O3 -DNDEBUG -Wl,-O1,--sort-common,--as-needed,-z,relro -shared -Wl,-soname,libflann.so.1.9 -o ../../lib/libflann.so.1.9.1  -llz4 -Wl,-whole-archive ../../lib/libflann_s.a -Wl,-no-whole-archive

the resulting libflann.so still does not list an lz4 dependency :(

I am looking into it.

subhuman22 commented on 2018-03-06 03:20

The resulting libflann.so still omits dependency on system liblz4

    $ ldd /usr/lib/libflann.so

    linux-vdso.so.1 (0x00007ffe6fdf5000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f0554eb1000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007f0554b65000)
    libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007f0554937000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f0554720000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f0554369000)
    /usr/lib64/ld-linux-x86-64.so.2 (0x00007f0555978000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f0554165000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f0553f47000)

As a temporary fix, you can just use src/cpp/ext/lz4... by removing patch lines in PKGBUILD. Not sure this can be a problem in the future.

All comments