Skip to content

Install the Prerequisites

Jannik Vogel edited this page Apr 29, 2018 · 26 revisions

This is part of the Getting Started guide. Please read the full guide if you have trouble.

Prerequisites

You will need the following tools:

You will find platform specific instructions to install these below.

Windows

Option 1: Windows subsystem for Linux (Windows 10 only)

You will need the Windows Subsystem for Linux. If you haven't installed it yet, please follow this guide prior to start: https://docs.microsoft.com/it-it/windows/wsl/install-win10

Open a Bash shell and run the following command

sudo apt-get install build-essential flex bison clang git

Now, you will have to add the llvm repository to your sources.list. So, run this command:

sudo nano /etc/apt/sources.list

and paste this string at the end of the list:

deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial main

then save the file and quit (ctrl+x and then press the 'y' key to save). Now it is time to refresh, with:

sudo apt-get update && sudo apt-get upgrade

we can now install llvm:

sudo apt-get install clang-4.0 lldb-4.0 llvm-4.0 llvm-4.0-dev

you might need to create an alias for lld-link:

alias lld-link=lld-link-6.0

If the alias does not work, you may need to create a symlink:

which lld-link-6.0

ln -s <path to lld-link-6.0 from previous cmd> <path>/lld-link

For example, if lld-link-6.0 is in /usr/bin:

ln -s /usr/bin/lld-link-6.0 /usr/bin/lld-link

Option 2: MSYS2

Install MSYS2

In MSYS2 Shell:

pacman -S make git gcc bison flex llvm clang

macOS

On macOS with Homebrew, this should do the job (XCode ships with make and bison and flex):

brew install llvm --with-lld --with-clang

Linux

Ubuntu

sudo apt-get install build-essential flex bison clang git

Then install lld from an LLVM nightly package