Skip to content

Latest commit

 

History

History
56 lines (47 loc) · 1.71 KB

readme.md

File metadata and controls

56 lines (47 loc) · 1.71 KB

WebAssembly Version Support

  • 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.

Building Dependency: libfftw3 for WebAssembly

  • To build libfftw3 on macOS for use with Vibra, follow these steps:
  1. Download the libfftw3 source code:
wget http://www.fftw.org/fftw-3.3.10.tar.gz
  1. Extract the downloaded file:
tar -xvf fftw-3.3.10.tar.gz
  1. Navigate into the extracted directory:
cd fftw-3.3.10
  1. Configure the build for WebAssembly without Fortran support and specify the installation prefix:
emconfigure ./configure --disable-fortran --enable-single --prefix="/path/to/fftw"
  1. 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.

Building vibra for WebAssembly

  • Once libfftw3 is ready, you can proceed to build Vibra for WebAssembly:
  1. Navigate to the wasm directory within the Vibra project:
cd vibra/wasm
  1. Set the FFTW3_PATH environment variable to the path where libfftw3 was installed:
export FFTW3_PATH=/path/to/fftw
  1. Compile Vibra using the provided Makefile for WebAssembly, ensuring to include the FFTW3 include path:
emmake make -f Makefile.wasm -I"$FFTW3_PATH/include"
  1. 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.