From 20c3285fbc4d0e4f394d19c3d1eb0fb5f884b2c6 Mon Sep 17 00:00:00 2001 From: Gregory Popovitch Date: Wed, 6 Apr 2022 09:52:59 -0400 Subject: [PATCH] update boost version requirement to 1.75, and fix build issue when building on M1 mac --- Builds/CMake/deps/Boost.cmake | 2 +- Builds/VisualStudio2017/README.md | 12 ++++++------ Builds/linux/README.md | 14 +++++++------- src/ripple/shamap/impl/SHAMapInnerNode.cpp | 8 ++++++-- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Builds/CMake/deps/Boost.cmake b/Builds/CMake/deps/Boost.cmake index ba3086c5c8f..34be5a292c9 100644 --- a/Builds/CMake/deps/Boost.cmake +++ b/Builds/CMake/deps/Boost.cmake @@ -44,7 +44,7 @@ else() endif() # TBD: # Boost_USE_DEBUG_RUNTIME: When ON, uses Boost libraries linked against the -find_package(Boost 1.70 REQUIRED +find_package(Boost 1.75 REQUIRED COMPONENTS chrono container diff --git a/Builds/VisualStudio2017/README.md b/Builds/VisualStudio2017/README.md index ec8fb1c0881..3a001e453b7 100644 --- a/Builds/VisualStudio2017/README.md +++ b/Builds/VisualStudio2017/README.md @@ -17,7 +17,7 @@ need these software components | [Visual Studio 2017](README.md#install-visual-studio-2017)| 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 | +| [Boost library](README.md#build-boost) | 1.75.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. @@ -80,13 +80,13 @@ to get the correct 32-/64-bit variant. ### Build Boost -Boost 1.70 or later is required. +Boost 1.75 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 +to `c:\lib`. As of this writing, the recommended version of boost is 1.75.0, +which will unpack into a directory named `boost_1_75_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_75_0`, so that you can more easily switch between versions. Next, open **Developer Command Prompt** and type the following commands @@ -216,7 +216,7 @@ 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 15 2017 Win64" -DBOOST_ROOT="C:\lib\boost_1_75_0" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64" -DCMAKE_GENERATOR_TOOLSET=host=x64 ``` Now launch Visual Studio 2017 and select **File | Open | Project/Solution**. Navigate to the `build\cmake` folder created above and select the `rippled.sln` diff --git a/Builds/linux/README.md b/Builds/linux/README.md index bb5bc761827..1dfc111bad7 100644 --- a/Builds/linux/README.md +++ b/Builds/linux/README.md @@ -33,13 +33,13 @@ protobuf will give errors. ### Build Boost -Boost 1.70 or later is required. We recommend downloading and compiling boost +Boost 1.75 or later is required. We recommend downloading and compiling boost with the following process: After changing to the directory where you wish to download and compile boost, run ``` -$ wget https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.tar.gz -$ tar -xzf boost_1_70_0.tar.gz -$ cd boost_1_70_0 +$ wget https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz +$ tar -xzf boost_1_75_0.tar.gz +$ cd boost_1_75_0 $ ./bootstrap.sh $ ./b2 headers $ ./b2 -j @@ -88,14 +88,14 @@ git checkout develop If you didn't persistently set the `BOOST_ROOT` environment variable to the directory in which you compiled boost, then you should set it temporarily. -For example, you built Boost in your home directory `~/boost_1_70_0`, you +For example, you built Boost in your home directory `~/boost_1_75_0`, you would do for any shell in which you want to build: ``` -export BOOST_ROOT=~/boost_1_70_0 +export BOOST_ROOT=~/boost_1_75_0 ``` -Alternatively, you can add `DBOOST_ROOT=~/boost_1_70_0` to the command line when +Alternatively, you can add `DBOOST_ROOT=~/boost_1_75_0` to the command line when invoking `cmake`. ### Generate Configuration diff --git a/src/ripple/shamap/impl/SHAMapInnerNode.cpp b/src/ripple/shamap/impl/SHAMapInnerNode.cpp index c47ac3864ba..d6339ab109d 100644 --- a/src/ripple/shamap/impl/SHAMapInnerNode.cpp +++ b/src/ripple/shamap/impl/SHAMapInnerNode.cpp @@ -34,8 +34,10 @@ #include #include -// This is used for the _mm_pause instruction: -#include +#ifndef __aarch64__ + // This is used for the _mm_pause instruction: + #include +#endif namespace ripple { @@ -100,7 +102,9 @@ class SpinBitlock if (try_lock()) return; +#ifndef __aarch64__ _mm_pause(); +#endif } std::this_thread::yield();