From 04ef8851081f6ee9176783ad3725960b8a931ebb Mon Sep 17 00:00:00 2001 From: seelabs Date: Sat, 17 Sep 2022 22:25:05 -0400 Subject: [PATCH] Support for boost 1.80.0: Boost intrusive renamed the `comp()` function -> `get_comp()` --- .../CMakeSettings-example.json | 4 +- .../README.md | 46 +++++++++---------- .../container/detail/aged_ordered_container.h | 19 +++++++- 3 files changed, 42 insertions(+), 27 deletions(-) rename Builds/{VisualStudio2017 => VisualStudio2019}/CMakeSettings-example.json (91%) rename Builds/{VisualStudio2017 => VisualStudio2019}/README.md (86%) diff --git a/Builds/VisualStudio2017/CMakeSettings-example.json b/Builds/VisualStudio2019/CMakeSettings-example.json similarity index 91% rename from Builds/VisualStudio2017/CMakeSettings-example.json rename to Builds/VisualStudio2019/CMakeSettings-example.json index b2889ddf50..b90bfce6bb 100644 --- a/Builds/VisualStudio2017/CMakeSettings-example.json +++ b/Builds/VisualStudio2019/CMakeSettings-example.json @@ -3,7 +3,7 @@ "configurations": [ { "name": "x64-Debug", - "generator": "Visual Studio 15 2017 Win64", + "generator": "Visual Studio 16 2019", "configurationType": "Debug", "inheritEnvironments": [ "msvc_x64_x64" ], "buildRoot": "${thisFileDir}\\build\\${name}", @@ -23,7 +23,7 @@ }, { "name": "x64-Release", - "generator": "Visual Studio 15 2017 Win64", + "generator": "Visual Studio 16 2019", "configurationType": "Release", "inheritEnvironments": [ "msvc_x64_x64" ], "buildRoot": "${thisFileDir}\\build\\${name}", diff --git a/Builds/VisualStudio2017/README.md b/Builds/VisualStudio2019/README.md similarity index 86% rename from Builds/VisualStudio2017/README.md rename to Builds/VisualStudio2019/README.md index ec8fb1c088..e369eac677 100644 --- a/Builds/VisualStudio2017/README.md +++ b/Builds/VisualStudio2019/README.md @@ -1,4 +1,4 @@ -# Visual Studio 2017 Build Instructions +# Visual Studio 2019 Build Instructions ## Important @@ -14,26 +14,26 @@ need these software components | Component | Minimum Recommended Version | |-----------|-----------------------| -| [Visual Studio 2017](README.md#install-visual-studio-2017)| 15.5.4 | +| [Visual Studio 2019](README.md#install-visual-studio-2019)| 15.5.4 | | [Git for Windows](README.md#install-git-for-windows)| 2.16.1 | | [OpenSSL Library](README.md#install-openssl) | 1.1.1L | | [Boost library](README.md#build-boost) | 1.70.0 | | [CMake for Windows](README.md#optional-install-cmake-for-windows)* | 3.12 | -\* Only needed if not using the integrated CMake in VS 2017 and prefer generating dedicated project/solution files. +\* Only needed if not using the integrated CMake in VS 2019 and prefer generating dedicated project/solution files. ## Install Software -### Install Visual Studio 2017 +### Install Visual Studio 2019 If not already installed on your system, download your choice of installer from -the [Visual Studio 2017 +the [Visual Studio 2019 Download](https://www.visualstudio.com/downloads/download-visual-studio-vs) page, run the installer, and follow the directions. **You may need to choose the `Desktop development with C++` workload to install all necessary C++ features.** -Any version of Visual Studio 2017 may be used to build rippled. The **Visual -Studio 2017 Community** edition is available free of charge (see [the product +Any version of Visual Studio 2019 may be used to build rippled. The **Visual +Studio 2019 Community** edition is available free of charge (see [the product page](https://www.visualstudio.com/products/visual-studio-community-vs) for licensing details), while paid editions may be used for an initial free-trial period. @@ -55,7 +55,7 @@ OpenSSL.](http://slproweb.com/products/Win32OpenSSL.html) There will several `Win64` bit variants available, you want the non-light `v1.1` line. As of this writing, you **should** select -* Win64 OpenSSL v1.1.1L +* Win64 OpenSSL v1.1.1q and should **not** select @@ -82,11 +82,11 @@ to get the correct 32-/64-bit variant. Boost 1.70 or later is required. -After [downloading boost](http://www.boost.org/users/download/) and unpacking it -to `c:\lib`. As of this writing, the most recent version of boost is 1.70.0, -which will unpack into a directory named `boost_1_70_0`. We recommended either +[Download boost](http://www.boost.org/users/download/) and unpack it +to `c:\lib`. As of this writing, the most recent version of boost is 1.80.0, +which will unpack into a directory named `boost_1_80_0`. We recommended either renaming this directory to `boost`, or creating a junction link `mklink /J boost -boost_1_70_0`, so that you can more easily switch between versions. +boost_1_80_0`, so that you can more easily switch between versions. Next, open **Developer Command Prompt** and type the following commands @@ -101,11 +101,11 @@ is not affected by changes in outside files. Therefore, it is necessary to build the required boost static libraries using this command: ```powershell -bjam -j --toolset=msvc-14.1 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared,static stage +b2 -j --toolset=msvc-14.2 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared,static stage ``` where you should replace `` with the number of parallel -invocations to use build, e.g. `bjam -j4 ...` would use up to 4 concurrent build +invocations to use build, e.g. `bjam -j8 ...` would use up to 8 concurrent build shell commands for the build. Building the boost libraries may take considerable time. When the build process @@ -115,7 +115,7 @@ library paths as they will be required later. ### (Optional) Install CMake for Windows [CMake](http://cmake.org) is a cross platform build system generator. Visual -Studio 2017 includes an integrated version of CMake that avoids having to +Studio 2019 includes an integrated version of CMake that avoids having to manually run CMake, but it is undergoing continuous improvement. Users that prefer to use standard Visual Studio project and solution files need to install a dedicated version of CMake to generate them. The latest version can be found @@ -141,7 +141,7 @@ repository and optionally switch to the *master* branch. Type the following at the bash prompt: ```powershell -git clone git@github.com:ripple/rippled.git +git clone git@github.com:XRPLF/rippled.git cd rippled ``` If you receive an error about not having the "correct access rights" make sure @@ -160,7 +160,7 @@ To test the latest release candidate, choose the `release` branch. git checkout release ``` -If you are doing development work and want the latest set of untested features, +If you are doing development work and want the latest set of beta features, you can consider using the `develop` branch instead. ``` @@ -177,14 +177,14 @@ To begin, simply: cloned rippled folder. 2. Right-click on `CMakeLists.txt` in the **Solution Explorer - Folder View** to generate a `CMakeSettings.json` file. A sample settings file is provided - [here](/Builds/VisualStudio2017/CMakeSettings-example.json). Customize the + [here](/Builds/VisualStudio2019/CMakeSettings-example.json). Customize the settings for `BOOST_ROOT`, `OPENSSL_ROOT` to match the install paths if they differ from those in the file. 4. Select either the `x64-Release` or `x64-Debug` configuration from the - **Project Setings** drop-down. This should invoke the built-in CMake project + **Project Settings** drop-down. This should invoke the built-in CMake project generator. If not, you can right-click on the `CMakeLists.txt` file and - choose **Cache | Generate Cache**. -5. Select either the `rippled.exe` (unity) or `rippled_classic.exe` (non-unity) + choose **Configure rippled**. +5. Select the `rippled.exe` option in the **Select Startup Item** drop-down. This will be the target built when you press F7. Alternatively, you can choose a target to build from the top-level **CMake | Build** menu. Note that at this time, there are other @@ -216,9 +216,9 @@ execute the following commands within your `rippled` cloned repository: ``` mkdir build\cmake cd build\cmake -cmake ..\.. -G"Visual Studio 15 2017 Win64" -DBOOST_ROOT="C:\lib\boost_1_70_0" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64" -DCMAKE_GENERATOR_TOOLSET=host=x64 +cmake ..\.. -G"Visual Studio 16 2019" -Ax64 -DBOOST_ROOT="C:\lib\boost" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64" -DCMAKE_GENERATOR_TOOLSET=host=x64 ``` -Now launch Visual Studio 2017 and select **File | Open | Project/Solution**. +Now launch Visual Studio 2019 and select **File | Open | Project/Solution**. Navigate to the `build\cmake` folder created above and select the `rippled.sln` file. You can then choose whether to build the `Debug` or `Release` solution configuration. diff --git a/src/ripple/beast/container/detail/aged_ordered_container.h b/src/ripple/beast/container/detail/aged_ordered_container.h index 9da5f20a0a..23534a26bb 100644 --- a/src/ripple/beast/container/detail/aged_ordered_container.h +++ b/src/ripple/beast/container/detail/aged_ordered_container.h @@ -1432,7 +1432,12 @@ template < class Allocator> aged_ordered_container:: aged_ordered_container(aged_ordered_container const& other) - : m_config(other.m_config), m_cont(other.m_cont.comp()) + : m_config(other.m_config) +#if BOOST_VERSION >= 108000 + , m_cont(other.m_cont.get_comp()) +#else + , m_cont(other.m_cont.comp()) +#endif { insert(other.cbegin(), other.cend()); } @@ -1449,7 +1454,12 @@ aged_ordered_container:: aged_ordered_container( aged_ordered_container const& other, Allocator const& alloc) - : m_config(other.m_config, alloc), m_cont(other.m_cont.comp()) + : m_config(other.m_config, alloc) +#if BOOST_VERSION >= 108000 + , m_cont(other.m_cont.get_comp()) +#else + , m_cont(other.m_cont.comp()) +#endif { insert(other.cbegin(), other.cend()); } @@ -1482,7 +1492,12 @@ aged_ordered_container:: aged_ordered_container&& other, Allocator const& alloc) : m_config(std::move(other.m_config), alloc) +#if BOOST_VERSION >= 108000 + , m_cont(std::move(other.m_cont.get_comp())) +#else , m_cont(std::move(other.m_cont.comp())) +#endif + { insert(other.cbegin(), other.cend()); other.clear();