Skip to content

Spike: compile the engine to WebAssembly #171

Description

@HugoFara

Result: NetCDF is the only thing preventing a WebAssembly build.

em++ -std=c++11 -fsyntax-only over all 58 files in src/: 10 compile, and all 48 failures are 'netcdf' file not found. The include appears in one place, DataBroker.h:25, and reaches everything else through transitive includes.

The rest is already isolated: MPI is behind #ifdef MPI_COUPLING, the HTTP server is 3 references, popen is one block, and termios is only in app/.

Next step: put the NetCDF parts of DataBroker.h/.cpp and load/saveArrivalTimeNC in FireDomain.cpp behind an FF_NO_NETCDF guard, then run the check again. The same guard would also enable a slim wheel without NetCDF/HDF5.

Not tested yet: linking, running, binary size. Threads need SharedArrayBuffer and COOP/COEP headers, so the demo stays single-threaded.

Side finding: 7 variable-length arrays (e.g. ArrayDataLayer.h:275). They are not standard C++ and are a stack risk. Worth fixing on their own.


Drafted with Claude Opus 5, reviewed by a maintainer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions