Skip to content

fix: provide assoc_legendre fallback for libc++ (macOS build) - #80

Open
manishpaulish wants to merge 1 commit into
wcwitt:mainfrom
manishpaulish:fix/macos-assoc-legendre-build
Open

fix: provide assoc_legendre fallback for libc++ (macOS build)#80
manishpaulish wants to merge 1 commit into
wcwitt:mainfrom
manishpaulish:fix/macos-assoc-legendre-build

Conversation

@manishpaulish

Copy link
Copy Markdown

spherical_harmonic.cpp uses std::assoc_legendre, one of the C++17 mathematical special functions. These are optional in the standard, and libc++ (the default standard library on macOS) does not implement them, so the build currently fails on macOS with:

error: no member named 'assoc_legendre' in namespace 'std'

This replaces the two std::assoc_legendre call sites with a small standalone implementation using the standard upward recurrence. The convention matches std::assoc_legendre exactly (no Condon-Shortley phase). I verified the output is bit-identical to libstdc++'s std::assoc_legendre across a range of (l, m, x) values.

The affected functions (sph_harm / real_sph_harm) are reference routines not on the production sphericart path, so there is no performance impact. Verified that libsymmetrix now builds cleanly on macOS (Apple Clang) with the Kokkos serial backend.

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