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.
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