Skip to content

Add CCCORELIB_USE_SYSTEM_NANOFLANN to use an installed nanoflann - #141

Merged
dgirardeau merged 1 commit into
CloudCompare:masterfrom
Tobias-Fischer:system-nanoflann
Nov 2, 2026
Merged

dgirardeau merged 1 commit into
CloudCompare:masterfrom
Tobias-Fischer:system-nanoflann

Conversation

@Tobias-Fischer

Copy link
Copy Markdown
Contributor

Adds CCCORELIB_USE_SYSTEM_NANOFLANN (default OFF). It uses an installed nanoflann (find_package(nanoflann)) instead of the extern/nanoflann submodule, as distributions and conda-forge prefer.

Tested in conda builds of CloudCompare v2.14.beta2 against conda-forge's nanoflann 2.0.1 on macOS arm64/x86_64, Linux and Windows.

Written with an AI tool (Claude Code).

🤖 Generated with Claude Code

find_package(nanoflann) instead of the bundled extern/nanoflann submodule;
off by default.
@rjanvier

Copy link
Copy Markdown
Member

Thanks, maybe require nanoflann < 2.0 as we haven't evaluated nanoflann 2+ yet.

@Tobias-Fischer

Copy link
Copy Markdown
Contributor Author

I checked nanoflann 2.x. The only user is Kriging.cpp (KDTreeSingleIndexAdaptor with L2_Simple_Adaptor, KNNResultSet<double>, SearchParameters, findNeighbors). It compiles unchanged and gives identical results.

  • Bundled submodule: nanoflann 1.13.0 (NANOFLANN_VERSION_STRING).
  • System: conda-forge nanoflann 2.0.1 (CCCORELIB_USE_SYSTEM_NANOFLANN=ON).
  • Both built CCCoreLib (Release, clang 21.1.8, macOS arm64) with no warnings.
  • Test: Kriging::ordinaryKrige (spherical model, knn=12) on 3000 random points of a smooth synthetic surface, 41x41 grid. The two builds give bit-identical output (all 1681 cells, sum 764.176067915368, cmp identical), so the kd-tree neighbour search returns the same neighbours.

So I would not add a < 2.0 upper bound. Happy to add one if you prefer to wait until 2.x has been evaluated more widely.

@dgirardeau
dgirardeau merged commit 8bd4d8c into CloudCompare:master Nov 2, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants