安装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.
After C