如何在 CentOS 的 conda 上包含所需的 cargo 编译器?

How to include needed compilers for cargo on conda for CentOS?

我几乎没有找到关于如何成功编译 Rust 项目的信息。我将这个问题连同答案一起发布(根据 site 的建议)

对于 rustcargo 基于 conda 的安装,缺少一些编译器链接器。

$ cargo build

   Compiling hello_cargo v0.1.0 (/local/users/me/src/rasti/hello_cargo)
error: linker `/full/path/to/conda/env/bin/x86_64-conda-linux-gnu-cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: could not compile `hello_cargo`.

To learn more, run the command again with --verbose.

系统运行:

3.10.0-1062.18.1.el7.x86_64

仅在 conda 环境中安装 'gxx_linux-64' 还不够。只有包含 sysroot_linux-64 之后 cargo 才能编译。