diff --git a/docs/src/cli/install.md b/docs/src/cli/install.md index 06efc82851ba0a..22cfa145f157a8 100644 --- a/docs/src/cli/install.md +++ b/docs/src/cli/install.md @@ -149,11 +149,86 @@ set PATH=%cd%/bin;%PATH% ## Build From Source If you are unable to use the prebuilt binaries or prefer to build it yourself -from source, navigate to -[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest), -and download the **Source Code** archive. Extract the code and build the -binaries with: +from source, follow these steps, ensuring you have the necessary prerequisites +installed on your system. + +### Prerequisites + +Before building from source, make sure to install the following prerequisites: +#### For Debian and Other Linux Distributions: +Rust Programming Language: +Check "Install Rust" at +[https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install), +which recommends the following command. +```bash +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` +Build Essential Tools: +```bash +apt install build-essential +``` +Package Config: +```bash +apt install pkg-config +``` +Udev Development Files: +```bash +apt-get install libudev-dev +``` +LLMV && libclang-dev: +```bash +apt-get install llvm libclang-dev +``` +Protocol Buffers Compiler: +```bash +apt-get install protobuf-compiler +``` + +#### For Other Linux Distributions: +Replace `apt` with your distribution's package manager (e.g., `yum`, `dnf`, +`pacman`) and adjust package names as needed. + +#### For macOS: +Install Homebrew (if not already installed), check "Install Hombrew" at +[https://brew.sh/](https://brew.sh/), which recommends the following command: +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` +Install the necessary tools and libraries using Homebrew: +```bash +brew install rust pkg-config libudev protobuf llvm coreutils +``` +Follow the instructions given at the end of the brew install command about +PATH configurations. + +#### For Windows: +Rust Programming Language: +Check "Install Rust" at +[https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install), +which recommends the following command. +```bash +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` +Install Build Tools for Visual Studio 2019 or later: +Download and install the Build Tools for Visual Studio from the +[Visual Studio downloads page](https://visualstudio.microsoft.com/downloads/). +Make sure to include the C++ build tools and Windows SDK in the installation. +Install LLVM: +Download and install LLVM from the +[official LLVM download page](https://releases.llvm.org/download.html). +Install Protocol Buffers Compiler (protoc): +Download `protoc` from the +[GitHub releases page of Protocol Buffers](https://github.com/protocolbuffers/protobuf/releases), +and add it to your PATH. + +### Building from Source + +After installing the prerequisites, proceed with building Solana from source, +navigate to +[Solana's GitHub releases page](https://github.com/solana-labs/solana/releases/latest), +and download the **Source Code** archive. +Extract the code and build the binaries with: ```bash ./scripts/cargo-install-all.sh . export PATH=$PWD/bin:$PATH