Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Getting Started For Windows

Richard L Ford edited this page Mar 3, 2015 · 11 revisions

Note: all commands are typed from a Windows Command Prompt, and c:\dotnet may be replaced in all commands below with the directory of your choice.

  • Install Git

    • Follow the instructions at git-scm downloads. All of the installer's defaults are acceptable.
  • Clone the Microsoft fork of LLVM to your PC

    • Change directories to where you want to place your clone and run git to clone the Microsoft fork of LLVM: > cd c:\dotnet > git clone -b MS https://github.com/microsoft/llvm

    • This will create a directory tree under llvm the contains the cloned sources.

  • Clone LLILC to your PC

    • Because LLILC is structured as an LLVM tool, it is canonically cloned into the tools subdirectory of the LLVM tree created above:

      ```
      > cd c:\dotnet\llvm\tools
      > git clone https://github.com/dotnet/llilc
      ```
      
    • This will create a directory tree under llilc the contains the cloned sources.

  • Install Python

  • Install CMake

    • Follow the instructions at CMake Install
    • Make sure to select "Add CMake to the system PATH for all users" when running the installer (all other defaults are acceptable).
  • Install Visual Studio 2013

    • Follow the instructions at Visual Studio to install the free Community edition of Visual Studio 2013.
  • If you want to run Doxygen to produce documentation from your code comments, then in addition do:

    • Install Doxygen using the instructions on its web site. The LLVM web site is using Doxygen 1.7.6.1 however the 1.8 series added support for Markdown formatting. We would like to use Markdown in our comments, so use the latest version of Doxygen.
    • Install graphviz using instructions on their site. The current version no longer modifies your path, so you should manually modify your path so that it includes "dot".
  • Create a Visual Studio Solution for LLVM + LLILC

    • Create a directory to hold the LLVM build output:

      ```
      > cd c:\dotnet
      > mkdir llvm-build
      ```
      
    • Run cmake from within the newly-created llvm-build directory with the Visual Studio backend to generate the LLVM solution:

      ```
      > cd llvm-build
      > cmake -G "Visual Studio 12 2013 Win64" ..\llvm
      ```
      
    • However if you also want to run Doxygen, use the following instead:

      ```
      > cd llvm-build
      > cmake -G "Visual Studio 12 2013 Win64" ..\llvm -DLLVM_ENABLE_DOXYGEN=ON
      ```
      
    • This will generate LLVM.sln inside the llvm-build directory.

  • Build LLVM + LLILC from the command line

    • Change directories to the LLVM build directory and set up environment variables for the Visual Studio toolchain:

      ```
      > cd c:\dotnet\llvm-build
      > "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
      ```
      
    • Start the build. Note that If you have a multi-core machine, you may request a faster, parallel build by adding the /m flag to the command line, optionally specifying the degree of parallelism (e.g. /m:4).

      ```
      > msbuild LLVM.sln /p:Configuration=Debug /p:Platform=x64 /t:ALL_BUILD
      ```
      
    • To run doxgen over the LLILC sources use the following command line:

      ```
      > msbuild LLVM.sln /p:Configuration=Debug /p:Platform=x64 /t:doxygen-llilc
      ```
      

The build steps above can also be done from Visual Studio by going to the solution explorer, right clicking the desired project (e.g. ALL_BUILD or doxygen-llilc) and selecting "build".

Clone this wiki locally