- Vibra now supports a WebAssembly (WASM) build, enabling it to run in web browsers. Before you can build Vibra for WebAssembly, you must first compile
libfftw3
for WebAssembly.
- To build
libfftw3
on macOS for use with Vibra, follow these steps:
- Download the
libfftw3
source code:
wget http://www.fftw.org/fftw-3.3.10.tar.gz
- Extract the downloaded file:
tar -xvf fftw-3.3.10.tar.gz
- Navigate into the extracted directory:
cd fftw-3.3.10
- Configure the build for WebAssembly without Fortran support and specify the installation prefix:
emconfigure ./configure --disable-fortran --enable-single --prefix="/path/to/fftw"
- Compile the library using multiple cores (for example, using 9 cores):
emmake make -j9
- After completing these steps, you will find the WebAssembly version of
libfftw3
in the/path/to/fftw
directory.
- Once
libfftw3
is ready, you can proceed to build Vibra for WebAssembly:
- Navigate to the wasm directory within the Vibra project:
cd vibra/wasm
- Set the FFTW3_PATH environment variable to the path where
libfftw3
was installed:
export FFTW3_PATH=/path/to/fftw
- Compile Vibra using the provided Makefile for WebAssembly, ensuring to include the FFTW3 include path:
emmake make -f Makefile.wasm -I"$FFTW3_PATH/include"
- Verify the build outputs:
ls build
-
You should see the following files indicating a successful build:
vibra.js
vibra.wasm
-
These files constitute the WebAssembly version of Vibra, ready for integration into web applications.