Package Details: flann 1.9.1-1

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
Last Packager: racko
Votes: 35
Popularity: 1.381054
First Submitted: 2011-04-05 02:06
Last Updated: 2018-01-29 18:44

Dependencies (7)

Required by (8)

Sources (2)

Latest Comments

racko commented on 2018-01-29 18:46

Thanks, fixed.

lukaszmoroz commented on 2018-01-28 23:49

I needed texlive-core to make this package.

justbuchanan commented on 2018-01-18 05:49

I ran into an lz4 issue when linking against flann from a library built through cmake. If I add target_link_libraries(mylib lz4) to my cmake, everything works again. Here's the error message:

undefined reference to symbol 'LZ4_decompress_safe_continue'
/usr/lib/liblz4.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

I used ldd to inspect the library deps of flann and here's what I see. Neither library shows a dependency on liblz4.

$ ldd /usr/lib/libflann_cpp.so           
linux-vdso.so.1 (0x00007ffda0370000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f398c423000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f398c205000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f398be4e000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f398bb02000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f398c9ac000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f398b8eb000)
$ ldd /usr/lib/libflann.so           
linux-vdso.so.1 (0x00007fff4adce000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f5b4186a000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f5b4151e000)
libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007f5b412f0000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f5b410d9000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f5b40d22000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f5b4232a000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f5b40b1e000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f5b40900000)

I see the patch file that links against the system's lz4 and it looks right as far as I can tell. Any thoughts?

note: I'm using version 1.9.1-1 of this pkgbuild.

racko commented on 2018-01-10 21:39

@kartikmohta: I followed your suggestion and made flann use the system's lz4. I did not change flann's version number to minimize issues for other users in case I did something wrong. Could you please give it a try?

(I also cleaned up the PKGBUILD a bit more.)

racko commented on 2018-01-10 05:33

I'll look into it today.

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 https://github.com/mariusmuja/flann/issues/307 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()
  anyhow
- removed flann-1.8.4-gcc6.patch, since the issue has been fixed
  upstream
- 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: <https://github.com/mariusmuja/flann/issues/316>
- Attempted to enable BUILD_CUDA_LIB=ON but thrust::gather, used in
kdtree_cuda_3d_index.cu, has been removed in Thrust v1.4.0 (current is
1.9)

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

pkgname=flann
pkgver=1.9.1
pkgrel=1
pkgdesc="FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces"
arch=('i686' 'x86_64')
url='https://github.com/mariusmuja/flann'
license=('BSD')
depends=('hdf5')
makedepends=('cmake' 'python2')
optdepends=('python2: python bindings'
'cuda: cuda support')
source=("https://github.com/mariusmuja/${pkgname}/archive/${pkgver}.tar.gz")
sha512sums=('0da78bb14111013318160dd3dee1f93eb6ed077b18439fd6496017b62a8a6070cc859cfb3e08dad4c614e48d9dc1da5f7c4a21726ee45896d360506da074a6f7')

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/kdtree_cuda_3d_index.cu
sed -i '1 i #undef _GLIBCXX_USE_INT128' src/cpp/flann/algorithms/kdtree_cuda_3d_index.cu

sed -i 's|#!/usr/bin/env python|#!/usr/bin/python2|' \
bin/download_checkmd5.py \
bin/run_test.py \
src/python/setup.py.tpl \
test/test_clustering.py \
test/test_index_save.py \
test/test_nn_autotune.py \
test/test_nn_index.py \
test/test_nn.py

sed -i 's|#!/usr/bin/python|#!/usr/bin/python2|' \
test/memusage_clustering.py \
test/memusage_nn.py

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

[[ -d build ]] && rm -r build
mkdir 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 \
-DNVCC_COMPILER_BINDIR=/usr/bin
make
}

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/exceptions.py -> /usr/lib/python2.7/site-packages/pyflann
# error: /usr/lib/python2.7/site-packages/pyflann/exceptions.py: 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!

Thanks,
Patrick




[1] https://github.com/mariusmuja/flann/releases

All comments