diff options
| author | Martin Ridgers <[email protected]> | 2022-01-13 14:10:53 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2022-01-13 14:10:53 +0100 |
| commit | 1fbebd8a0c0f867291c8f13c82964827e061b00c (patch) | |
| tree | e637b2cd40b25d94fb821a1b6fd955f49d11fde0 | |
| parent | Added instructions for building on Mac (diff) | |
| download | zen-1fbebd8a0c0f867291c8f13c82964827e061b00c.tar.xz zen-1fbebd8a0c0f867291c8f13c82964827e061b00c.zip | |
Updated Linux section of README.md
| -rw-r--r-- | README.md | 36 |
1 files changed, 29 insertions, 7 deletions
@@ -57,14 +57,35 @@ Binaries are located in the `build` directory The following instructions have been collated using Ubuntu 20.04. -At the time of writing only GCC v11 supports the C++20 features used by Zen. As -this version is not available in the default package repositories we need to -get GCC from one of Ubuntu's toolchain repositories; +Zen makes heavy use of C++20 features which at the time of writing has limited +toolchain and C++ library support. A minimum compiler version of GCC-11 or +Clang-12 is required, along with GNU's libstdc+++-11 or newer. Note that it is +not currently possible to use anything other than the system's default C++ +library (e.g. LLVM's libc++) due to the way that Zen's third party dependencies +are managed via `vcpkg`. + +The first step is to acquire a suitable compiler and C++ library. On Ubuntu 20.04 +GCC-11 is not available in the standard package repositories so Ubuntu's tool- +chain test respository needs to be added to Apt (note that this is _not required_ +for Ubuntu 21.04 onwards); ``` sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test -sudo apt install -y gcc-11 -gcc-11 --version +``` + +Now GCC-11 can be install via Apt. This will also install a suitable version of +the C++ library too; + +``` +sudo apt install -y --no-install-recommends g++-11 +g++-11 --version +``` + +The easiest way to tell `xmake` to use the correct compiler version is to set +the `CXX` environment variable; + +``` +export CXX=g++-11 ``` Next we need the `xmake` build system. For this we will download and install @@ -72,17 +93,18 @@ Next we need the `xmake` build system. For this we will download and install date `.deb` files; ``` -wget https://github.com/xmake-io/xmake/releases/download/v2.5.7/xmake-v2.5.7.amd64.deb +wget https://github.com/xmake-io/xmake/releases/download/v2.6.2/xmake-v2.6.2.amd64.deb sudo dpkg -i xmake-v2.5.7.amd64.deb xmake --version ``` For some of Zen's third party dependencies are provided by Microsoft's `vcpkg` -C++ library manager. After cloning the project there is a initialisation step; +C++ library manager. After cloning the project there is an initialisation step; ``` git clone https://github.com/microsoft/vcpkg.git ~/zen/vcpkg ~/zen/vcpkg/bootstrap-vcpkg.sh +~/zen/vcpkg/vcpkg --version ``` `xmake` uses an environment variable to find `vcpkg`. Alternatively this can be |