Reputation: 385
So I have a docker with CentOS 7 which has installed bazel. I've installed devtoolset-8, llvm-toolset-7.0 and centos-release-scl. I've also installed bazel 0.29.1 and made.
export CC=clang
export CXX=clang++
I have an shell script which run basel. Befor bazel build command in top of the script I have
source /opt/rh/llvm-toolset-7.0/enable
which enables LLVM-7.0/Clang-7.0. But build failes with:
/opt/rh/llvm-toolset-7.0/root/usr/bin/clang: error while loading shared libraries: libLLVM-7.so: cannot open shared object file: No such file or directory
But this lib exists! It's in /opt/rh/llvm-toolset-7.0/root/usr/lib64/
May someone pls help with this ?
Upvotes: 4
Views: 969
Reputation: 3922
Add below to .bash_profile or .bashrc:
source /opt/rh/llvm-toolset-7.0/enable
export CC=/opt/rh/llvm-toolset-7.0/root/usr/bin/clang
export CXX=/opt/rh/llvm-toolset-7.0/root/usr/bin/clang++
Run below as Root
echo /opt/rh/llvm-toolset-7.0/root/usr/lib64/ > /etc/ld.so.conf.d/llvm-toolset.conf
ldconfig
Upvotes: 1