Skip to content

Commit

Permalink
Update build by source docs to add pre-requisites
Browse files Browse the repository at this point in the history
  • Loading branch information
jcleira committed Dec 13, 2023
1 parent aaa48ec commit 26c119a
Showing 1 changed file with 79 additions and 4 deletions.
83 changes: 79 additions & 4 deletions docs/src/cli/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 26c119a

Please sign in to comment.