Package operations: 1 install, 0 updates, 0 removals
• Installing pystan (2.19.1.1): Failed
ChefBuildError
Backend subprocess exited when trying to invoke build_wheel
Cython>=0.22 and NumPy are required.
at /opt/homebrew/Cellar/poetry/1.6.1/libexec/lib/python3.11/site-packages/poetry/installation/chef.py:147 in _prepare
143│
144│ error = ChefBuildError("\n\n".join(message_parts))
145│
146│ if error is not None:
→ 147│ raise error from None
148│
149│ return path
150│
151│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
Note: This error originates from the build backend, and is likely not a problem with poetry but with pystan (2.19.1.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "pystan (==2.19.1.1)"'.
First, direct your attention to httpstan – that’s always going to be the issue, not pystan.
You can’t build httpstan automatically from source due to the complicated Makefile. The path to fixing this issues lies with scikit-build, I think. If we use scikit-build we could get everything to build from source via pip install httpstan. But using scikit-build requires rewriting our current build scheme in cmake. I don’t think I’ll have time for this anytime soon. Others are welcome to try.
It might be possible to get Apple Silicon wheels using our current setup now that Github Actions has beta support for Apple Silicon runners. But this seems to cost money and probably requires a bit of local experimentation with an Apple Silicon laptop/desktop (to verify that the Github Actions scripts work).
i’d be willing to assist with experimentation on M2 Max and M1 processors
rewriting the current build scheme in cmake – not sure if i’d have time for that. i haven’t used cmake/cpp/c seriously in ~a decade. do you have a rough estimate of how long it’d take for a ~newcomer to rewrite in cmake?
Thanks @er-eis. I wish I knew how much work was involved. It may be possible to have cmake use the existing (complicated) Makefile. If this is possible then switching to scikit-build could be quite easy.
I recently had some success writing cmake configuration for cmdstan and Stan-math:
I suspect this would be viable for PyStan, and would likely even allow it to work on Windows (the above experiment enabled me to compile against the MSVC ABI with the clang-cl compiler)