Skip to content

build: pybind11 via FetchContent + bindings/python/ module#29

Merged
gapost merged 1 commit into
ir2-lab:GSoC2026from
dhanavanthesh:feat/A-1-build-foundation
May 28, 2026
Merged

build: pybind11 via FetchContent + bindings/python/ module#29
gapost merged 1 commit into
ir2-lab:GSoC2026from
dhanavanthesh:feat/A-1-build-foundation

Conversation

@dhanavanthesh
Copy link
Copy Markdown
Contributor

build: pybind11 via FetchContent + bindings/python module skeleton

Delivers A-1 from the GSoC2026 Python bindings plan.

What this adds

  • OPENTRIM_BUILD_PYTHON CMake option (default ON)
  • pybind11 v3.0.4 fetched via FetchContent
  • bindings/python/ directory with _opentrim_core extension module skeleton
  • pyproject.toml for pip installs via scikit-build-core
  • Under SKBUILD: co-installs libopentrim and xs_* into the Python package dir with $ORIGIN RPATH so private libs resolve from site-packages/opentrim/
  • __version__ reads from mcdriver::version_info(), giving the extension a real runtime dependency on libopentrim
  • CMake summary prints OPENTRIM_BUILD_PYTHON

Tested

Ubuntu 24.04, Python 3.12:

pip install -e . --no-build-isolation
python -c "import opentrim; print(opentrim.__version__)"
# 1.1.2

- Add OPENTRIM_BUILD_PYTHON option (default ON)
- Fetch pybind11 v3.0.4 via FetchContent
- Add bindings/python CMake module for _opentrim_core
- Co-install libopentrim and xs_* into opentrim package under SKBUILD
- Set $ORIGIN RPATH so packaged libs resolve from the package dir
- Skeleton PYBIND11_MODULE reads version from mcdriver::version_info()
- Add opentrim/__init__.py re-exporting __version__
- Add pyproject.toml with scikit-build-core backend
- Print OPENTRIM_BUILD_PYTHON in CMake summary

Tested:
  pip install -e . --no-build-isolation
  python -c "import opentrim; print(opentrim.__version__)"  # 1.1.2
  ldd: _opentrim_core -> libopentrim -> xs_* all resolve from site-packages/opentrim
@gapost gapost merged commit 2525f2c into ir2-lab:GSoC2026 May 28, 2026
@gapost
Copy link
Copy Markdown
Member

gapost commented May 28, 2026

Nice work @dhanavanthesh ! Keep it up!

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.

2 participants