Create a directory to store the build. It doesn’t matter where, because Emscripten gets the information from the compiler configuration file (~/.emscripten). We show how to update this file later in these instructions:

Determine the number of available cores on your system (Emscripten can run many operations in parallel, so using more cores may have a significant impact on compilation time):

On Mac OS X you can get the number of cores using: Apple menu | About this mac | More info | System report. The Hardware overview on the resulting dialog includes a Total number of cores entry.

On Linux you can find the number of cores by entering the following command on the terminal: cat/proc/cpuinfo|grep"^cpucores"|uniq.

On Windows the number of cores is listed on the Task Manager | Performance Tab. You can open the Task Manager by entering Ctrl + Shift + Esc from the Desktop.

Call make to build the sources, specifying the number of available cores:

make-j4

Note

If the build completes successfully, clang, clang++, and a number of other files will be created in the release directory (<LLVM root>/build/Release/bin).

The final step is to update the ~/.emscripten file, specifying the location of fastcomp in the LLVM_ROOT variable.

Note

If you’re building the whole of Emscripten from source, following the platform-specific instructions in Building Emscripten from Source, you won’t yet have Emscripten installed. In this case, skip this step and return to those instructions.

If you already have an Emscripten environment (for example if you’re building Fastcomp using the SDK), then set LLVM_ROOT to the location of the clang binary under the build directory. This will be something like <LLVM root>/build/Release/bin or <LLVM root>/build/bin: