Skip to content

Instantly share code, notes, and snippets.

@nathanhammond
Created March 4, 2012 21:48
Show Gist options
  • Save nathanhammond/1974955 to your computer and use it in GitHub Desktop.
Save nathanhammond/1974955 to your computer and use it in GitHub Desktop.
How to get Emscripten running on OS X.

Running emscripten on OS X

There are a number of additional dependencies required for getting things installed on OS X. Starting with a blank slate OS X machine, this is the process it takes:

# Install Xcode Command Line Tools

# Install Homebrew
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

# Some deps
brew install node spidermonkey closure-compiler yuicompressor
brew install llvm --with-clang

cd ~/Repos
git clone git://github.com/kripken/emscripten.git
@bkatiemills
Copy link

@larsxschneider - yes, I messed with the homebrew script with an ugly, ugly kludge - see below. It worked, but I wanted the developer's opinion of what the most appropriate solution was.

@shovon - unfortunately your solution gives me a 'wget not found' complaint when I try and run your script on OSX 10.8.2. For those using homebrew, I offer the following, with absolutely no promises as to whether it's actually a good idea or not - but it's my best guess and it worked for me:

Hack the brew script to an older version. Please feel free to educate me on how to do this better:

brew edit llvm --with-clang

replace these lines:

url 'http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz'

sha1 'ccd6dbf2cdb1189a028b70bcb8a22509c25c74c8'

with these lines:

url 'http://llvm.org/releases/3.2/clang-3.2.src.tar.gz'

sha1 'b0515298c4088aa294edc08806bd671f8819f870'

and these lines:

url 'http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz'

sha1 'c6c22d5593419e3cb47cbcf16d967640e5cce133'

with these lines:

url 'http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz'

sha1 '42d139ab4c9f0c539c60f5ac07486e9d30fc1280'

then reinstall:

brew install llvm --with-clang

Again, use at your own risk - shovon's wget-based solution may well be a better idea, but this worked for me where wget didn't.

@shovon
Copy link

shovon commented Aug 5, 2013

@billmills I guess I'd better update the guide to use cURL, instead of wget. OS X comes pre-installed with the former instead of the latter.

Or, the alternative would be to ask people to install wget.

@shovon
Copy link

shovon commented Aug 5, 2013

@billmills yet another update: https://gist.github.com/shovon/6151878

@mralexgray
Copy link

@billMills... you should be able to do what you described via brew install llvm32 --with-clang aka /usr/local/Library/Formula/llvm32.rb

@lancejpollard
Copy link

Now you can just do this:

brew install emscripten

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