Skip to content

Fixes the build failure when configuring with POLYSOLVE_LARGE_INDEX=ON - #113

Open
Chenyang-Joe wants to merge 1 commit into
polyfem:mainfrom
Chenyang-Joe:fix/large-index-build
Open

Fixes the build failure when configuring with POLYSOLVE_LARGE_INDEX=ON#113
Chenyang-Joe wants to merge 1 commit into
polyfem:mainfrom
Chenyang-Joe:fix/large-index-build

Conversation

@Chenyang-Joe

Copy link
Copy Markdown
Contributor

With large indices, StiffnessMatrix uses 64-bit (std::ptrdiff_t) indices, but two of the wrapped direct solvers are 32-bit int-only and fail to compile against it:

  • Apple Accelerate — the Accelerate sparse API is int-only, with no 64-bit variant. Disabled in CMake when POLYSOLVE_LARGE_INDEX is on, so the macro is never defined and no Accelerate code is compiled. (This is the macOS compile error seen on the large-index build.)
  • MKL Pardiso — Eigen's PardisoSupport only specializes pardiso_run_selector for int/long long, not long (std::ptrdiff_t). Excluded under #ifndef POLYSOLVE_LARGE_INDEX, mirroring the existing UmfPack handling. MKL's BLAS/LAPACK backend is left enabled.

This PR only makes the large-index build compile — it does not add large-index support to those solvers (that's future work). SuperLU has the same int-only limitation and is left untouched here.

Testing

  • Linux: library builds and the unit tests pass with POLYSOLVE_LARGE_INDEX=ON.
  • Apple Silicon (Accelerate on by default): the large-index build now compiles — both polysolve standalone, and inside a polyfem build that points its polysolve dependency at this branch.

@maxpaik16 PTAL! Thanks

Apple Accelerate and MKL Pardiso only support 32-bit sparse indices and fail to
compile against the 64-bit (std::ptrdiff_t) StiffnessMatrix used when
POLYSOLVE_LARGE_INDEX is enabled. Disable Accelerate via CMake, and exclude the
MKL Pardiso solvers under POLYSOLVE_LARGE_INDEX (mirroring the existing UmfPack
handling), so the large-index build succeeds.
@Chenyang-Joe Chenyang-Joe reopened this Sep 2, 2026
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.79%. Comparing base (a7727e3) to head (c9a809e).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #113      +/-   ##
==========================================
+ Coverage   80.76%   80.79%   +0.03%     
==========================================
  Files          51       51              
  Lines        2121     2135      +14     
  Branches      281      282       +1     
==========================================
+ Hits         1713     1725      +12     
- Misses        408      410       +2     
Flag Coverage Δ
polysolve 80.79% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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