- 29 Oct 2024
- 3 Minutes to read
- DarkLight
- PDF
Getting Rust & Scrypto
- Updated on 29 Oct 2024
- 3 Minutes to read
- DarkLight
- PDF
Here you'll find steps for installing the Scrypto toolchain on Linux, macOS and Windows. Troubleshooting suggestions follow after the installation instructions.
Compatibility
The table below shows the compatibility between Scrypto and other tools.
Scrypto/Resim | LLVM/Clang | Rust |
---|---|---|
v1.3.0 | 18 | 1.81.0 |
v1.2.0 | 17 | 1.77.2 |
v1.1.0 | 17 | 1.75.0 |
v1.0.0 | 16 | 1.72.1 |
Other versions of LLVM and/or Rust may also work, but are not tested.
Install the Scrypto Toolchain
To begin working with Scrypto, you need to first prepare you system for Rust development. Then you can install the Scrypto Libraries, Radix Engine Simulator (resim
) and command line tools from the Radixdlt-Scrypto github repository. There are different steps for Windows, macOS and Linux systems.
Windows
1. Install LLVM & Rust compiler
Install git by running the git installer for windows
Enable git long path support:
git config --system core.longpaths true
Visit the Visual Studio Downloads page:
- Download "Build Tools for Visual Studio 2022"
- Once the download is complete, open the downloaded file to run the installer.
- In the installer, you will see various workloads you can install. Look for "Desktop development with C++".
- Tick the checkbox next to "Desktop development with C++". This will automatically select all the necessary components for C++ development.
- After selecting the necessary workload, click the "Install" button at the bottom right of the installer window.
- Once the installation is complete, you can close the installer.
- To verify the installation, you can a new Command Prompt or PowerShell window and type
cl
to check if the C++ compiler (cl.exe) is available.
Download and install
rustup-init.exe
Download and install
LLVM
of the required version (shown in the compatibility table) from the LLVM GitHub repository - be sure to tick the option that addsLLVM
to the system PATHInstall the required Rust toolchain
# Replace 1.81.0 with the required version rustup default 1.81.0
2. Enable cargo in the current shell
- Start a new PowerShell
3. Add WebAssembly target
rustup target add wasm32-unknown-unknown
4. Install Radix Engine Simulator and command-line tools
cargo install --force radix-clis
macOS
1. Install LLVM & Rust compiler
Make sure you have the
xcode
command line tools by running:xcode-select --install
Install
cmake
andLLVM
# Replace 18 with the required version brew install cmake llvm@18
Check, which shell is the default one by inspecting
$SHELL
variable:echo $SHELL
Add
LLVM
to the system path, by opening the file~/.zshrc
or~/.profile
:Which file to edit?Depending on your default shell you will need to have one of the following config files:
~/.zshrc
ifzsh
is the default shell, as it is on most modern macOS systems~/.profile
ifbash
is the default shell
nano ~/.zshrc
Or
nano ~/.profile
Add the following line to the file:
PATH="$(brew --prefix llvm)/bin:$PATH"
To save the changes you’ve made to the file, press
Ctrl+o
and thenEnter
. To exit nano , pressCtrl+x
and thenEnter
.
Install Rust compiler
# Replace 1.81.0 with the required version curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=1.81.0
2. Enable cargo in the current shell
source $HOME/.cargo/env
3. Add WebAssembly target
rustup target add wasm32-unknown-unknown
4. Install Radix Engine Simulator and command-line tools
cargo install --force radix-clis
Linux
1. Install LLVM & Rust compiler
Make sure a C++ compiler and
LLVM
is installed:# Replace 18 with the required version sudo apt install clang build-essential llvm-18
Install Rust compiler
# Replace 1.81.0 with the required version curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=1.81.0
2. Enable cargo in the current shell
source $HOME/.cargo/env
3. Add WebAssembly target
rustup target add wasm32-unknown-unknown
4. Install Radix Engine Simulator and command-line tools
cargo install --force radix-clis
Next Steps
If your not sure what to do after installing Scrypto have a look at our Learning Step-by-Step to learn how to start making Scrypto packages and dapps.
Troubleshooting
Have an x86 (Intel-based) MacOS? Try the following steps:
Define rust stable:
# Replace 1.81.0 with the required version rustup default 1.81.0
Install LLVM using brew:
# Replace 18 with the required version brew install llvm@18
Confirm the Installation Path:
# Replace 18 with the required version brew --prefix llvm@18
Output:
/usr/local/opt/llvm@18
Add
LLVM
to the system path, by opening the file~/.zshrc
using:nano ~/.zshrc
Add the following line to the file:
PATH="$(brew --prefix llvm@18)/bin:$PATH"
To save the changes you’ve made to the file, press
Ctrl+o
and thenEnter
. To exit nano , pressCtrl+x
and thenEnter
.Reload the environment:
source ~/.zshrc
Check that the installation of LLVM was done correctly by checking the clang version
clang --version
Install XCode from the App Store
Reset the XCode config:
xcodebuild -runFirstLaunch
Proceed to: