Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vladignatyev/c200bdc06ffcf803ac6e to your computer and use it in GitHub Desktop.
Save vladignatyev/c200bdc06ffcf803ac6e to your computer and use it in GitHub Desktop.
Emscripten: Installation and running on OS X. Workaround for "Cannot find /usr/bin/llvm-link", "could not check fastcomp", "LLVM version appears incorrect (seeing "7.0", expected "3.7")"

Motivation

I was unable to install Emscripten following steps in official tutorial here: http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#sdk-download-and-install

I was getting these errors trying to run emcc:

`WARNING:root:LLVM version appears incorrect (seeing "7.0", expected "3.7")`
`WARNING:root:could not check fastcomp: [Errno 2] No such file or directory`
`CRITICAL:root:Cannot find /usr/bin/llvm-link, check the paths in ~/.emscripten` 

My setup is:

  1. OS X El Capitan 10.11.3 (15D21) with NodeJS under nvm
  2. MacBook Pro 13" with Retina display, early 2015

Emscripten Installation

  1. Download and untar Emscripten Portable SDK https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
  2. Run ./emsdk update from the directory newly created by tar -xvf on previous step
  3. ./emsdk list and check that you see clang-e1.35.0-64bit, emscripten-1.35.0 and sdk-1.35.0-64bit in the list
  4. ./emsdk install sdk-1.35.0-64bit clang-e1.35.0-64bit emscripten-1.35.0 This will install Emscripten 1.35.0, Emscripten SDK itself 1.35.0, and Clang for Emscripten 1.35.0
  5. Activate Emscripten's environment variables with the command: ./emsdk activate
  6. Run now: ./emcc emsdk_portable/emscripten/1.35.0/tests/hello_world.cpp
  7. Check that generated a.out.js appeared now in your current dir.
  8. Run the program using NodeJS: node a.out.js. You will see the following:
    MacBook-Pro-Vladimir:1.35.0 ignatev$ node a.out.js
    hello, world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment