I used docker image docker run -ti centos:7 /bin/bash
, i try install llvm-toolset-10.0
like this yum install llvm-toolset-10.0
but got error No package llvm-toolset-10.0 available.
After that i tried use pre-built binraries from https://github.com/llvm/llvm-project/releases, but got bash: ./clang: cannot execute binary file
, i used clang+llvm-13.0.0-powerpc64le-linux-rhel-7.9
.
Question how to install clang or llvm with version 10 or higher in Centos7?
There is a llvm-toolset-10 build out on the centos buildlogs. The rpms are unsigned since they never got published out to the official centos scl repos; thus they won't be trusted by default. Also note that since some of the packages in llvm-toolset have a dependency on devtoolset you will need to ensure you have the right devtoolset repo installed as well.
sudo yum install centos-release-scl-rh
sudo bash -c 'cat << EOF > /etc/yum.repos.d/llvmtoolset-build.repo
[llvmtoolset-build]
name=LLVM Toolset 11.0 - Build
baseurl=https://buildlogs.centos.org/c7-llvm-toolset-11.0.x86_64/
gpgcheck=0
enabled=1
EOF'
sudo yum install --nogpgcheck llvm-toolset-11.0-clang-tools-extra llvm-toolset-11.0-clang
echo "source /opt/rh/llvm-toolset-11.0/enable" >> ~/.bashrc
source ~/.bashrc