-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting PyGLM working on the Web with Pyodide #224
Comments
Hi there (:
That would be great! Thank you for the help!
Thanks a lot for the work you've done already. The changes would indeed be welcome, however, since it's been a while since I've last worked on this project, I would like to take this opportunity myself to get in touch with PyGLM again - if that's alright with you (: |
+ Added "static" classifier to a few functions + Should be enough to fix #224
I added the static keyword to any applicable symbol. With the changes in #225, the following symbols remain from the table you've provided:
The remaining ones are mostly member functions of structs. I don't think they will cause any collisions. |
When we compile for the web the entire project including all libraries and the cpython core itself will end up as "a single, enormous Object file" I also learned this on a single file projects see |
Oops, didn't mean to close this |
The remaining entries and the entries from I just built from the updated master. You can try PyGLM in the browser: https://pyodide.org/en/stable/console.html import micropip; await micropip.install('https://f003.backblazeb2.com/file/zengl-data/build/PyGLM-2.7.1-cp311-cp311-emscripten_3_1_45_wasm32.whl'); import glm I can prepare the |
Hello!
I would like to submit PyGLM as a Pyodide package.
This would mean to add a simple meta.yml pointing to the sdist on PyPI.
Previously the sdist was broken, thanks for the recent version it is fixed now.
There is still some changes that would be great to make before submitting.
When compiling for the web it is important to have all the internal functions / globals declared as static.
I tried to do this for glm but it seems not to be possible.
I have tweaked the setup.hpp to declare functions as either
static
orstatic inline
.It did not work due to operators cannot be declared static and there is no other define I could change.
Luckyily glm is behind a namespace, so name collision with other libraries are unlikely, (unless they also provide glm).
Here is the rest of the symbols that are not static:
It would be really nice to mark these symbols static. Except
PyInit_glm
.Or at least simple ones like
ctypes_float
. Such a name might be also present in other libraries.PS: sorry I could not demagle the names.
I have generated this list with the followind Dockerfile added in the root:
I can make a PR with the changes.
I first wanted to know if these changes would be welcome.
The text was updated successfully, but these errors were encountered: