flann-lib / flann

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

FLANN : Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) for Windows #435

Open thiyagu1 opened 4 years ago

thiyagu1 commented 4 years ago

I am actually setting up the Point Cloud Library (PCL). However, it requires a few other dependency libraries, and one among them was FLANN.

So, I wanted to build the FLANN from sources:

  1. Downloaded the souces from the Git link.
  2. Created a build directory
  3. Set CMake SOURCE code path - C:/PCL/flann-master
  4. Set CMake Build binaries path - C:/PCL/flann-master/build
  5. Checked the Grouped and Advanced options
  6. Configure
CMake Warning (dev) at CMakeLists.txt:17 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "MSVC" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:21 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "MSVC" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.13/Modules/FindPkgConfig.cmake:39 (find_package_handle_standard_args)
  CMakeLists.txt:149 (find_package)

The import takeaway is Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Using PkgConfig with CMake is not a truly cross-platform solution, as Windows does not come with the pkg-config utility installed.

So any solution for this issue ?

navFooh commented 4 years ago

I'm running into the same problem, also for compiling PCL. Did you find a solution for this @thiyagu1 ?

navFooh commented 4 years ago

I managed to build the project by checking out the 1.9.1 tag: git checkout 1.9.1

JTrantow commented 4 years ago

I was also stuck trying to build PCL from source and using the vcpkg dependencies (flann:x64-windows 2019-04-07-1). PCL won't generate because of a problem linking kdtree with flann_s???

When I pulled flann and tried to use the Cmake gui, it would not config. Reverted FLANN to the 1.9.1 tag, deleted the CMAKE cache and had no problems with CMake config, generate or VisualStudio build of FLANN. Then I went into CMAKE pcl and set FLANN_DIR to my new FLANN install directory and PCL builds correctly.

Seems like something is wrong with the FLANN Master and the vcpkg version of FLANN since the 1.9.1 tag works correctly???

melhashash commented 4 years ago

Try to follow these steps (I only tried building FLANN, and using a translator)

https://gist.github.com/UnaNancyOwen/59319050d53c137ca8f3

iAnyKey commented 2 years ago

You can pass the missing variable by calling the cmake:

cmake .. -DPKG_CONFIG_ROOT="$pwd/gtk/gtk/x64/release/bin" -DPKG_CONFIG_EXECUTABLE="$pwd/gtk/gtk/x64/release/bin/pkg-config.exe"

I my case I have pkg-konfig built as part of GTK toolbox

Check out y short guide in Readme.md on my fork of FLANN: https://github.com/iAnyKey/flann

walkthetalk commented 1 year ago

we can assign path of lz4, PKGCONFIG is must?

ychaos commented 6 months ago

You can pass the missing variable by calling the cmake:

cmake .. -DPKG_CONFIG_ROOT="$pwd/gtk/gtk/x64/release/bin" -DPKG_CONFIG_EXECUTABLE="$pwd/gtk/gtk/x64/release/bin/pkg-config.exe"

I my case I have pkg-konfig built as part of GTK toolbox

Check out y short guide in Readme.md on my fork of FLANN: https://github.com/iAnyKey/flann

but he said on windows...