如何在CentOS 7上安装Clang和LLVM 3.9 [英] How to install Clang and LLVM 3.9 on CentOS 7

查看:1245
本文介绍了如何在CentOS 7上安装Clang和LLVM 3.9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从以下位置获取了rpm软件包 https://copr-be.cloud.fedoraproject.org/results/alonid/llvm-3.9.0/epel-7-x86_64/00505197-clang-3.9.0/适用于Clang 3.9.

我正在通过命令安装rpm软件包

rpm -ivh clang-3.9.0-3.9.0-3.1.el7.centos.alonid.src.rpm

但是当我这样做

rpm -ivh clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64.rpm

我收到以下错误:

error: Failed dependencies:
    clang-3.9.0-libs(x86-64) = 3.9.0-3.1.el7.centos.alonid is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libLLVM-3.9.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclang.so.3.9()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangAST.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangBasic.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangCodeGen.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangDriver.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangFormat.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangFrontend.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangFrontendTool.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangIndex.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangRewrite.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangRewriteFrontend.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangStaticAnalyzerFrontend.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangTooling.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangToolingCore.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64

我应该从哪里安装所有这些依赖项?

解决方案

通过启用SCL存储库,您可以使用 Red Hat博客帖子了解更多信息.

有关SCL的更多信息,请参见此页面. /p>

I have taken rpm packages from https://copr-be.cloud.fedoraproject.org/results/alonid/llvm-3.9.0/epel-7-x86_64/00505197-clang-3.9.0/ for Clang 3.9.

I am installing the rpm packages by the command

rpm -ivh clang-3.9.0-3.9.0-3.1.el7.centos.alonid.src.rpm

But when I do

rpm -ivh clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64.rpm

I get the following error :

error: Failed dependencies:
    clang-3.9.0-libs(x86-64) = 3.9.0-3.1.el7.centos.alonid is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libLLVM-3.9.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclang.so.3.9()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangAST.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangBasic.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangCodeGen.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangDriver.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangFormat.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangFrontend.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangFrontendTool.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangIndex.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangRewrite.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangRewriteFrontend.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangStaticAnalyzerFrontend.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangTooling.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64
    libclangToolingCore.so()(64bit) is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64

Where should I install all these dependencies from?

解决方案

By enabling the SCL repository you can install Clang 5.0.1 on CentOS 7 using the llvm-toolset-7 package.

$ sudo yum install centos-release-scl
$ sudo yum install llvm-toolset-7

Enable llvm-toolset-7:

$ scl enable llvm-toolset-7 bash

You can now check you clang version with:

$ clang --version

See this Red Hat blog post for more information.

For more information about SCL, see this page.

这篇关于如何在CentOS 7上安装Clang和LLVM 3.9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆