前言
LLVM作为一个大型的编译套件,各种类继承关系,函数调用等十分繁杂,在Ubuntu下为了更好的,更方便的阅读LLVM套件的源码,希望通过CLion这个优秀的ide来管理这个工程。以下详细的记录了我在Ubuntu18.04.1中安装CLion和编译LLVM/Clang的步骤。对于初学者十分友好!!!
1、安装配置CLion
1.1、换源
目前我的系统仍然是刚刚安装的Ubuntu,先换上阿里源(以方便后续快速下载安装依赖包)
# 1.先用root权限打开sourses.list文件
$ sudo gedit /etc/apt/sources.list
# 2.将文件中原有的内容删除,复制粘贴下面阿里源,保存退出
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
# 3.在shell中输入以下指令更新
$ sudo apt update && sudo apt upgrade
1.2、下载安装CLion
在CLion官网获取CLion的安装包,此处我安装的是2019.3.6版本

通过Ubuntu中火狐浏览器下载的安装包应该在用户的Download目录中,我这里将其移动到用户目录中,并通过以下命令解压:
$ tar -zxvf CLion-2019.3.6.tar.gz
LLVM编译教程

本文详细介绍了在Ubuntu18.04.1环境下使用CLion安装配置及编译LLVM/Clang的过程,包括配置C/C++编译环境、安装依赖、配置编译参数等内容。
最低0.47元/天 解锁文章
5209

被折叠的 条评论
为什么被折叠?



