Skip to content

Conversation

@alexallmont
Copy link
Contributor

Experimental build of roughpy-jax wheel in subdir

Early check whether building project in subdir may cause future problems.

This is not in CI, just testing build locally for now on a Linux machine. Run test_build.sh from roughpy_jax/.

Notes

  • Python build cannot access files in the parent folder. This highlights that cmake/find_python.cmake and roughpy_compute/ are needed. test_build.sh copies them in before it gets into the python build and cmake ecosystem.
  • Note that although this builds locally on Linux, when pip installing and running import roughpy_jax in python, it fails with ImportError: dynamic module does not define module export function (PyInit__rpy_jax_internals), suggesting a linkage issue.
  • Regard this work as a feasibility study; copying files from parent dir is not idiomatic to python build. Nicer solutions are: 1) move roughpy_jax into a separate repo and bring in RoughPy as a submodule or CMake find package; 2) remove roughpy_jax/pyproject.toml and instead build roughpy-jax from root project.

- First draft attempting to build roughpy-jax wheel directly from the roughpy_jax/ sub directory.
- Local build only, run test_build.sh in roughpy_jax/ dir. You cannot directly run `python -m build` because it cannot access files in parent folder, instead the shell script copies them to a `_deps` subdir.
- Note that although this builds locally testing on Linux, when pip installing and running `import roughpy_jax` in python, it fails with `ImportError: dynamic module does not define module export function (PyInit__rpy_jax_internals)`
@alexallmont alexallmont self-assigned this Jan 15, 2026
@inakleinbottle
Copy link
Contributor

OK, So I think this build is going to be a little complicated. (Not made easier by the monorepo.) The jax library needs its own pyproject.toml to build a separate package, so the build system that is invoked by python (i.e. the CMakeLists.txt in the roughpy_jax directory) needs to be standalone. As such, it needs to be able to locate all of the dependencies (which hopefully are just roughpy (compute) and the XLA headers from JAX. This needs to be handled delicately, and it would probably be easier if this were in a separate repo.

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.

3 participants