Compilation Process & Generating Binary
Building Rippled from Source
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 developConan Configuration
macOS
conan profile new default --detect
conan profile update settings.compiler.cppstd=20 default
conan profile update settings.build_type=Debug default
conan config set general.revisions_enabled=1For Apple Clang 15 only:
conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_BEAST_USE_STD_STRING_VIEW"]' default
conan profile update 'env.CXXFLAGS="-DBOOST_BEAST_USE_STD_STRING_VIEW"' defaultUbuntu
conan profile detect --force
nano ~/.conan2/profiles/default
conan profile update settings.compiler.cppstd=20 default
conan profile update settings.compiler.libcxx=libstdc++11 defaultBuild Directory Structure
rippled/
├── bin/                # Compiled executables
├── build/              # Build artifacts and temporary files
├── src/                # Source code
├── CMakeLists.txt      # CMake configuration
└── README.mdCompiling Rippled
# Create the build directory
mkdir -p build && cd build
# Install dependencies via Conan
conan install .. --output-folder . --build --settings build_type=Debug
# Configure the project with CMake
cmake -G Ninja \
    -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
    -DCMAKE_CXX_FLAGS=-DBOOST_ASIO_HAS_STD_INVOKE_RESULT \
    -DCMAKE_BUILD_TYPE=Debug \
    -DUNIT_TEST_REFERENCE_FEE=200 \
    -Dtests=TRUE \
    -Dxrpld=TRUE \
    -Dstatic=OFF \
    -Dassert=TRUE \
    -Dwerr=TRUE \
    ..
# Build Rippled
cmake --build . --target rippled --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:
ls build/rippledThen, check the version to ensure the binary runs correctly:
./build/rippled --versionLast updated

