🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Emscripten On OSX

Published October 19, 2013
Advertisement
Did you see that the Epic Citadel demo now runs at full speed under Chrome as well (http://www.unrealengine.com/html5/)?

This got me curious about emscripten once again, and so I set it up on my mac. Actually very straight forward, but not a one-liner:

  1. install brew if you don't have it (if you're using macports, then you are on your own :-)
  2. always good to update brew: brew update && brew outdated
  3. [font=arial][background=transparent]brew install node spidermonkey closure-compiler yuicompressor[/background][/font]

    1. [font=arial][background=transparent]?[/background][background=transparent]Of course, you can leave out any you already have installed (fx. I already had node and closure-compiler)[/background][/font]


  4. [font=arial][background=transparent]brew install llvm --with-clang[/background][/font]
  5. brew tap homebrew/versions
  6. brew install llvm33
  7. create symlinks to llvm33:

    1. cd /usr/bin
    2. sudo ln /usr/local/Cellar/llvm33/3.3/bin/opt-3.3 opt
    3. sudo ln /usr/local/Cellar/llvm33/3.3/bin/llvm-as-3.3 llvm-as
    4. sudo ln /usr/local/Cellar/llvm33/3.3/bin/llvm-dis-3.3 llvm-dis
    5. sudo ln /usr/local/Cellar/llvm33/3.3/bin/llvm-nm-3.3 llvm-nm
    6. sudo ln /usr/local/Cellar/llvm33/3.3/bin/lli-3.3 lli
    7. sudo ln /usr/local/Cellar/llvm33/3.3/bin/llvm-link-3.3 llvm-link
    8. sudo ln /usr/local/Cellar/llvm33/3.3/bin/llvm-ar-3.3 llvm-ar
    9. sudo ln opt /usr/local/Cellar/llvm33/3.3/bin/ocpt-3.3
    10. (you get the idea, basically emscripten will tell you if you forgot one)

  8. setup Python:

    1. cd /usr/bin
    2. sudo ln python python2
    3. sudo ln ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 python22.7

  9. setup emscripten:

    1. cd ~
    2. git clone https://github.com/kripken/emscripten.git
    3. cd emscripten
    4. ./em++ --help

  10. try it out:

    1. ./emcc tests/hello_world_gles.c -o hello_world_gles.html
    2. open hello_world_gles.html


When the browser open the html file, it should display this scene:
Screen Shot 2013-10-20 at 01.25.23.png

And it is only 200k of js! Amazing :-P

Mkkl.

PS! I don't have access to IE11 yet, exciting times if it actually works!
Previous Entry An Evening Of Fun
1 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Emscripten On OSX

3180 views

An Evening Of Fun

1375 views

SpaceTeam5

1648 views

One Sense At A Time

1623 views

Circles

1451 views
Advertisement