Add rebound recipe (librebound + rebound)#5801
Merged
Merged
Conversation
MMesch
commented
Jul 6, 2026
Member
|
@MMesch Since both recipes have the same source and are related, both packages can be in a single recipe |
Contributor
Author
|
Ok great. I'll do that! |
Build the REBOUND C library as a wasm shared library for emscripten. The library and headers are installed to /lib and /include so they can be used by both xeus-cpp (C/C++ kernel) and the rebound Python wrapper package. The SERVER feature (POSIX sockets + pthreads) is not compiled since it is unavailable in the browser environment.
- Combine librebound/ and rebound/ into rebound/ with two outputs, following the matplotlib pattern - Add patch to remove emscripten_sleep calls that require ASYNCIFY; the integration loop yield and pause poll are no-ops without a display server and break browser-main execution otherwise
IsabelParedes
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add emscripten-forge recipes for REBOUND as a single multi-output recipe (following the matplotlib pattern):
librebound — C shared library (side module)
src/*.cas a WASM side module with-sEXPORT_ALL=1$PREFIX/lib/librebound.soand$PREFIX/include/rebound — Python ctypes wrapper (depends on librebound)
setup.pyto skip C extension build on emscriptenrebound/__init__.pyto loadlibrebound.sofrom$PREFIX/lib/via ctypesrebound/horizons.pyto usetry/except ImportErroraroundpyodide.httpimport instead ofsys.moduleschecksrc/simulation.cto removeemscripten_sleep()calls in the integration loop and pause poll — these require-sASYNCIFYwhich we do not compile with (no display server); without this patchsim.integrate()aborts in a browser context