how to resolve "librocksdb-sys" compile error

error log

Compiling librocksdb-sys v5.14.2                                                                                              
error: failed to run custom build command for `librocksdb-sys v5.14.2`                                                           
process didn't exit successfully: `/user1/home/target/release/build/librocksdb-sys-56635e7b678cd86e/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-changed=rocksdb/
cargo:rerun-if-changed=snappy/

--- stderr
thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any of [\'libclang.so\', \'libclang.so.*\', \'libclang-*.so\'], set the LIBCLANG_PATH environment variable to a path where one of these files can be found (skipped: [])"', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

 

从error log上可以看出,问题就出在“can't find libclang.so”,意思是没有clang编译器,即rocksdb的lib库需要用clang编译器编译。因此解决办法就是安装clang编译器即可。

 

clang编译器的安装方法,网上一大堆,可自行google,本文提供两个傻瓜式安装:

windows:http://releases.llvm.org/6.0.0/LLVM-6.0.0-win64.exe 下载后,傻瓜式安装即可,最好装C盘,以防path找不到;

linux:一条命令搞定 

sudo apt-get install clang

 

你可能感兴趣的:(编程)