From 517427649f014ea3f4522f147f62c33f8a9c54b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?u=C4=B1=C9=90=C9=BE=20=CA=9E=20=CA=87=C9=90=C9=AF=C9=90s?= <_@skj.io> Date: Fri, 8 Feb 2019 20:52:47 -0800 Subject: [PATCH] Better instructions for building on Ubuntu 18.10 with system-installed LLVM 7 --- Build.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Build.md b/Build.md index a3ce134..66c867d 100644 --- a/Build.md +++ b/Build.md @@ -154,6 +154,34 @@ To build from source you'll need `sudo apt install zlib1g-dev ncurses-dev` On Ubuntu 16.04 install g++-7 via [these directions](https://gist.github.com/jlblancoc/99521194aba975286c80f93e47966dc5) +#### Ubuntu Cosmic 18.10 + +ccls 0.20181024.1 and later require LLVM 7, which is available on Ubuntu 18.10. +You can compile ccls against the system-installed LLVM instead needing to download LLVM separately. + +Download additional packages: + +```shell +sudo apt install -y clang libclang-dev libncurses-dev libtinfo5 llvm-dev +``` + +which should install their versioned counterparks (e.g. clang-7, libclang-7-dev, etc). + +Configure LLVM as so: + +```shell +cmake -H. -Bbuild \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=/usr/lib/llvm-7 \ + -DLLVM_INCLUDE_DIR=/usr/lib/llvm-7/include \ + -DLLVM_BUILD_INCLUDE_DIR=/usr/include/llvm-7/ \ + -DLLVM_ENABLE_RTTI=on +``` + +Notice that `LLVM_INCLUDE_DIR` points to /usr/lib, and `LLVM_BUILD_INCLUDE` points to /usr/include. + +Build as normal. You'll have a ccls library that will be compiled against the sytem-installed LLVM, and use the system clang resource directory as well. + ### Void Linux To build **ccls** on Void Linux with system Clang+LLVM: `cmake -H. -BRelease -DLLVM_ENABLE_RTTI=on`