flann-lib / flann

Fast Library for Approximate Nearest Neighbors
http://people.cs.ubc.ca/~mariusm/flann
Other
2.22k stars 649 forks source link

Need some way to specify LZ4 include/lib directory #403

Open espresso3389 opened 5 years ago

espresso3389 commented 5 years ago

The CMakeList.txt on the project root has such lines:

find_package(PkgConfig REQUIRED)
pkg_check_modules(LZ4 REQUIRED liblz4)

But I think it would be better if we can freely specify LZ4 include/lib directories in cmake command line like other libraries.

alvaroga91 commented 5 years ago

Completely agree, I had a huge issue with this while trying to cross-compile as it could not find my Arm based environment. At the end, solved it by adding my env folder in CMakeLists.txt


SET(ENV{PKG_CONFIG_LIBDIR} <env path>/lib/)  
INCLUDE_DIRECTORIES(BEFORE <env path>/include)

But the linker shows this issue: https://github.com/mariusmuja/flann/issues/384#issuecomment-450765722

evaliyev commented 5 years ago

+1

largeword commented 5 years ago

+1

jiapei100 commented 5 years ago

Is lz4 a must?

drhpc commented 4 years ago

Why doesn't plain pkg-config usage not work? You should have PKG_CONFIG_PATH properly set up to point to the pkg-config files for the target when cross-compiling.

(Meanwhile, I'm trying to figure out if building the latest release can possibly work at all, or if I have to resort to a git checkout.)

fei4xu commented 3 years ago

What's PkgConfig btw? (I'm not a cmake export). During my build, it translates to perl, is it right?

Found PkgConfig: C:/Strawberry/perl/bin/pkg-config.bat (found version "0.26") Checking for module 'liblz4'

How should I get lz4? Compile and install lz4 in c++ project, or do I need to install it by perl? very confused here.

Related: https://github.com/mariusmuja/flann/pull/400