Download and install

The Emscripten SDK provides the whole Emscripten toolchain (Clang, Python, Node.js and Visual Studio integration) in a single easy-to-install package, with integrated support for updating to newer SDKs as they are released.

Tip

If you are contributing to Emscripten you should build Emscripten from source.

SDK Downloads

Download one of the SDK installers below to get started with Emscripten development. The Windows NSIS installers are the easiest to set up, while the portable SDKs can be moved between computers and do not require administration privileges.

Windows

Linux and Mac OS X

Installation instructions

Check the relevant section below for instructions on installing your selected package.

Windows: Installing using an NSIS installer

The NSIS installers register the Emscripten SDK as a standard Windows application. To install the SDK, download an NSIS .exe file, double-click on it, and run through the installer to perform the installation.

After the installer finishes, the full Emscripten toolchain will be available in the directory that was chosen during the installation, and no other steps are necessary. If your system has Visual Studio 2010 installed, the vs-tool MSBuild plugin will be automatically installed as well.

Windows, OSX and Linux: Installing the Portable SDK

The Portable Emscripten SDK is a no-installer version of the SDK package. It is identical to the NSIS installer, except that it does not interact with the Windows registry. This allows Emscripten to be used on a computer without administrative privileges, and means that the installation can be migrated from one location (directory or computer) to another by simply copying the directory contents to the new location.

First check the Platform-specific notes below and install any prerequisites.

Install or update the SDK using the following steps:

  1. Download and unzip the portable SDK package to a directory of your choice. This directory will contain the Emscripten SDK.

  2. Open a command prompt inside the SDK directory and run the following emsdk commands to get the latest tools from Github and set them as active:

    # Fetch the latest registry of available tools.
    ./emsdk update
    
    # Download and install the latest SDK tools.
    ./emsdk install latest
    
    # Make the "latest" SDK "active"
    ./emsdk activate latest
    

    Note

    On Windows, invoke the tool with emsdk instead of ./emsdk.

  3. Linux and Mac OS X only: Call source ./emsdk_env.sh after activate to set the system path to the active version of Emscripten:

    # Set the current Emscripten path on Linux/Mac OS X
    source ./emsdk_env.sh
    

    This step is not required on Windows because calling the activate command also sets the correct system path (this is not possible on Linux due to security restrictions).

Whenever you change the location of the Portable SDK (e.g. take it to another computer), re-run the ./emsdk activate latest command (and source ./emsdk_env.sh for Linux).

Platform-specific notes

Mac OS X

  • Git is not installed automatically. Git is only needed if you want to use tools from one of the development branches directly (emscripten-incoming or emscripten-master). To install git on OSX:

    1. Install XCode and the XCode Command Line Tools. This will provide git to the system PATH. For more help on this step, see this stackoverflow post.
    2. Install git directly from http://git-scm.com/.
  • Java is not bundled with the Emscripten SDK. After installing Emscripten via emsdk, typing ./emcc --help should pop up a dialog that will automatically download a Java Runtime to the system:

    Java is not installed. To open Java, you need a Java SE 6 runtime.
    Would you like to install one now?
    
  • The python2 command line tool is not present on OSX by default. To manually work around this issue, follow the linked step in Getting started on Mac OS X.

Linux

Pre-built binaries of tools are not available on Linux. Installing a tool will automatically clone and build that tool from the sources inside the emsdk directory.

Note

Emsdk does not install any tools to the system, or otherwise interact with Linux package managers. All file changes are done inside the emsdk/ directory.

  • The system must have a working Compiler toolchain (because emsdk builds software from the source):

    #Update the package lists
    sudo apt-get update
    
    # Install *gcc* (and related dependencies)
    sudo apt-get install build-essential
    
    # Install cmake
    sudo apt-get install cmake
    

Note

You will probably need CMake version 2.8.8 or later.

  • Python, node.js or Java are not provided by emsdk. The user is expected to install these beforehand with the system package manager:

    # Install Python
    sudo apt-get install python2.7
    
    # Install node.js
    sudo apt-get install nodejs
    
    # Install Java
    sudo apt-get install default-jre
    
  • Git is not installed automatically. Git is only needed if you want to use tools from one of the development branches emscripten-incoming or emscripten-master:

    # Install git
    sudo apt-get install git-core
    

More detailed instructions on the toolchain are provided in: Manually Building Emscripten on Linux.

Verifying the installation

The easiest way to verify the installation is to compile some code using Emscripten.

You can jump ahead to the Emscripten Tutorial, but if you have any problems building you should run through the basic tests and troubleshooting instructions in Verifying the Emscripten Development Environment.

Updating the SDK

Tip

You only need to install the SDK once! After that you can update to the latest SDK at any time using Emscripten SDK (emsdk).

Type the following (omitting comments) on the Emscripten Command Prompt:

# Fetch the latest registry of available tools.
./emsdk update

# Download and install the latest SDK tools.
./emsdk install latest

# Set up the compiler configuration to point to the "latest" SDK.
./emsdk activate latest

# Linux/Mac OS X only: Set the current Emscripten path
source ./emsdk_env.sh

The package manager can do many other maintenance tasks ranging from fetching specific old versions of the SDK through to using the versions of the tools on Github (or even your own fork). Check out all the possibilities in the “How to” guides.

Uninstalling the Emscripten SDK

If you installed the SDK using an NSIS installer on Windows, launch: Control Panel -> Uninstall a program -> Emscripten SDK.

If you want to remove a Portable SDK, just delete the directory containing the Portable SDK.

It is also possible to remove specific SDKs using emsdk.

Archived releases

You can always install old SDK and compiler toolchains using a current SDK. See How do I install and activate old Emscripten SDKs and tools? for more information.

On Windows, you can also install one of the old versions via an offline NSIS installer:

A snapshot of all tagged releases (not SDKs) can be found at emscripten/releases.