Mac环境安装rust

2020-09-29 05:35

安装cmake

命令行安装rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup install nightly
rustup default nightly

安装llvm

cd ~/Downloads/
git clone https://github.com/llvm-mirror/llvm.git
cd ~/Downloads/llvm/tools
git clone https://github.com/llvm-mirror/clang.git
cd ~/Downloads/llvm
mkdir build
cd ~/Downloads/llvm/build/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/llvm ../
cmake --build .
sudo cmake --build . --target install

配置path,新建etc配置文件 /etc/paths.d/llvm ,写入如下内容

/usr/local/llvm/bin/