[other] 请问如何在deepin上安装最新版本的llvm和clangd?
Tofloor
poster avatar
trutheeker
deepin
2021-02-20 16:06
Author

RT

系统里的版本都太低了,用lsp,貌似有些功能不支持。

哪位大神帮一下?

Reply Favorite View the author
All Replies
SamLukeYes
deepin
2021-02-20 16:25
#1

用 bedrock linux 装个 Arch

Reply View the author
lcw0268
deepin
2021-02-20 16:51
#2

下载对应源码或包。

https://www.llvm.org/

Reply View the author
lcw0268
deepin
2021-02-20 16:54
#3

楼主看看,llvm的:

https://apt.llvm.org/

Reply View the author
莱斯卡迪
deepin
2021-02-20 18:23
#4
lcw0268

下载对应源码或包。

https://www.llvm.org/

全是英文的,有点看不懂哈。

Reply View the author
trutheeker
deepin
2021-02-20 19:11
#5
lcw0268

楼主看看,llvm的:

https://apt.llvm.org/

请问我应该选择debian的哪个源?

Reply View the author
SamLukeYes
deepin
2021-02-20 19:45
#6
trutheeker

请问我应该选择debian的哪个源?

deepin 20 (apricot) 上游是 debian 10 (buster)

Reply View the author
lcw0268
deepin
2021-02-20 20:31
#7
莱斯卡迪

全是英文的,有点看不懂哈。

连猜带蒙。

还有百度翻译呢?

Reply View the author
Hello
deepin
2021-02-20 20:58
#8

clangd可以在github下面下载,二进制文件直接用就是了

Reply View the author
trutheeker
deepin
2021-02-20 21:35
#9
Hello

clangd可以在github下面下载,二进制文件直接用就是了

我先这样

sudo apt install llvm clang-tools clang

然后这样配置我的emacs

(require 'package)

(setq package-archives '(("gnu"   . "http://elpa.emacs-china.org/gnu/")

                         ("melpa" . "http://elpa.emacs-china.org/melpa/")))

(package-initialize)

 

(setq package-selected-packages '(lsp-mode yasnippet lsp-treemacs helm-lsp

    projectile hydra flycheck company avy which-key helm-xref dap-mode))

 

(when (cl-find-if-not #'package-installed-p package-selected-packages)

  (package-refresh-contents)

  (mapc #'package-install package-selected-packages))

 

;; sample `helm' configuration use https://github.com/emacs-helm/helm/ for details

(helm-mode)

(require 'helm-xref)

(define-key global-map [remap find-file] #'helm-find-files)

(define-key global-map [remap execute-extended-command] #'helm-M-x)

(define-key global-map [remap switch-to-buffer] #'helm-mini)

 

(which-key-mode)

(add-hook 'c-mode-hook 'lsp)

(add-hook 'c++-mode-hook 'lsp)

 

(setq gc-cons-threshold (* 100 1024 1024)

      read-process-output-max (* 1024 1024)

      treemacs-space-between-root-nodes nil

      company-idle-delay 0.0

      company-minimum-prefix-length 1

      lsp-idle-delay 0.1 ;; clangd is fast

      ;; be more ide-ish

      lsp-headerline-breadcrumb-enable t)

 

(with-eval-after-load 'lsp-mode

  (add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)

  (require 'dap-cpptools)

  (yas-global-mode))

 

现在已经成功的提示到我的代码了,可是。。。。。。。。

lsp-treemacs-symbols列表是空的

然后我在clangd的github上面直接安装了clangd11,依然如故,所以我怀疑是llvm版本的问题。

因为在ubuntu和windows下,都没有问题。

Reply View the author
trutheeker
deepin
2021-02-20 21:38
#10
SamLukeYes

deepin 20 (apricot) 上游是 debian 10 (buster)

我用了buster的源,都用不了

Reply View the author
SamLukeYes
deepin
2021-02-21 01:54
#11
trutheeker

我用了buster的源,都用不了

什么叫“用不了”?

Reply View the author
trutheeker
deepin
2021-02-21 05:30
#12
SamLukeYes

什么叫“用不了”?

 

用的下面的源:

deb http://apt.llvm.org/buster/ llvm-toolchain-buster main
deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster main
Reply View the author
trutheeker
deepin
2021-02-21 06:27
#13
SamLukeYes

什么叫“用不了”?

 

感谢指点,导入密钥之后可以用了,就是太特么慢了。

Reply View the author
trutheeker
deepin
2021-02-21 14:29
#14

好的,问题已经完满解决,感谢各位!

Reply View the author