安装LLVM、clang时不使用系统默认的gcc、g++版本:
官方手册安装文档:
We use here the command-line, non-interactive CMake interface.
Download and install CMake. Version 3.4.3 is the minimum required.
Open a shell. Your development tools must be reachable from this shell through the PATH environment variable.
Create a build directory. Building LLVM in the source directory is not supported. cd to this directory:
$ mkdir mybuilddir $ cd mybuilddirExecute 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/rootCMake 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.

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

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



