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

Setup With LLILC Out Of LLVM Tree

Richard L Ford edited this page Apr 8, 2015 · 7 revisions

In the Getting Started for Windows directions are given on how to configure LLILC when the LLILC repository is placed in the LLVM/tools subdirectory. This page tells how to configure LLVM and LLILC when the LLILC workspace is separate from the LLVM workspace. This might be desirable, for example, if you want to have multiple LLILC workspaces (for working on multiple branches simultaneously) but want to share a single LLVM workspace and LLVM build.

We only document the steps that are different from the "Getting Started with Windows" page.

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.

Steps that are the same are:

  • Install Git
  • Clone and build CoreCLR:
  • Clone the Microsoft fork of LLVM to your PC
  • Install Python
  • Install CMake
  • Install Visual Studio 2013
  • Install Doxygen
  • Install graphviz

Steps that are different:

  • Clone LLILC to your PC

    • Unlike the default directions, create a separate LLILC directory.:

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

  • Create a Visual Studio Solution for LLVM

    • 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
      ```
      note: for Windows $platform should resolve to 'Windows_NT'
      
    • 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.

  • Create a Visual Studio Solution for LLILC

    • Create a directory to hold the LLILC build output:

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

      ```
      > cd llilc-build
      > cmake -G "Visual Studio 12 2013 Win64" ..\llilc -DWITH_CORECLR=<coreclr path>\bin\Product\$platform.$arch.$build> -DWITH_LLVM=<root>/llvm-build
      ```
      note: for Windows $platform should resolve to 'Windows_NT'
      
    • However if you also want to run Doxygen, use the following instead:

      ```
      > cd llvm-build
      > cmake -G "Visual Studio 12 2013 Win64" ..\llilc -DWITH_CORECLR=<coreclr path>\bin\Product\$platform.$arch.$build> -DWITH_LLVM=<root>/llvm-build-DLLVM_ENABLE_DOXYGEN=ON
      ```
      
    • This will generate LLILC.sln inside the llilc-build directory.

  • Build LLVM 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
      ```
      
  • 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