diff --git a/Documentation/BuildInstructions.md b/Documentation/BuildInstructions.md index 522f984296..018b5b98f6 100644 --- a/Documentation/BuildInstructions.md +++ b/Documentation/BuildInstructions.md @@ -3,6 +3,34 @@ ### Prerequisites #### Linux prerequisites + +Ensure your CMake version is >= 3.16 with `cmake --version`. If your system doesn't provide a suitable version of CMake, you can download a binary release from the [CMake website](https://cmake.org/download). + +Ensure your gcc version is >= 10 with `gcc --version`. Otherwise, install it. + +On Ubuntu it's in the repositories of 20.04 (Focal) and later - add the `ubuntu-toolchain-r/test` PPA if you're running an older version: +```bash +sudo add-apt-repository ppa:ubuntu-toolchain-r/test +``` + +On Debian you can use the Debian testing branch: +```bash +sudo echo "deb http://http.us.debian.org/debian/ testing non-free contrib main" >> /etc/apt/sources.list +sudo apt update +``` + +Now on Ubuntu or Debian you can install gcc-10 with apt like this: +```bash +sudo apt install gcc-10 g++-10 +sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 900 --slave /usr/bin/g++ g++ /usr/bin/g++-10 +``` + +If you don't want to stay on the Debian testing branch you can switch back by running: +```bash +sudo sed -i '$d' /etc/apt/sources.list +sudo apt update +``` + Make sure you have all the dependencies installed (`ninja` is optional, but is faster in practice): **Debian / Ubuntu** @@ -30,32 +58,6 @@ sudo pacman -S --needed base-devel cmake curl mpfr libmpc gmp e2fsprogs ninja qe apt-get install curl cmake libmpc-devel gmp-devel e2fsprogs libmpfr-devel ninja-build patch gcc ``` -Ensure your gcc version is >= 10 with `gcc --version`. Otherwise, install it. - -On Ubuntu it's in the repositories of 20.04 (Focal) and later - add the `ubuntu-toolchain-r/test` PPA if you're running an older version: -```bash -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -``` - -On Debian you can use the Debian testing branch: -```bash -sudo echo "deb http://http.us.debian.org/debian/ testing non-free contrib main" >> /etc/apt/sources.list -sudo apt update -``` - -Now on Ubuntu or Debian you can install gcc-10 with apt like this: -```bash -sudo apt install gcc-10 g++-10 -sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 900 --slave /usr/bin/g++ g++ /usr/bin/g++-10 -``` - -If you don't want to stay on the testing branch you can switch back by running: -```bash -sudo sed -i '$d' /etc/apt/sources.list -sudo apt update -``` - -Ensure your CMake version is >= 3.16 with `cmake --version`. If your system doesn't provide a suitable version of CMake, you can download a binary release from the [CMake website](https://cmake.org/download). **NixOS**