Debian Jessie Emscripten installation notes

wget https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
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/emsdk_env.sh

Edit ~/.emscripten change the line reading:

NODE_JS = 'node'

to

NODE_JS = 'nodejs'

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

#include<stdio.h>

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:

PATH=$PATH:/home/new/ems/emsdk_portable
PATH=$PATH:/home/new/ems/emsdk_portable/clang/fastcomp/build_master_64/bin
PATH=$PATH:/home/new/ems/emsdk_portable/emscripten/master
EMSCRIPTEN=/home/new/ems/emsdk_portable/emscripten/master

Comments are closed.