mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
326 lines
27 KiB
HTML
326 lines
27 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.5"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>rippled: BUILD</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">rippled
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.5 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div><!-- top -->
|
|
<div><div class="header">
|
|
<div class="headertitle"><div class="title">BUILD </div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><p >| :warning: <b>WARNING</b> :warning: |—| | These instructions assume you have a C++ development environment ready with Git, Python, Conan, CMake, and a C++ compiler. For help setting one up on Linux, macOS, or Windows, <a class="el" href="md____w_rippled_rippled_docs_build_environment.html">see this guide</a>. |</p>
|
|
<blockquote class="doxtable">
|
|
<p >‍These instructions also assume a basic familiarity with Conan and CMake. If you are unfamiliar with Conan, you can read our <a class="el" href="md____w_rippled_rippled_docs_build_conan.html">crash course</a> or the official <a href="https://docs.conan.io/en/latest/getting_started.html">Getting Started</a> walkthrough. </p>
|
|
</blockquote>
|
|
<h2><a class="anchor" id="autotoc_md25"></a>
|
|
Branches</h2>
|
|
<p >For a stable release, choose the <code>master</code> branch or one of the <a href="https://github.com/ripple/rippled/releases">tagged releases</a>.</p>
|
|
<div class="fragment"><div class="line">git checkout master</div>
|
|
</div><!-- fragment --><p >For the latest release candidate, choose the <code>release</code> branch.</p>
|
|
<div class="fragment"><div class="line">git checkout release</div>
|
|
</div><!-- fragment --><p >For the latest set of untested features, or to contribute, choose the <code>develop</code> branch.</p>
|
|
<div class="fragment"><div class="line">git checkout develop</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md26"></a>
|
|
Minimum Requirements</h2>
|
|
<p >See <a href="https://xrpl.org/system-requirements.html">System Requirements</a>.</p>
|
|
<p >Building rippled generally requires git, Python, Conan, CMake, and a C++ compiler. Some guidance on setting up such a <a class="el" href="md____w_rippled_rippled_docs_build_environment.html">C++ development environment can be found here</a>.</p>
|
|
<ul>
|
|
<li><a href="https://www.python.org/downloads/">Python 3.7</a></li>
|
|
<li><a href="https://conan.io/downloads.html">Conan 1.60</a>[^1]</li>
|
|
<li><a href="https://cmake.org/download/">CMake 3.16</a></li>
|
|
</ul>
|
|
<p >[^1]: It is possible to build with Conan 2.x, but the instructions are significantly different, which is why we are not recommending it yet. Notably, the <code>conan profile update</code> command is removed in 2.x. Profiles must be edited by hand.</p>
|
|
<p ><code>rippled</code> is written in the C++20 dialect and includes the <code><concepts></code> header. The <a href="https://en.cppreference.com/w/cpp/compiler_support/20">minimum compiler versions</a> required are:</p>
|
|
<table class="markdownTable">
|
|
<tr class="markdownTableHead">
|
|
<th class="markdownTableHeadNone">Compiler </th><th class="markdownTableHeadNone">Version </th></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone">GCC </td><td class="markdownTableBodyNone">11 </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone">Clang </td><td class="markdownTableBodyNone">13 </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone">Apple Clang </td><td class="markdownTableBodyNone">13.1.6 </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone">MSVC </td><td class="markdownTableBodyNone">19.23 </td></tr>
|
|
</table>
|
|
<h3><a class="anchor" id="autotoc_md27"></a>
|
|
Linux</h3>
|
|
<p >The Ubuntu operating system has received the highest level of quality assurance, testing, and support.</p>
|
|
<p >Here are <a href="./docs/build/environment.md#linux">sample instructions for setting up a C++ development environment on Linux</a>.</p>
|
|
<h3><a class="anchor" id="autotoc_md28"></a>
|
|
Mac</h3>
|
|
<p >Many rippled engineers use macOS for development.</p>
|
|
<p >Here are <a href="./docs/build/environment.md#macos">sample instructions for setting up a C++ development environment on macOS</a>.</p>
|
|
<h3><a class="anchor" id="autotoc_md29"></a>
|
|
Windows</h3>
|
|
<p >Windows is not recommended for production use at this time.</p>
|
|
<ul>
|
|
<li>Additionally, 32-bit Windows development is not supported.</li>
|
|
</ul>
|
|
<h2><a class="anchor" id="autotoc_md30"></a>
|
|
Steps</h2>
|
|
<h3><a class="anchor" id="autotoc_md31"></a>
|
|
Set Up Conan</h3>
|
|
<p >After you have a <a class="el" href="md____w_rippled_rippled_docs_build_environment.html">C++ development environment</a> ready with Git, Python, Conan, CMake, and a C++ compiler, you may need to set up your Conan profile.</p>
|
|
<p >These instructions assume a basic familiarity with Conan and CMake.</p>
|
|
<p >If you are unfamiliar with Conan, then please read <a class="el" href="md____w_rippled_rippled_docs_build_conan.html">this crash course</a> or the official <a href="https://docs.conan.io/en/latest/getting_started.html">Getting Started</a> walkthrough.</p>
|
|
<p >You'll need at least one Conan profile:</p>
|
|
<div class="fragment"><div class="line">conan profile new default --detect</div>
|
|
</div><!-- fragment --><p >Update the compiler settings:</p>
|
|
<div class="fragment"><div class="line">conan profile update settings.compiler.cppstd=20 default</div>
|
|
</div><!-- fragment --><p >Configure Conan (1.x only) to use recipe revisions:</p>
|
|
<div class="fragment"><div class="line">conan config set general.revisions_enabled=1</div>
|
|
</div><!-- fragment --><p ><b>Linux</b> developers will commonly have a default Conan <a href="https://docs.conan.io/en/latest/reference/profiles.html">profile</a> that compiles with GCC and links with libstdc++. If you are linking with libstdc++ (see profile setting <code>compiler.libcxx</code>), then you will need to choose the <code>libstdc++11</code> ABI:</p>
|
|
<div class="fragment"><div class="line">conan profile update settings.compiler.libcxx=libstdc++11 default</div>
|
|
</div><!-- fragment --><p >Ensure inter-operability between <code>boost::string_view</code> and <code><a class="elRef" href="http://en.cppreference.com/w/cpp/string/basic_string_view.html">std::string_view</a></code> types:</p>
|
|
<div class="fragment"><div class="line">conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_BEAST_USE_STD_STRING_VIEW"]' default</div>
|
|
<div class="line">conan profile update 'env.CXXFLAGS="-DBOOST_BEAST_USE_STD_STRING_VIEW"' default</div>
|
|
</div><!-- fragment --><p >If you have other flags in the <code>conf.tools.build</code> or <code>env.CXXFLAGS</code> sections, make sure to retain the existing flags and append the new ones. You can check them with: </p><div class="fragment"><div class="line">conan profile show default</div>
|
|
</div><!-- fragment --><p ><b>Windows</b> developers may need to use the x64 native build tools. An easy way to do that is to run the shortcut "x64 Native Tools Command
|
|
Prompt" for the version of Visual Studio that you have installed.</p>
|
|
<p >Windows developers must also build <code>rippled</code> and its dependencies for the x64 architecture:</p>
|
|
<div class="fragment"><div class="line">conan profile update settings.arch=x86_64 default</div>
|
|
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md32"></a>
|
|
Multiple compilers</h3>
|
|
<p >When <code>/usr/bin/g++</code> exists on a platform, it is the default cpp compiler. This default works for some users.</p>
|
|
<p >However, if this compiler cannot build rippled or its dependencies, then you can install another compiler and set Conan and CMake to use it. Update the <code>conf.tools.build:compiler_executables</code> setting in order to set the correct variables (<code>CMAKE_<LANG>_COMPILER</code>) in the generated CMake toolchain file. For example, on Ubuntu 20, you may have gcc at <code>/usr/bin/gcc</code> and g++ at <code>/usr/bin/g++</code>; if that is the case, you can select those compilers with: </p><div class="fragment"><div class="line">conan profile update 'conf.tools.build:compiler_executables={"c": "/usr/bin/gcc", "cpp": "/usr/bin/g++"}' default</div>
|
|
</div><!-- fragment --><p >Replace <code>/usr/bin/gcc</code> and <code>/usr/bin/g++</code> with paths to the desired compilers.</p>
|
|
<p >It should choose the compiler for dependencies as well, but not all of them have a Conan recipe that respects this setting (yet). For the rest, you can set these environment variables. Replace <code><path></code> with paths to the desired compilers:</p>
|
|
<ul>
|
|
<li><code>conan profile update env.CC=<path> default</code></li>
|
|
<li><code>conan profile update env.CXX=<path> default</code></li>
|
|
</ul>
|
|
<p >Export our <a href="./external/snappy">Conan recipe for Snappy</a>. It does not explicitly link the C++ standard library, which allows you to statically link it with GCC, if you want.</p>
|
|
<div class="fragment"><div class="line"># Conan 1.x</div>
|
|
<div class="line">conan export external/snappy snappy/1.1.10@</div>
|
|
<div class="line"># Conan 2.x</div>
|
|
<div class="line">conan export --version 1.1.10 external/snappy</div>
|
|
</div><!-- fragment --><p >Export our <a href="./external/rocksdb">Conan recipe for RocksDB</a>. It does not override paths to dependencies when building with Visual Studio.</p>
|
|
<div class="fragment"><div class="line"># Conan 1.x</div>
|
|
<div class="line">conan export external/rocksdb rocksdb/6.29.5@</div>
|
|
<div class="line"># Conan 2.x</div>
|
|
<div class="line">conan export --version 6.29.5 external/rocksdb</div>
|
|
</div><!-- fragment --><p >Export our <a href="./external/soci">Conan recipe for SOCI</a>. It patches their CMake to correctly import its dependencies.</p>
|
|
<div class="fragment"><div class="line"># Conan 1.x</div>
|
|
<div class="line">conan export external/soci soci/4.0.3@</div>
|
|
<div class="line"># Conan 2.x</div>
|
|
<div class="line">conan export --version 4.0.3 external/soci</div>
|
|
</div><!-- fragment --><p >Export our <a href="./external/nudb">Conan recipe for NuDB</a>. It fixes some source files to add missing <code>#include</code>s.</p>
|
|
<div class="fragment"><div class="line"># Conan 1.x</div>
|
|
<div class="line">conan export external/nudb nudb/2.0.8@</div>
|
|
<div class="line"># Conan 2.x</div>
|
|
<div class="line">conan export --version 2.0.8 external/nudb</div>
|
|
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md33"></a>
|
|
Build and Test</h3>
|
|
<ol type="1">
|
|
<li><p class="startli">Create a build directory and move into it.</p>
|
|
<div class="fragment"><div class="line">mkdir .build</div>
|
|
<div class="line">cd .build</div>
|
|
</div><!-- fragment --><p class="startli">You can use any directory name. Conan treats your working directory as an install folder and generates files with implementation details. You don't need to worry about these files, but make sure to change your working directory to your build directory before calling Conan.</p>
|
|
<p class="startli"><b>Note:</b> You can specify a directory for the installation files by adding the <code>install-folder</code> or <code>-if</code> option to every <code>conan install</code> command in the next step.</p>
|
|
</li>
|
|
<li><p class="startli">Generate CMake files for every configuration you want to build.</p>
|
|
<div class="fragment"><div class="line">conan install .. --output-folder . --build missing --settings build_type=Release</div>
|
|
<div class="line">conan install .. --output-folder . --build missing --settings build_type=Debug</div>
|
|
</div><!-- fragment --><p class="startli">For a single-configuration generator, e.g. <code>Unix Makefiles</code> or <code>Ninja</code>, you only need to run this command once. For a multi-configuration generator, e.g. <code>Visual Studio</code>, you may want to run it more than once.</p>
|
|
<p class="startli">Each of these commands should also have a different <code>build_type</code> setting. A second command with the same <code>build_type</code> setting will overwrite the files generated by the first. You can pass the build type on the command line with <code>--settings build_type=$BUILD_TYPE</code> or in the profile itself, under the section <code>[settings]</code> with the key <code>build_type</code>.</p>
|
|
<p class="startli">If you are using a Microsoft Visual C++ compiler, then you will need to ensure consistency between the <code>build_type</code> setting and the <code>compiler.runtime</code> setting.</p>
|
|
<p class="startli">When <code>build_type</code> is <code>Release</code>, <code>compiler.runtime</code> should be <code>MT</code>.</p>
|
|
<p class="startli">When <code>build_type</code> is <code>Debug</code>, <code>compiler.runtime</code> should be <code>MTd</code>.</p>
|
|
<div class="fragment"><div class="line">conan install .. --output-folder . --build missing --settings build_type=Release --settings compiler.runtime=MT</div>
|
|
<div class="line">conan install .. --output-folder . --build missing --settings build_type=Debug --settings compiler.runtime=MTd</div>
|
|
</div><!-- fragment --></li>
|
|
<li><p class="startli">Configure CMake and pass the toolchain file generated by Conan, located at <code>$OUTPUT_FOLDER/build/generators/conan_toolchain.cmake</code>.</p>
|
|
<p class="startli">Single-config generators:</p>
|
|
<div class="fragment"><div class="line">cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -Dxrpld=ON -Dtests=ON ..</div>
|
|
</div><!-- fragment --><p class="startli">Pass the CMake variable <a href="https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html"><code>CMAKE_BUILD_TYPE</code></a> and make sure it matches the <code>build_type</code> setting you chose in the previous step.</p>
|
|
<p class="startli">Multi-config generators:</p>
|
|
<div class="fragment"><div class="line">cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -Dxrpld=ON -Dtests=ON ..</div>
|
|
</div><!-- fragment --><p class="startli"><b>Note:</b> You can pass build options for <code>rippled</code> in this step.</p>
|
|
</li>
|
|
<li><p class="startli">Build <code>rippled</code>.</p>
|
|
<p class="startli">For a single-configuration generator, it will build whatever configuration you passed for <code>CMAKE_BUILD_TYPE</code>. For a multi-configuration generator, you must pass the option <code>--config</code> to select the build configuration.</p>
|
|
<p class="startli">Single-config generators:</p>
|
|
<div class="fragment"><div class="line">cmake --build .</div>
|
|
</div><!-- fragment --><p class="startli">Multi-config generators:</p>
|
|
<div class="fragment"><div class="line">cmake --build . --config Release</div>
|
|
<div class="line">cmake --build . --config Debug</div>
|
|
</div><!-- fragment --></li>
|
|
<li><p class="startli">Test rippled.</p>
|
|
<p class="startli">Single-config generators:</p>
|
|
<div class="fragment"><div class="line">./rippled --unittest</div>
|
|
</div><!-- fragment --><p class="startli">Multi-config generators:</p>
|
|
<div class="fragment"><div class="line">./Release/rippled --unittest</div>
|
|
<div class="line">./Debug/rippled --unittest</div>
|
|
</div><!-- fragment --><p class="startli">The location of <code>rippled</code> in your build directory depends on your CMake generator. Pass <code>--help</code> to see the rest of the command line options.</p>
|
|
</li>
|
|
</ol>
|
|
<h2><a class="anchor" id="autotoc_md34"></a>
|
|
Coverage report</h2>
|
|
<p >The coverage report is intended for developers using compilers GCC or Clang (including Apple Clang). It is generated by the build target <code>coverage</code>, which is only enabled when the <code>coverage</code> option is set, e.g. with <code>--options coverage=True</code> in <code>conan</code> or <code>-Dcoverage=ON</code> variable in <code>cmake</code></p>
|
|
<p >Prerequisites for the coverage report:</p>
|
|
<ul>
|
|
<li><a href="https://gcovr.com/en/stable/getting-started.html">gcovr tool</a> (can be installed e.g. with <a href="https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/">pip</a>)</li>
|
|
<li><code>gcov</code> for GCC (installed with the compiler by default) or</li>
|
|
<li><code>llvm-cov</code> for Clang (installed with the compiler by default)</li>
|
|
<li><code>Debug</code> build type</li>
|
|
</ul>
|
|
<p >A coverage report is created when the following steps are completed, in order:</p>
|
|
<ol type="1">
|
|
<li><code>rippled</code> binary built with instrumentation data, enabled by the <code>coverage</code> option mentioned above</li>
|
|
<li>completed run of unit tests, which populates coverage capture data</li>
|
|
<li>completed run of the <code>gcovr</code> tool (which internally invokes either <code>gcov</code> or <code>llvm-cov</code>) to assemble both instrumentation data and the coverage capture data into a coverage report</li>
|
|
</ol>
|
|
<p >The above steps are automated into a single target <code>coverage</code>. The instrumented <code>rippled</code> binary can also be used for regular development or testing work, at the cost of extra disk space utilization and a small performance hit (to store coverage capture). In case of a spurious failure of unit tests, it is possible to re-run the <code>coverage</code> target without rebuilding the <code>rippled</code> binary (since it is simply a dependency of the coverage report target). It is also possible to select only specific tests for the purpose of the coverage report, by setting the <code>coverage_test</code> variable in <code>cmake</code></p>
|
|
<p >The default coverage report format is <code>html-details</code>, but the user can override it to any of the formats listed in <code>Builds/CMake/CodeCoverage.cmake</code> by setting the <code>coverage_format</code> variable in <code>cmake</code>. It is also possible to generate more than one format at a time by setting the <code>coverage_extra_args</code> variable in <code>cmake</code>. The specific command line used to run the <code>gcovr</code> tool will be displayed if the <code>CODE_COVERAGE_VERBOSE</code> variable is set.</p>
|
|
<p >By default, the code coverage tool runs parallel unit tests with <code>--unittest-jobs</code> set to the number of available CPU cores. This may cause spurious test errors on Apple. Developers can override the number of unit test jobs with the <code>coverage_test_parallelism</code> variable in <code>cmake</code>.</p>
|
|
<p >Example use with some cmake variables set:</p>
|
|
<div class="fragment"><div class="line">cd .build</div>
|
|
<div class="line">conan install .. --output-folder . --build missing --settings build_type=Debug</div>
|
|
<div class="line">cmake -DCMAKE_BUILD_TYPE=Debug -Dcoverage=ON -Dxrpld=ON -Dtests=ON -Dcoverage_test_parallelism=2 -Dcoverage_format=html-details -Dcoverage_extra_args="--json coverage.json" -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake ..</div>
|
|
<div class="line">cmake --build . --target coverage</div>
|
|
</div><!-- fragment --><p >After the <code>coverage</code> target is completed, the generated coverage report will be stored inside the build directory, as either of:</p>
|
|
<ul>
|
|
<li>file named <code>coverage.</code>_extension_ , with a suitable extension for the report format, or</li>
|
|
<li>directory named <code>coverage</code>, with the <code>index.html</code> and other files inside, for the <code>html-details</code> or <code>html-nested</code> report formats.</li>
|
|
</ul>
|
|
<h2><a class="anchor" id="autotoc_md35"></a>
|
|
Options</h2>
|
|
<table class="markdownTable">
|
|
<tr class="markdownTableHead">
|
|
<th class="markdownTableHeadNone">Option </th><th class="markdownTableHeadNone">Default Value </th><th class="markdownTableHeadNone">Description </th></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone"><code>assert</code> </td><td class="markdownTableBodyNone">OFF </td><td class="markdownTableBodyNone">Enable assertions. </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone"><code>coverage</code> </td><td class="markdownTableBodyNone">OFF </td><td class="markdownTableBodyNone">Prepare the coverage report. </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone"><code>san</code> </td><td class="markdownTableBodyNone">N/A </td><td class="markdownTableBodyNone">Enable a sanitizer with Clang. Choices are <code>thread</code> and <code>address</code>. </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone"><code>tests</code> </td><td class="markdownTableBodyNone">OFF </td><td class="markdownTableBodyNone">Build tests. </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone"><code>unity</code> </td><td class="markdownTableBodyNone">ON </td><td class="markdownTableBodyNone">Configure a unity build. </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone"><code>xrpld</code> </td><td class="markdownTableBodyNone">OFF </td><td class="markdownTableBodyNone">Build the xrpld (<code>rippled</code>) application, and not just the libxrpl library. </td></tr>
|
|
</table>
|
|
<p ><a href="https://en.wikipedia.org/wiki/Unity_build">Unity builds</a> may be faster for the first build (at the cost of much more memory) since they concatenate sources into fewer translation units. Non-unity builds may be faster for incremental builds, and can be helpful for detecting <code>#include</code> omissions.</p>
|
|
<h2><a class="anchor" id="autotoc_md36"></a>
|
|
Troubleshooting</h2>
|
|
<h3><a class="anchor" id="autotoc_md37"></a>
|
|
Conan</h3>
|
|
<p >After any updates or changes to dependencies, you may need to do the following:</p>
|
|
<ol type="1">
|
|
<li>Remove your build directory.</li>
|
|
<li>Remove the Conan cache: <div class="fragment"><div class="line">rm -rf ~/.conan/data</div>
|
|
</div><!-- fragment --></li>
|
|
<li>Re-run conan install.</li>
|
|
</ol>
|
|
<h3><a class="anchor" id="autotoc_md38"></a>
|
|
no std::result_of</h3>
|
|
<p >If your compiler version is recent enough to have removed <code><a class="elRef" href="http://en.cppreference.com/w/cpp/types/result_of.html">std::result_of</a></code> as part of C++20, e.g. Apple Clang 15.0, then you might need to add a preprocessor definition to your build.</p>
|
|
<div class="fragment"><div class="line">conan profile update 'options.boost:extra_b2_flags="define=BOOST_ASIO_HAS_STD_INVOKE_RESULT"' default</div>
|
|
<div class="line">conan profile update 'env.CFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"' default</div>
|
|
<div class="line">conan profile update 'env.CXXFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"' default</div>
|
|
<div class="line">conan profile update 'conf.tools.build:cflags+=["-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"]' default</div>
|
|
<div class="line">conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"]' default</div>
|
|
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md39"></a>
|
|
call to 'async_teardown' is ambiguous</h3>
|
|
<p >If you are compiling with an early version of Clang 16, then you might hit a <a href="https://github.com/boostorg/beast/issues/2648">regression</a> when compiling C++20 that manifests as an <a href="https://github.com/boostorg/beast/issues/2661">error in a Boost header</a>. You can workaround it by adding this preprocessor definition:</p>
|
|
<div class="fragment"><div class="line">conan profile update 'env.CXXFLAGS="-DBOOST_ASIO_DISABLE_CONCEPTS"' default</div>
|
|
<div class="line">conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_ASIO_DISABLE_CONCEPTS"]' default</div>
|
|
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md40"></a>
|
|
recompile with -fPIC</h3>
|
|
<p >If you get a linker error suggesting that you recompile Boost with position-independent code, such as:</p>
|
|
<div class="fragment"><div class="line">/usr/bin/ld.gold: error: /home/username/.conan/data/boost/1.77.0/_/_/package/.../lib/libboost_container.a(alloc_lib.o):</div>
|
|
<div class="line"> requires unsupported dynamic reloc 11; recompile with -fPIC</div>
|
|
</div><!-- fragment --><p >Conan most likely downloaded a bad binary distribution of the dependency. This seems to be a <a href="https://github.com/conan-io/conan-center-index/issues/13168">bug</a> in Conan just for Boost 1.77.0 compiled with GCC for Linux. The solution is to build the dependency locally by passing <code>--build boost</code> when calling <code>conan install</code>.</p>
|
|
<div class="fragment"><div class="line">conan install --build boost ...</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md41"></a>
|
|
Add a Dependency</h2>
|
|
<p >If you want to experiment with a new package, follow these steps:</p>
|
|
<ol type="1">
|
|
<li>Search for the package on <a href="https://conan.io/center/">Conan Center</a>.</li>
|
|
<li>Modify <a href="./conanfile.py"><code>conanfile.py</code></a>:<ul>
|
|
<li>Add a version of the package to the <code>requires</code> property.</li>
|
|
<li>Change any default options for the package by adding them to the <code>default_options</code> property (with syntax ‘’$package:$option': $value<code>).</code></li>
|
|
</ul>
|
|
</li>
|
|
<li><code>Modify [</code>CMakeLists.txt<code>](./CMakeLists.txt):<ul>
|
|
<li>Add a call tofind_package($package REQUIRED)<code>.</code></li>
|
|
<li><code>Link a library from the package to the target</code>ripple_libs<code> (search for the existing call to</code>target_link_libraries(ripple_libs INTERFACE ...)`).</li>
|
|
</ul>
|
|
</code></li>
|
|
<li><code>Start coding! Don't forget to include whatever headers you need from the package. </code></li>
|
|
</ol>
|
|
</div></div><!-- contents -->
|
|
</div><!-- PageDoc -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
|
|
</small></address>
|
|
</body>
|
|
</html>
|