-
Notifications
You must be signed in to change notification settings - Fork 46
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
emscripten build #1040
emscripten build #1040
Conversation
Do we want to include this in the release? The above suggestion would be a ~15 minute commit that I could put together. |
I think it would be wonderful if we can, and then add a cursory emscripten build (just the base library) to CI. |
emcc looks for the output suffix .wasm when linking executables. This now builds cleanly: $ emmake make STATIC=1 OPT=-O build/ex2-surface.wasm [...] $ wasmer run build/ex2-surface.wasm -- -s 32767 [...] Exact mesh surface area : 6 Computed mesh surface area : 5.9548265118955 Surface area error : -0.04517348810445 Increasing the size causes calloc to fail, likely to do some default memory limits that I haven't worked out yet. Emscripten docs: https://emscripten.org/docs/compiling/Building-Projects.html#building-projects
I don't think it was intended to close this PR, though this PR should be rebased (by someone, maybe me). |
I can do a quick rebase |
7a686aa
to
e3e35af
Compare
$ emmake make STATIC=1 OPT=-O build/ex2-surface.wasm -j
make: make STATIC=1 OPT=-O build/ex2-surface.wasm -j
make: 'lib' with optional backends:
CC build/interface/ceed-basis.o
CC build/interface/ceed.o
CC build/interface/ceed-elemrestriction.o
CC build/interface/ceed-fortran.o
CC build/interface/ceed-jit-source-root-default.o
CC build/interface/ceed-jit-tools.o
CC build/interface/ceed-operator.o
CC build/interface/ceed-preconditioning.o
CC build/interface/ceed-qfunction.o
CC build/interface/ceed-qfunctioncontext.o
CC build/interface/ceed-qfunction-register.o
CC build/interface/ceed-register.o
CC build/interface/ceed-tensor.o
CC build/interface/ceed-types.o
CC build/interface/ceed-vector.o
CC build/gallery/identity/ceed-identity.o
CC build/gallery/mass/ceed-mass1dbuild.o
CC build/gallery/mass/ceed-mass2dbuild.o
CC build/gallery/mass/ceed-mass3dbuild.o
CC build/gallery/mass/ceed-massapply.o
CC build/gallery/mass-vector/ceed-vectormassapply.o
CC build/gallery/poisson/ceed-poisson1dapply.o
CC build/gallery/poisson/ceed-poisson1dbuild.o
CC build/gallery/poisson/ceed-poisson2dapply.o
CC build/gallery/poisson/ceed-poisson2dbuild.o
CC build/gallery/poisson/ceed-poisson3dapply.o
CC build/gallery/poisson/ceed-poisson3dbuild.o
CC build/gallery/poisson-vector/ceed-vectorpoisson1dapply.o
CC build/gallery/poisson-vector/ceed-vectorpoisson2dapply.o
CC build/gallery/poisson-vector/ceed-vectorpoisson3dapply.o
CC build/gallery/scale/ceed-scale.o
CC build/backends/ref/ceed-ref-basis.o
CC build/backends/ref/ceed-ref-operator.o
CC build/backends/ref/ceed-ref-qfunction.o
CC build/backends/ref/ceed-ref-qfunctioncontext.o
CC build/backends/ref/ceed-ref-restriction.o
CC build/backends/ref/ceed-ref-tensor.o
CC build/backends/ref/ceed-ref-vector.o
CC build/backends/ref/ceed-ref.o
CC build/backends/blocked/ceed-blocked-operator.o
CC build/backends/blocked/ceed-blocked.o
CC build/backends/opt/ceed-opt-blocked.o
CC build/backends/opt/ceed-opt-operator.o
CC build/backends/opt/ceed-opt-serial.o
CC build/backends/opt/ceed-opt-tensor.o
CC build/backends/ceed-backend-weak.o
CC build/gallery/ceed-gallery-weak.o
AR lib/libceed.a
LINK.c build/ex2-surface.wasm $ wasmer run build/ex2-surface.wasm -- -s 32767
Selected options: [command line option] : <current value>
Ceed specification [-c] : /cpu/self
Mesh dimension [-d] : 3
Mesh degree [-m] : 4
Solution degree [-p] : 4
Num. 1D quadr. pts [-q] : 6
Approx. # unknowns [-s] : 32767
QFunction source [-g] : header
Mesh size: nx = 8, ny = 8, nz = 4
Number of mesh nodes : 18513
Number of solution nodes : 18513
done.
Exact mesh surface area : 6
Computed mesh surface area : 5.9548265118955
Surface area error : -0.04517348810445 |
Did you want to add this to the docs here or in a follow-up? |
Thanks. I think this can be a sleeper feature until we figure out the size limit and get it in CI, at which point we can announce it. |
I can build and run the pure libceed examples, which means we could embed them in a static web page that would run simulations in the user's browser.
This now builds cleanly:
Increasing the size causes calloc to fail, likely to do some default memory limits that I haven't worked out yet.
Emscripten docs: https://emscripten.org/docs/compiling/Building-Projects.html#building-projects