要在CentOS 7上使用LLVM 7.0来构建Bazel 0.29.1,可以按照以下步骤进行操作:
sudo yum install -y epel-release
sudo yum install -y centos-release-scl
sudo yum install -y devtoolset-7 llvm-toolset-7 llvm-toolset-7-llvm-devel
source /opt/rh/llvm-toolset-7/enable
wget https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-installer-linux-x86_64.sh
chmod +x bazel-0.29.1-installer-linux-x86_64.sh
./bazel-0.29.1-installer-linux-x86_64.sh --user
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
bazel build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --cxxopt="-stdlib=libstdc++" --linkopt="-stdlib=libstdc++" --linkopt="-L/opt/rh/llvm-toolset-7/root/usr/lib64" --linkopt="-Wl,-rpath,/opt/rh/llvm-toolset-7/root/usr/lib64" --linkopt="-L/opt/rh/llvm-toolset-7/root/usr/lib" --linkopt="-Wl,-rpath,/opt/rh/llvm-toolset-7/root/usr/lib" --action_env=LD_LIBRARY_PATH="/opt/rh/llvm-toolset-7/root/usr/lib64:/opt/rh/llvm-toolset-7/root/usr/lib" //src:bazel
这样就可以在CentOS 7上使用LLVM 7.0构建Bazel 0.29.1了。请确保您已经安装了必要的依赖项,并按照上述步骤正确设置了环境变量。