Skip to content

Instantly share code, notes, and snippets.

@dweekly
Last active December 19, 2015 01:09
Show Gist options
  • Save dweekly/5873953 to your computer and use it in GitHub Desktop.
Save dweekly/5873953 to your computer and use it in GitHub Desktop.
Get Emscripten Running on OS X 10.8
# Based on https://github.com/kripken/emscripten/wiki/Tutorial
# prerequisites
cd ~/
brew install node
sudo ln -s /usr/bin/python2.7 /usr/bin/python2
curl http://llvm.org/releases/3.2/clang+llvm-3.2-x86_64-apple-darwin11.tar.gz > llvm.tgz
tar xzvf llvm.tgz
ln -s clang+llvm-3.2-x86_64-apple-darwin11 llvm
# emscripten
git clone git://github.com/kripken/emscripten.git
cd emscripten
LLVM=~/llvm/bin ./emcc
LLVM=~/llvm/bin ./emcc tests/hello_world.cpp -o hello.html
open hello.html
@netpoetica
Copy link

The end result here is the llvm folder living in your ~ dir? Is that a good idea? Additionally, thanks a ton because this worked flawlessly!

@netpoetica
Copy link

You can change your LLVM root in your ~/.emscipten file to

LLVM_ROOT = os.path.expanduser(os.getenv('LLVM') or '~/llvm/bin') # directory

in order to be able to call emscripten withouthaving to write LLVM= in front :)

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