Skip to content

fix: macOS arm64 build support + standalone pipeline compiled binary runner CLI#1120

Open
genie360s wants to merge 3 commits intomapillary:mainfrom
SeedeXR:main
Open

fix: macOS arm64 build support + standalone pipeline compiled binary runner CLI#1120
genie360s wants to merge 3 commits intomapillary:mainfrom
SeedeXR:main

Conversation

@genie360s
Copy link
Copy Markdown

Summary

Two distinct improvements:

  1. Build fixes — OpenSfM failed to compile on macOS arm64 (Apple Silicon) due to missing transitive CMake dependencies and a hard Sphinx import in setup.py.
  2. Standalone runner — New opensfm_runner.py entry point and PyInstaller spec that produce a self-contained binary with a full CLI, per-step subcommands, and a built-in validation test suite.

1. Build fixes (macOS arm64)

CMake — transitive PUBLIC linkage for Ceres/Eigen headers

On macOS arm64 with the system Clang toolchain, targets that consume Ceres or Eigen headers through a library boundary fail to compile unless those dependencies are propagated as PUBLIC. Four files changed:

File Change
opensfm/src/bundle/CMakeLists.txt ${CERES_LIBRARIES}PUBLIC
opensfm/src/geometry/CMakeLists.txt foundation + ${CERES_LIBRARIES}PUBLIC
opensfm/src/robust/CMakeLists.txt geometry moved from PRIVATE to PUBLIC
opensfm/src/sfm/CMakeLists.txt bundle moved from PRIVATE to PUBLIC

These are the minimal changes required; no public API surfaces change.

setup.py

  • from sphinx.setup_command import BuildDoc raised ImportError when Sphinx was not installed, blocking the entire build. Wrapped in try/exceptBuildDoc gracefully becomes None.
  • When $CONDA_PREFIX is set, automatically injects Eigen3_DIR, Ceres_DIR, and -I<include> into the CMake invocation. No-op in standard pip installs.

.gitignore

Added .venv/.


2. Standalone pipeline runner (opensfm_runner)

CLI

Command Description
run Full pipeline end-to-end
extract_metadata Extract EXIF and build camera models
detect_features Detect and describe keypoints
match_features Match features across image pairs
create_tracks Link matches into tracks
reconstruct Incremental SfM reconstruction
export_ply Export point cloud as PLY
test Run built-in validation suite
  • --json emits newline-delimited JSON progress events on stdout (for programmatic consumers such as Tauri desktop apps).
  • Legacy invocation opensfm_runner <dataset> (no subcommand, JSON output) is preserved for backward compatibility.
  • --help prints the full manual including pipeline order, output file descriptions, and usage examples.

Built-in test suite

opensfm_runner test <dataset> runs all six pipeline steps from a clean state and validates 16 expected outputs:

  • extract_metadataexif/ directory, one EXIF file per image, camera_models.json
  • detect_featuresfeatures/ directory, one .features.npz per image, non-empty
  • match_featuresmatches/ directory, ≥1 match file, reference_lla.json
  • create_trackstracks.csv exists and is non-empty
  • reconstructreconstruction.json is valid JSON, contains ≥1 reconstruction, shots count > 0
  • export_plyreconstruction.ply exists and is non-empty

--no-clean skips the pre-run cleanup to validate an existing output directory.

requirements.txt

Added pinned runtime dependencies for reproducible environment setup.


Testing

  • macOS 14/15, Apple M-series (arm64), Python 3.10, micromamba conda environment
  • Dataset: data/lund (29 images)
  • Full pipeline: exit 0
  • Test suite: 16/16 checks pass

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Apr 29, 2026

Hi @genie360s!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Apr 29, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the cla signed label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant