安装llvm、clang指定使用非默认gcc、g++

这篇博客介绍了如何在安装LLVM和clang时避免使用系统默认的gcc和g++。按照官方文档,首先创建一个构建目录,然后通过CMake配置构建过程,确保开发工具在PATH环境变量中可访问。如果遇到问题,如'llvm'中没有'sort'成员的错误,建议下载最新clang源码替换并重新编译。
摘要由CSDN通过智能技术生成

安装LLVM、clang时不使用系统默认的gcc、g++版本:

官方手册安装文档:

We use here the command-line, non-interactive CMake interface.

  1. Download and install CMake. Version 3.4.3 is the minimum required.

  2. Open a shell. Your development tools must be reachable from this shell through the PATH environment variable.

  3. Create a build directory. Building LLVM in the source directory is not supported. cd to this directory:

    $ mkdir mybuilddir
    $ cd mybuilddir
  4. Execute this command in the shell replacing path/to/llvm/source/root with the path to the root of your LLVM source tree:

    $ cmake path/to/llvm/source/root

    CMake will detect your development environment, perform a series of tests, and generate the files required for building LLVM. CMake will use default values for all build parameters. See the Options and variables section for a list of build parameters that you can modify.

    This can fail if CMake can’t detect your toolset, or if it thinks that the environment is not sane enough. In this case, make sure that the toolset that you intend to use is the only one reachable from the shell, and that the shell itself is the correct one for your development environment. CMake will refuse to build MinGW makefiles if you have a POSIX shell reachable through the PATH environment variable, for instance. You can force CMake to use a given build tool; for instructions, see the Usage section, below.

  5. After C

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值