# Compilation Process & Generating Binary

### Building Rippled from Source

[← Back to Rippled I Overview](/core-dev-bootcamp/module01.md)

***

#### Introduction

Once your development environment is properly configured, the next step is to **obtain and build the Rippled source code**.\
Rippled uses a modern C++ toolchain and relies on **Conan** for dependency management and **CMake** for project configuration. These tools ensure consistent builds across different systems while maintaining compatibility with the **C++20** standard.

This section will guide you through:

* Cloning the official Rippled repository from the XRPL Foundation’s GitHub.
* Setting up Conan profiles for macOS and Ubuntu.
* Configuring the CMake build system.
* Compiling the Rippled executable in **Debug** mode.

By following these steps, you’ll have a local, fully compiled version of Rippled — ready for testing, development, and contributing to the XRPL Core.

***

### Cloning the Rippled Repository

```
mkdir -p ~/projects
cd ~/projects
git clone https://github.com/XRPLF/rippled.git
cd rippled
git checkout develop
```

### Conan Configuration

Importing default Conan profil.

```bash
conan config install conan/profiles/ -tf $(conan config home)/profiles/
```

* You can check your Conan profile by running

```bash
conan profile show
```

If the default profile does not work for you and you do not yet have a Conan profile, you can create one by running:

```bash
conan profile detect
```

The recipes in Conan Center occasionally need to be patched for compatibility with the latest version of rippled.

To ensure our patched recipes are used, you must add our Conan remote at a higher index than the default Conan Center remote, so it is consulted first. You can do this by running:

```
conan remote add --index 0 xrplf https://conan.ripplex.io
```

### Build Directory Structure

```
rippled/
├── bin/                # Compiled executables
├── build/              # Build artifacts and temporary files
├── src/                # Source code
├── CMakeLists.txt      # CMake configuration
└── README.md
```

### Compiling Rippled

```bash
# Create the build directory
mkdir -p build && cd build

# Install dependencies via Conan
conan install .. --output-folder . --build missing --settings build_type=Debug

# Pass the CMake variable CMAKE_BUILD_TYPE and make sure it matches the one of the build_type settings you chose in the previous step
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -Dxrpld=ON -Dtests=ON ..

# Build Rippled
cmake --build . --parallel 10
```

> ⚠️ Compilation may take 30 to 60 minutes depending on your machine.

### Verifying the Build

Once compilation completes successfully, confirm that the Rippled binary has been created:

```bash
ls build/rippled
```

Then, check the version to ensure the binary runs correctly:

```
./build/rippled --version
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xrpl-commons.org/core-dev-bootcamp/module01/compilation-process-generating-binary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
