WASM compilation of a subset of libhdf5 C high- and low-level library functions.
This can only be done on Unix-like systems due to the use of GNU autotools. Maybe MinGW will work on Windows but YMMV. Also, I have not checked on a fresh system that these instructions work.
- Clone the repository with submodules:
git clone --recurse-submodules git@github.com:aertslab/webhdf5.git
- Check that you have these tools installed:
- Python
- Autotools
- Libtool
- C compiler
- Emscripten
- In the top-level directory run:
./build.py
. This does a native build of the library first (in order to get configuration programs:H5detect
andH5make_libsettings
), then re-compiles with Emscripten to produce a WASM binary and JS wrapper.
A HTML file is supplied called libhdf5.html
. To run functions follow these steps:
- Start a server with e.g.
python3 -m http.server
- Open a browser at
localhost:8000/libhdf5.html
. If the browser successfully loads the WASM then an alert will be displayed. - Open the dev console and run the library initialisation function:
Module["_H5open"]()