編譯 rust-ibverbs
(.venv) ?? /home/deeproute/go/src/github.com/jonhoo/rust-ibverbs ? git:(master) dpkg-query -L libibverbs-dev | grep verbs.h
/usr/include/infiniband/verbs.h
sudo apt-get install libibverbs-dev
sudo apt-get install rdma-core
RDMA is only provided for Linux now, and you could install them with
libibverbs-dev
(Debian/Ubuntu) orlibibverbs-devel
(RHEL/CentOS/Fedora).
yum install libibverbs-devel
yum install libnl3-devel
# NOTE: This crate requires that `libclang` 3.9 or later be installed on your system.
yum install clang
yum install clang-devel
如果安裝的 clang
包版本過低導(dǎo)致編譯失敗的話小作,可以參考鏈接:
How to install Clang and LLVM 3.9 on CentOS 7
By enabling the SCL repository you can install Clang 5.0.1 on CentOS 7 using the llvm-toolset-7 package.
?? /root/go/src/github.com/jonhoo/rust-ibverbs ? sudo yum install centos-release-scl
?? /root/go/src/github.com/jonhoo/rust-ibverbs ? sudo yum install llvm-toolset-7
?? /root/go/src/github.com/jonhoo/rust-ibverbs ? git:(master) scl -l
devtoolset-7
llvm-toolset-7
Enable llvm-toolset-7:
?? /root/go/src/github.com/jonhoo/rust-ibverbs ? scl enable llvm-toolset-7 devtoolset-7 zsh
You can now check you clang version with:
?? /root/go/src/github.com/jonhoo/rust-ibverbs ? clang --version
See this Red Hat blog post for more information.
For more information about SCL, see this page.
環(huán)境準(zhǔn)備好之后直接編譯即可先誉。
編譯后 libibverbs
庫也會(huì)在 vendor
目錄中生成。
?? /root/go/src/github.com/jonhoo/rust-ibverbs ? git:(master) ll ibverbs-sys/vendor/rdma-core/build/lib
total 7.5M
drwxr-xr-x 2 root 26 Jan 19 15:45 ibacm/
-rwxr-xr-x 1 root 170K Jan 18 12:40 libbnxt_re-rdmav34.so*
-rwxr-xr-x 1 root 254K Jan 18 12:40 libcxgb4-rdmav34.so*
lrwxrwxrwx 1 root 18 Jan 19 15:45 libefa-rdmav34.so -> libefa.so.1.1.34.0*
lrwxrwxrwx 1 root 11 Jan 18 12:40 libefa.so -> libefa.so.1*
lrwxrwxrwx 1 root 18 Jan 18 12:40 libefa.so.1 -> libefa.so.1.1.34.0*
-rwxr-xr-x 1 root 164K Jan 18 12:40 libefa.so.1.1.34.0*
-rwxr-xr-x 1 root 94K Jan 18 12:41 libhfi1verbs-rdmav34.so*
-rwxr-xr-x 1 root 286K Jan 18 12:40 libhns-rdmav34.so*
-rwxr-xr-x 1 root 164K Jan 18 12:40 libi40iw-rdmav34.so*
-rwxr-xr-x 1 root 215K Jan 18 12:41 libibacmp.so*
lrwxrwxrwx 1 root 13 Jan 18 12:41 libibmad.so -> libibmad.so.5*
lrwxrwxrwx 1 root 20 Jan 18 12:41 libibmad.so.5 -> libibmad.so.5.3.34.0*
-rwxr-xr-x 1 root 351K Jan 18 12:41 libibmad.so.5.3.34.0*
lrwxrwxrwx 1 root 17 Jan 18 12:41 libibnetdisc.so -> libibnetdisc.so.5*
lrwxrwxrwx 1 root 24 Jan 18 12:41 libibnetdisc.so.5 -> libibnetdisc.so.5.0.34.0*
-rwxr-xr-x 1 root 226K Jan 18 12:41 libibnetdisc.so.5.0.34.0*
lrwxrwxrwx 1 root 14 Jan 18 12:40 libibumad.so -> libibumad.so.3*
lrwxrwxrwx 1 root 21 Jan 18 12:40 libibumad.so.3 -> libibumad.so.3.2.34.0*
-rwxr-xr-x 1 root 104K Jan 18 12:40 libibumad.so.3.2.34.0*
lrwxrwxrwx 1 root 15 Jan 18 12:40 libibverbs.so -> libibverbs.so.1*
lrwxrwxrwx 1 root 23 Jan 18 12:40 libibverbs.so.1 -> libibverbs.so.1.12.34.0*
-rwxr-xr-x 1 root 889K Jan 18 12:40 libibverbs.so.1.12.34.0*
-rwxr-xr-x 1 root 94K Jan 18 12:41 libipathverbs-rdmav34.so*
lrwxrwxrwx 1 root 19 Jan 19 15:45 libmlx4-rdmav34.so -> libmlx4.so.1.0.34.0*
lrwxrwxrwx 1 root 12 Jan 18 12:40 libmlx4.so -> libmlx4.so.1*
lrwxrwxrwx 1 root 19 Jan 18 12:40 libmlx4.so.1 -> libmlx4.so.1.0.34.0*
-rwxr-xr-x 1 root 336K Jan 18 12:40 libmlx4.so.1.0.34.0*
lrwxrwxrwx 1 root 20 Jan 19 15:45 libmlx5-rdmav34.so -> libmlx5.so.1.18.34.0*
lrwxrwxrwx 1 root 12 Jan 18 12:40 libmlx5.so -> libmlx5.so.1*
lrwxrwxrwx 1 root 20 Jan 18 12:40 libmlx5.so.1 -> libmlx5.so.1.18.34.0*
-rwxr-xr-x 1 root 2.6M Jan 18 12:40 libmlx5.so.1.18.34.0*
-rwxr-xr-x 1 root 260K Jan 18 12:40 libmthca-rdmav34.so*
-rwxr-xr-x 1 root 156K Jan 18 12:41 libocrdma-rdmav34.so*
-rwxr-xr-x 1 root 212K Jan 18 12:41 libqedr-rdmav34.so*
lrwxrwxrwx 1 root 14 Jan 18 12:40 librdmacm.so -> librdmacm.so.1*
lrwxrwxrwx 1 root 21 Jan 18 12:40 librdmacm.so.1 -> librdmacm.so.1.3.34.0*
-rwxr-xr-x 1 root 456K Jan 18 12:40 librdmacm.so.1.3.34.0*
-rwxr-xr-x 1 root 115K Jan 18 12:40 librspreload.so*
-rwxr-xr-x 1 root 126K Jan 18 12:41 librxe-rdmav34.so*
-rwxr-xr-x 1 root 87K Jan 18 12:41 libsiw-rdmav34.so*
-rwxr-xr-x 1 root 164K Jan 18 12:41 libvmw_pvrdma-rdmav34.so*
drwxr-xr-x 2 root 162 Jan 20 15:19 pkgconfig/