skip to Main Content

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?

2

Answers


  1. Install by conda or homebrew in general, you installation failure might be powerpc64le is not your processor’s type, it’s an old processor type.

    Login or Signup to reply.
  2. There is 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.

    Add repo for devtoolset

    sudo yum install centos-release-scl-rh
    

    Create a custom repo pointing to buildlogs

    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'
    

    Install the llvm toolset packages you need

    sudo yum install --nogpgcheck llvm-toolset-11.0-clang-tools-extra llvm-toolset-11.0-clang
    

    Enable the llvm toolset

    echo "source /opt/rh/llvm-toolset-11.0/enable" >> ~/.bashrc
    source ~/.bashrc
    

    To determine why the llvm-toolset-10 rpms are not in the official SCLo repos, I put in an issue into the centos issue tracker.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search