Skip to content

Building ChakraCore

Doug Ilijev edited this page Jul 5, 2016 · 30 revisions

Windows

You can build ChakraCore on Windows 7 SP1 or above, and Windows Server 2008 R2 or above, with either Visual Studio 2013 or 2015, as long as C++ support is installed*. For Linux support, ChakraCore is making progress in the Linux branch. Refer to the Linux section for building instructions on Linux.

To build ChakraCore on Windows:

  • Clone ChakraCore through git clone https://github.com/Microsoft/ChakraCore.git
  • Open Build\Chakra.Core.sln in Visual Studio.
  • Select the target Platform and Configuration and build the solution.
  • Build output will be under Build\VcBuild\bin.

Alternatively, run msbuild on the command line:

msbuild /m /p:Platform=... /p:Configuration=... Build\Chakra.Core.sln

Platform

ChakraCore on Windows can be built for 3 Platforms: x86, x64 and arm.

Build for arm: Due to toolset dependency, you will need following to build for the arm platform:

Configuration

ChakraCore on Windows supports 3 configurations:

  • Debug: Not optimized, with full runtime checks and all test hooks.
  • Release: Fully optimized, with fewer runtime checks and no test hooks.
  • Test: Optimized, very similar to Release but with more runtime checks and most test hooks.

Deployment

If you use ChakraCore you will need to deploy ChakraCore.dll with your application. You may also need to redistribute MSVC runtime libraries because ChakraCore.dll has runtime dependency on MSVC libraries by default. For more information see Redistributing Visual C++ Files.

Alternatively, you can build ChakraCore without MSVC runtime dependency. Pass an additional parameter to msbuild so that ChakraCore links to MSVC libraries statically:

msbuild ... /p:RuntimeLib=static_library ...

Linux

ChakraCore on Linux is still under development. We are working on a first implementation of ChakraCore interpreter and runtime, no JIT, on Linux, targeting x64 Ubuntu 16.04 LTS and Clang 3.8+. We will add JIT later as we progress. You can test the current support with the following instructions.

To build ChakraCore on Linux:

  • Make sure you have Ubuntu 16.04 LTS on your machine or VM. Visit http://releases.ubuntu.com/ to download latest LTS (x64).
  • Open terminal and start the update process.
    • sudo apt-get update
    • sudo apt-get dist-upgrade
  • Install git.
    • sudo apt-get install -y git
  • Clone ChakraCore.
    • mkdir Github && cd Github
    • git clone https://github.com/Microsoft/ChakraCore
  • Install dependencies.
    • sudo apt-get install -y build-essential cmake clang uuid-dev libunwind-dev libicu-dev liblttng-ust-dev
  • Let's build!
    • cd ChakraCore
    • git checkout linux
    • ./build.sh
    • You can specify --debug or --test-build to build.sh to select Debug or Test build flavors respectively. Default is Release build.
    • You can specify --static to build ChakraCore as a static library.
  • If you'd like to build using ninja instead of cmake:
    • sudo apt-get install -y ninja-build
    • Run ninja --version and ensure that at least version 1.3 is installed.
    • Specify the -n flag to build.sh to build with ninja.
  • [Optional] Install some useful packages for better development experience.
    • sudo apt-get install -y meld
    • Download and install VSCode.
Clone this wiki locally