From 0f74f1812f12d26eda89b2ef0cb7725f26aa170c Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 8 Jun 2018 21:11:55 -0700 Subject: [PATCH] . --- Getting-started.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Getting-started.md b/Getting-started.md index 3839e3a..b7b0b0c 100644 --- a/Getting-started.md +++ b/Getting-started.md @@ -7,7 +7,7 @@ ### Build the ccls language server * Mac OS X: [homebrew-ccls](https://github.com/twlz0ne/homebrew-ccls) -* Arch Linux: [aur/ccls-git](https://aur.archlinux.org/packages/ccls-git) +* Arch Linux: [aur/ccls-git](https://aur.archlinux.org/packages/ccls-git) `extra/clang-6.0.0-1` has a bug, don't use this for now For all others, below are the quick commands for the impatient. Detailed instructions can be found at [[Build]]. @@ -25,6 +25,7 @@ Additional notes: If your `libstdc++` is too old (no C++17 header files) or have * FreeBSD 11, Linux with `clang+llvm<6`: `cmake -H. -Brelease -DCLANG_USE_BUNDLED_LIBC++=on` * FreeBSD 12, Linux with newer libstdc++/clang/llvm (e.g. Arch Linux): `cmake -H. -Brelease -DSYSTEM_CLANG=on -DUSE_SHARED_LLVM=on` +* Linux with `gcc < 7` but `clang >= 5`, `cmake -H. -Brelease -DCMAKE_CXX_COMPILER=clang++` ### Setup your editor @@ -65,7 +66,30 @@ If your project uses `-std=c++1z` `-std=c++17`, you likely need to add `-D__cpp_ ### Windows -If your project is compiled with MSVC, you may change the compiler driver (`%clang` above) to `clang-cl`, and use the initialization option `extraClangArguments` to pass three options: +If your project is compiled with MSVC, you may change the compiler driver (`%clang` above) to `clang-cl`, and use the initialization option `clang.extraArgs` to pass three options: `-fms-extensions -fms-compatibility -fdelayed-template-parsing`. See https://clang.llvm.org/docs/MSVCCompatibility.html + +### Cases + +On a laptop with one (i7-6600U CPU @ 2.60GHz, hyper-threading, `nproc`=4), 4 indexers. + +llvm+clang+extra+lld+compiler-rt (2017-06-10) + +* initial indexing: 1 hour; load: 20s +* resident set size is about 1GiB (the peak RSS during indexing is below 2GiB) +* `du -sh .ccls-cache` => 580M + +radare2 (2017-06-10) + +``` +CC=clang CXX=clang++ LDFLAGS=-fuse-ld=lld meson . debug --buildtype=debug --prefix ~/.config/radare2/debug +ln -s debug/compile_commands.json +``` + +* initial indexing: 78s; load: 3s +* 300MiB +* `du -sh .ccls-cache` => 107M + +Note: ccls can serve LSP requests while it is doing the initial indexing of the project.