当前位置: 首页 > 工具软件 > Rustup > 使用案例 >

Rustup安装

洪永长
2023-12-01

Rust

Rustup安装重要信息

Rustup

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

/Users/sjl/.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory located at:

/Users/sjl/.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo’s bin directory, located at:

/Users/sjl/.cargo/bin

This path will then be added to your PATH environment variable by
modifying the profile files located at:

/Users/sjl/.profile
/Users/sjl/.zprofile
/Users/sjl/.bash_profile

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:

default host triple: x86_64-apple-darwin
default toolchain: stable (default)
profile: default
modify PATH variable: yes

Cargo构建

Crates镜像加速

在运行cargo build过程中可能会由于crates下载耗时很长,可以通过国内的镜像解决。具体方式如下

vi ~/.cargo/config

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

linker cc找不到

Rust依赖Linux的C编译器

yum install gcc
yum install cmake
 类似资料: