Skip to content

point-cloud-utils: add build-point-cloud-utils.yml for riscv64 wheels - #1790

Open
luhenry wants to merge 3 commits into
mainfrom
point-cloud-utils
Open

point-cloud-utils: add build-point-cloud-utils.yml for riscv64 wheels#1790
luhenry wants to merge 3 commits into
mainfrom
point-cloud-utils

Conversation

@luhenry

@luhenry luhenry commented Sep 11, 2026

Copy link
Copy Markdown
Member

Compiles a pybind11/numpyeigen C++ extension wrapping libigl, a geogram fork, and a Manifold fork for mesh and point-cloud processing. Upstream publishes no riscv64 wheel.

Mirrors upstream's build-wheels-and-publish-to-pipy.yml.

Differs from upstream

  • Drops the Embree-backed ray-intersection bindings - Embree has no riscv64 ISA
  • Keeps geogram's HLBFGS disabled - non-commercial-only licence, unused by this package's own bindings
  • Treats riscv64 like arm64/aarch64 for the SSE-via-simde shim - avoids passing -msse3 to a riscv64 compiler

Testing

  • Deselects test_ray_mesh_intersection/test_ray_surfel_intersection - both need the dropped Embree bindings
  • Stages tests+data and runs pytest - upstream's own CI builds wheels but never tests them

License: wheel bundles the licences of numpyeigen, Eigen, pybind11, igl, tinyply, tinyobjloader, simde, the Manifold fork, and geogram's own third-party code (LM7, rply, zlib, gzstream, PoissonRecon); LM7 and gzstream are LGPL, the rest MIT/BSD/MPL2/public-domain, and upstream's own wheel ships none of their licence text.

Patches

  • 0001-cmake-treat-riscv64-like-arm64-aarch64-for-the-SSE-v.patch - Inappropriate [riscv64-only build config]. Without it the riscv64 compiler is passed -msse3. Riscv64-only.
  • 0002-cmake-keep-geogram-s-HLBFGS-disabled.patch - Inappropriate [avoids redistributing a non-commercial-only licensed dependency]. Without it the wheel bundles non-redistributable code. Reproduces on any arch.
  • 0003-build-drop-the-Embree-backed-ray-intersection-bindin.patch - Inappropriate [Embree has no riscv64 ISA]. Without it the build fails to compile on riscv64. Riscv64-only.
  • 0004-common-force-out-of-line-Eigen-cross-symbols-on-risc.patch - Inappropriate [riscv64-only linkage workaround]. Without it the wheel fails to import: undefined Eigen::cross() symbol. Riscv64-only.
  • 0005-src-only-call-PyErr_CheckSignals-from-the-OpenMP-mas.patch - To upstream [real bug, not riscv64-specific, but this session can't file third-party issues/PRs]. Without it several OpenMP loops segfault calling a Python C-API function from worker threads with no GIL. Reproduces on any arch.

Built on cp312; 26 passed, 2 deselected.

@luhenry
luhenry force-pushed the point-cloud-utils branch 2 times, most recently from bd13629 to 582d57b Compare September 12, 2026 01:27
…egfault

Two independent bugs surfaced once the wheel actually built on riscv64:

- Every test failed importing _pcu_internal.so with an undefined
  Eigen::MatrixBase<Vector3f/Vector3d>::cross() symbol. nm -D
  --undefined-only on the built .so showed these were the only two
  unexplained undefined symbols. Forces a genuine out-of-line
  instantiation by taking their address.

- With that fixed, tests started passing but the suite then
  segfaulted partway through on unrelated tests (remove_duplicate_points,
  mesh_face_areas -- varies by run). A gdb backtrace (gotcha 115)
  caught it live: SIGSEGV inside PyErr_CheckSignals(), called from
  OpenMP worker threads with no GIL/Python thread state. Several
  '#pragma omp for' loops (face_areas.cpp, morton.cpp x4,
  point_cloud_distance.cpp, point_cloud_normals.cpp) call
  PyErr_CheckSignals() from every thread on every iteration for
  Ctrl-C cancellation; only the thread that entered the parallel
  region from Python may touch the interpreter. This is a pre-existing
  upstream bug, not riscv64-specific in nature -- it likely races
  harmlessly elsewhere and reproduces reliably here. See the patch
  commit messages for the full diagnosis.
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