Debian Jessie Emscripten installation notes

tar xvzf emsdk-portable.tar.gz
sudo apt-get update
sudo apt-get install build-essential cmake python2.7 nodejs default-jre git-core
./emsdk_portable/emsdk update
./emsdk_portable/emsdk install latest # wait a long time.
./emsdk_portable/emsdk activate latest
source emsdk_portable/

Edit ~/.emscripten change the line reading:

NODE_JS = 'node'


NODE_JS = 'nodejs'

Then create a simple hello word program in hi.c e.g.


int main() {
  printf("hello, world!\n");
  return 0;

compile with with emscripten as follows:

emcc hi.c -o hello.html

Which will produce hello.html You can then open this with firefox! Emscripten will add a bunch of support code, around this automatically. If you ommit the -o it will produce a a.out.js with the Javascript only.

In addition to the above you might want to add something like the following to your .bashrc, so that the past persist across bash sessions:


Comments are closed.