当前位置: 首页 > article >正文

在ubuntu上安装最新版的clang

方法一:

执行如下的命令:

# 下载安装脚本

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
# 开始下载, 输入需要安装的版本号。
sudo ./llvm.sh <version number>

方法二

添加软件下载源。

请根据自己的Ubuntu系统版本添加,一次性全部都添加了。

Focal (20.04) LTS - Last update : Fri, 01 Nov 2024 20:11:24 UTC / Revision: 20241101053558+f04aaf948204
deb http://apt.llvm.org/focal/ llvm-toolchain-focal main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal main
# 18
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main
# 19
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-19 main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-19 main
Jammy (22.04) LTS - Last update : Fri, 01 Nov 2024 17:15:30 UTC / Revision: 20241101031257+b74e588e1f46
deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main
deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy main
# 18
deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
# 19
deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
Lunar (23.04) - Last update : Fri, 01 Nov 2024 19:58:02 UTC / Revision: 20241101045725+64314dedebfc
deb http://apt.llvm.org/lunar/ llvm-toolchain-lunar main
deb-src http://apt.llvm.org/lunar/ llvm-toolchain-lunar main
# 18
deb http://apt.llvm.org/lunar/ llvm-toolchain-lunar-18 main
deb-src http://apt.llvm.org/lunar/ llvm-toolchain-lunar-18 main
# 19
deb http://apt.llvm.org/lunar/ llvm-toolchain-lunar-19 main
deb-src http://apt.llvm.org/lunar/ llvm-toolchain-lunar-19 main
Mantic (23.10) - Last update : Fri, 01 Nov 2024 23:59:37 UTC / Revision: 20241101083758+57183b6fe11a
deb http://apt.llvm.org/mantic/ llvm-toolchain-mantic main
deb-src http://apt.llvm.org/mantic/ llvm-toolchain-mantic main
# 18
deb http://apt.llvm.org/mantic/ llvm-toolchain-mantic-18 main
deb-src http://apt.llvm.org/mantic/ llvm-toolchain-mantic-18 main
# 19
deb http://apt.llvm.org/mantic/ llvm-toolchain-mantic-19 main
deb-src http://apt.llvm.org/mantic/ llvm-toolchain-mantic-19 main
Noble (24.04) - Last update : Fri, 01 Nov 2024 23:20:06 UTC / Revision: 20241101081855+b24650e814e5
deb http://apt.llvm.org/noble/ llvm-toolchain-noble main
deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble main
# 18
deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main
deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main
# 19
deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main
deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main
Oracular (24.10) - Last update : Fri, 01 Nov 2024 23:38:13 UTC / Revision: 20241101083605+57183b6fe11a
deb http://apt.llvm.org/oracular/ llvm-toolchain-oracular main
deb-src http://apt.llvm.org/oracular/ llvm-toolchain-oracular main
# 18
deb http://apt.llvm.org/oracular/ llvm-toolchain-oracular-18 main
deb-src http://apt.llvm.org/oracular/ llvm-toolchain-oracular-18 main
# 19
deb http://apt.llvm.org/oracular/ llvm-toolchain-oracular-19 main
deb-src http://apt.llvm.org/oracular/ llvm-toolchain-oracular-19 main

然后执行安装指令:

apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python3-clang

refs: llvm官网的guide


http://www.kler.cn/a/376912.html

相关文章:

  • 你好,2025!JumpServer开启新十年
  • C语言基本知识复习浓缩版:标识符、函数、进制、数据类型
  • Ungoogled Chromium127 编译指南 MacOS篇(八)- 开始编译
  • 论文导读 | 数据库中的连接操作
  • 【Qt】C++11 Lambda表达式
  • 年会抽奖Html
  • c++多线程处理数据
  • 【Grafana】Grafana 基础入门
  • 多线程环境下内存池的实现(C++)
  • SpringBoot+FileBeat+ELK8.x版本收集日志
  • npm入门教程10:npm生命周期钩子
  • Flutter 获取照片权限的时候是否要获取存储权限?
  • SCSS在Vue中的用法
  • 微积分复习笔记 Calculus Volume 1 - 4.2 Linear Approximations and Differentials
  • 第7章 内容共享
  • adb 远程调试,手动修改 adb 调试授权信息
  • C++研发笔记11——C语言程序设计初阶学习笔记9
  • 力扣11.2
  • Python-GUI-概览
  • Zypher Network:全栈式 Web3 游戏引擎,服务器抽象叙事的引领者
  • libaom 源码分析:AV1帧内预测 CfL 模式
  • cdn加速原理
  • Selective Generation for Language Models 语言模型的选择性生成
  • Uniswap/v2-core使用及其交易流程
  • 【游戏引擎之路】登神长阶(十)——游戏动画制作:我想成为那一道光!
  • ubuntu【桌面】 配置NAT模式固定IP