Skip to content

Fix sample build definition and build instructions - #51

Open
dajiaohuang wants to merge 1 commit into
danini:masterfrom
dajiaohuang:repostew/fix-sample-build-20261016
Open

dajiaohuang wants to merge 1 commit into
danini:masterfrom
dajiaohuang:repostew/fix-sample-build-20261016

Conversation

@dajiaohuang

Copy link
Copy Markdown

Problem

A normal CMake build with CREATE_SAMPLE_PROJECT=ON (the default) fails while compiling cpp_example.cpp: gcransac::utils::loadMatrix is not declared at its four call sites. In the pinned graph-cut-ransac utils.h, that sample utility is guarded by the C++ preprocessor symbol CREATE_SAMPLE_PROJECT. The CMake option alone does not define it for the compiler.

The build guides also omit changing into the cloned repository (and the README omits creating build), while BUILD.md does not initialize the required submodules. The README's CMake 2.8.12 requirement predates the pinned pybind11, whose CMakeLists requires 3.15.

Change

  • Define CREATE_SAMPLE_PROJECT privately for SampleProject, only in the existing enabled-sample branch.
  • Correct the clone/build-directory instructions in both guides and the README CMake requirement.

No estimator, dependency revision, public API or library compile definition changes.

Validation

Ubuntu 24.04, GCC 13.3, OpenCV 4.6, Eigen 3.4, gflags 2.2.2 and Python 3.12:

  • Base: configure succeeded; full sample-enabled build failed on the missing loadMatrix declarations.
  • Patched: cmake -S . -B build -DCREATE_SAMPLE_PROJECT=ON and cmake --build build -j2 succeeded, including SampleProject and the Python module. SampleProject --help printed its flags without running datasets/GUI.
  • Source package built/installed with python -m pip install --no-build-isolation . in an isolated environment with the declared build tools installed.
  • Small standalone C++ homography consumer linked to the static libraries and fitted a synthetic translation.
  • Small legal synthetic Python inputs exercised homography, fundamental/essential matrix, rigid transformation and line estimation in both MAGSAC and MAGSAC++ modes (uniform sampler, 30–80 iterations), checking returned shapes and basic geometric residuals. These are smoke checks, not paper/accuracy benchmarks.
  • git diff --check passed.

Windows/macOS builds, minimum-CMake execution, CMake GUI, full wheel CI and the bundled-data pytest suite were not run; no real images/dataset benchmarks were used.

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.

1 participant