Skip to content

Add gmsh package#534

Open
pepijndevos wants to merge 3 commits intopyodide:mainfrom
pepijndevos:add-gmsh
Open

Add gmsh package#534
pepijndevos wants to merge 3 commits intopyodide:mainfrom
pepijndevos:add-gmsh

Conversation

@pepijndevos
Copy link
Copy Markdown
Contributor

Two-package recipe for the Gmsh finite element mesh generator:

  • libgmsh: shared library (C++ → WASM via emcmake/emmake)
  • gmsh: pure Python ctypes wrapper (api/gmsh.py)

I'm not totally sure all the patches and flags are entirely correct but it's a start.

Pepijn de Vos and others added 2 commits March 10, 2026 15:22
Two-package recipe for the Gmsh finite element mesh generator:
- libgmsh: shared library (C++ → WASM via emcmake/emmake)
- gmsh: pure Python ctypes wrapper (api/gmsh.py)

Patches fix Emscripten symbol visibility in the CMake build and
adapt the Python API for Pyodide's library loading and signal handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…meta.yaml

- Remove libgmsh visibility patch (not needed with SIDE_MODULE=1)
- Remove -sWASM_BIGINT linker flag
- Move import test to meta.yaml test.imports
- Remove redundant test_gmsh_import from test_gmsh.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 10, 2026

Package Build Results

Total packages built: 23
Total build time: 0:45:09

Package Build Times (click to expand)
Package Build Time
libgmsh 41m 30s
libgmp 3m 33s
numpy 3m 2s
regex 10s
MarkupSafe 4s
pydoc_data 4s
gmsh 4s
atomicwrites 3s
py 1s
pytest 1s
pytz 1s
six 1s
micropip 1s
setuptools 1s
tblib 1s
pluggy 0s
pyparsing 0s
Jinja2 0s
exceptiongroup 0s
more-itertools 0s
attrs 0s
pytest-asyncio 0s
iniconfig 0s

Longest build: libgmsh (41m 30s)
Packages built in more than 10 minutes: 1

- Replace complex Emscripten platform detection with simple CDLL("libgmsh.so")
- Replace signal.signal() calls with pass
- Use ${SIDE_MODULE_LDFLAGS} instead of hardcoded -sSIDE_MODULE=1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pepijndevos pepijndevos marked this pull request as ready for review March 10, 2026 15:43
@ryanking13
Copy link
Copy Markdown
Member

ryanking13 commented Mar 11, 2026

image

Not sure if we want to add a library that takes 40+ min to build to this repository. Would you mind building this package in your local repository and only add the built wheel?

@pepijndevos
Copy link
Copy Markdown
Contributor Author

How is something like that usually set up?

@ryanking13
Copy link
Copy Markdown
Member

How is something like that usually set up?

If you are comfortable working with the meta.yaml files, you can copy the recipes you added in this PR to your local directory, run pyodide build-recipes ... and upload built wheel to some place (e.g. Github releases), and open a PR that have a recipe that points a built wheel.

@pepijndevos
Copy link
Copy Markdown
Contributor Author

We're probably going to be compiling a bunch of big EDA tools, so it sounds like we'd want to maintain our own recipes and idk, set up an anaconda index? Or just make GitHub Releases and add recipes here?

Are there any good examples of big packages that are set up in a way that's easy to keep up with pyodide changes?

@ryanking13
Copy link
Copy Markdown
Member

Are there any good examples of big packages that are set up in a way that's easy to keep up with pyodide changes?

Not very much. We are in a transitional phase, shifting from a model where all packages are built in this repository to one where each package manager builds the packages.

Once PEP 783 is accepted, we plan to gradually stop building packages in this repository and encourage package managers to build them directly and publish to PyPI. In other words, ideally, if you wish to use rdkit, the best approach would be to contact rdkit maintainers and have them help you build them in the repository/CI.

For now, a good example would be looking at @fzumstein 's work (polars-pyodide, duckdb-pyodide)

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