flann-lib / flann

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

Build pyflann with skbuild #432

Open Erotemic opened 4 years ago

Erotemic commented 4 years ago

This is a reorganized version of #425.

The goal is to build the FLANN library and Python bindings with scikit-build. This will make it easier for FLANN to be installed and deployed in Python environments. The current version of pyflann on pypi and in opencv is old, and it could use an update. Moving to scikit-build will help make this process easier.

Because this is a fairly major code restructure, I've bumped the version from 1.9.0 to 1.10.0.

The main changes are:

I also made a minor change to examples/flann_example.c to fix a compiler warning.

These change mean that someone can now simply clone flann and run python setup.py install and it will work. Workflows that use CMake to build the C++ libs or the matlab / ruby bindings should not be affected.


EDIT:

This also includes a fix for #427

Erotemic commented 4 years ago

@mariusmuja I think this PR is ready for review.

I tried to make the diff as small as possible. The setup.py is the largest part of this diff, but its also a new file, so hopefully it makes sense what I'm doing in it.

The main question I'm anticipating in review is: Are you OK with CMake not having the ability to build the Python package anymore? I originally tried to retrain this ability, but I couldn't find a clean way to do it. It seems preferable to me to have setup.py driving the python build process, but I can see this point being possibly contentious.