在 centos 7 (docker image) 编译 Rust librocksdb-sys 所需步骤
docker run -it centos:7 bash
# install SCL repository to get llvm packages
yum install -y centos-release-scl
# would install `llvm-toolset-7` and `devtoolset-7` to /opt/rh
# devtoolset-7 include gcc/c++/ld binary
yum install -y llvm-toolset-7
echo "source scl_source enable llvm-toolset-7 devtoolset-7" >> ~/.bashrc
# optional, just for compile fast
yum install -y llvm-toolset-7.0-lld
echo "source scl_source enable llvm-toolset-7.0" >> ~/.bashrc
# ignore rustup install ...
!> 注意 centos7 的 gcc 版本太旧 config.toml 的 linker 要选 clang 才能支持 lld
- source /opt/rh/llvm-toolset-7.0/enable
+ source scl_source enable llvm-toolset-7.0