Skip to content

Instantly share code, notes, and snippets.

@CarloCattano
Last active January 2, 2023 19:44
Show Gist options
  • Save CarloCattano/c7eeb5d2a9f030f3c525758be7bfd0c0 to your computer and use it in GitHub Desktop.
Save CarloCattano/c7eeb5d2a9f030f3c525758be7bfd0c0 to your computer and use it in GitHub Desktop.
get heavy compiler Web Assembly export to work on linux

Install emscripten

from emscripten official docs

# Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git

# Enter that directory
cd emsdk
# Download and install the latest SDK tools.
./emsdk install latest

# Make the "latest" SDK "active" for the current user. (writes .emscripten file)
./emsdk activate latest

# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh

Check that installation is correct and emcc is in your path

which emcc should show the path where its installed /usr/lib/emscripten/emcc in my case

get heavy compiler using pip

pip3 install hvcc

In the folder of your patch patch.pd for example run:
hvcc patch.pd -n sine_test -o sine_test -g js

where :
-n its the name
-o its the output name for the folder
-g its the export target

refer to the docs for knowing more

use your favourite http server to serve the files go to the js folder

cd sine_test
cd js
python3 -m http.server

navigate to localhost:8000 on your browser and there you go


image

follow the instructions given by emscripten to add emsdk PATH permanently to your system

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