Support boost 1.68

This commit is contained in:
seelabs
2018-08-09 09:16:02 -04:00
committed by Nik Bougalis
parent c946043280
commit b2f2d89a08
12 changed files with 60 additions and 42 deletions

View File

@@ -458,6 +458,14 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
elseif (GHSMULTI) elseif (GHSMULTI)
set(_boost_COMPILER "-ghs") set(_boost_COMPILER "-ghs")
elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
#[========================================================[
NOTE: newer versions of FindBoost from kitware
change this version check to use MSVC_TOOLSET_VERSION.
That variable only exists in make 3.12 or greater, so
until all envs (including bundled visual studio) have
this min version of cmake, stick with this
CMAKE_CXX_COMPILER_VERSION check
#]========================================================]
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
set(_boost_COMPILER "-vc141;-vc140") set(_boost_COMPILER "-vc141;-vc140")
elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19) elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
@@ -816,10 +824,28 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_TIMER_DEPENDENCIES chrono system) set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 106700 AND Boost_VERSION VERSION_LESS 106800)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
set(_Boost_RANDOM_DEPENDENCIES system)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
else() else()
if(NOT Boost_VERSION VERSION_LESS 106700) if(NOT Boost_VERSION VERSION_LESS 106800)
set(_Boost_CHRONO_DEPENDENCIES system) set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time) set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
set(_Boost_CONTRACT_DEPENDENCIES thread chrono system date_time)
set(_Boost_COROUTINE_DEPENDENCIES context system) set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time) set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
set(_Boost_FILESYSTEM_DEPENDENCIES system) set(_Boost_FILESYSTEM_DEPENDENCIES system)
@@ -835,7 +861,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
endif() endif()
if(NOT Boost_VERSION VERSION_LESS 106800) if(NOT Boost_VERSION VERSION_LESS 106900)
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets") message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
endif() endif()
endif() endif()
@@ -872,7 +898,8 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
set(_Boost_ATOMIC_HEADERS "boost/atomic.hpp") set(_Boost_ATOMIC_HEADERS "boost/atomic.hpp")
set(_Boost_CHRONO_HEADERS "boost/chrono.hpp") set(_Boost_CHRONO_HEADERS "boost/chrono.hpp")
set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp") set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp") set(_Boost_CONTRACT_HEADERS "boost/contract.hpp")
set(_Boost_CONTEXT_HEADERS "boost/context/detail/fcontext.hpp")
set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp") set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp") set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp") set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
@@ -1081,7 +1108,7 @@ else()
# _Boost_COMPONENT_HEADERS. See the instructions at the top of # _Boost_COMPONENT_HEADERS. See the instructions at the top of
# _Boost_COMPONENT_DEPENDENCIES. # _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65" "1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
"1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60" "1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55" "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
"1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
@@ -1480,14 +1507,14 @@ if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSI
string(APPEND _boost_ARCHITECTURE_TAG "-") string(APPEND _boost_ARCHITECTURE_TAG "-")
# This needs to be kept in-sync with the section of CMakePlatformId.h.in # This needs to be kept in-sync with the section of CMakePlatformId.h.in
# inside 'defined(_WIN32) && defined(_MSC_VER)' # inside 'defined(_WIN32) && defined(_MSC_VER)'
if(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "IA64") if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64")
string(APPEND _boost_ARCHITECTURE_TAG "i") string(APPEND _boost_ARCHITECTURE_TAG "i")
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "X86" elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86"
OR ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "x64") OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64")
string(APPEND _boost_ARCHITECTURE_TAG "x") string(APPEND _boost_ARCHITECTURE_TAG "x")
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} MATCHES "^ARM") elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM")
string(APPEND _boost_ARCHITECTURE_TAG "a") string(APPEND _boost_ARCHITECTURE_TAG "a")
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "MIPS") elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS")
string(APPEND _boost_ARCHITECTURE_TAG "m") string(APPEND _boost_ARCHITECTURE_TAG "m")
endif() endif()

View File

@@ -102,10 +102,10 @@ to get the correct 32-/64-bit variant.
Boost 1.67 or later is required. Boost 1.67 or later is required.
After [downloading boost](http://www.boost.org/users/download/) and unpacking it 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.67.0, to `c:\lib`. As of this writing, the most recent version of boost is 1.68.0,
which will unpack into a directory named `boost_1_67_0`. We recommended either which will unpack into a directory named `boost_1_68_0`. We recommended either
renaming this directory to `boost`, or creating a junction link `mklink /J boost renaming this directory to `boost`, or creating a junction link `mklink /J boost
boost_1_67_0`, so that you can more easily switch between versions. boost_1_68_0`, so that you can more easily switch between versions.
Next, open **Developer Command Prompt** and type the following commands Next, open **Developer Command Prompt** and type the following commands
@@ -237,7 +237,7 @@ execute the following commands within your `rippled` cloned repository:
``` ```
mkdir build\cmake mkdir build\cmake
cd build\cmake cd build\cmake
cmake ..\.. -G"Visual Studio 15 2017 Win64" -DBOOST_ROOT="C:\lib\boost_1_67_0" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64" cmake ..\.. -G"Visual Studio 15 2017 Win64" -DBOOST_ROOT="C:\lib\boost_1_68_0" -DOPENSSL_ROOT="C:\lib\OpenSSL-Win64"
``` ```
Now launch Visual Studio 2017 and select **File | Open | Project/Solution**. Now launch Visual Studio 2017 and select **File | Open | Project/Solution**.
Navigate to the `build\cmake` folder created above and select the `rippled.sln` Navigate to the `build\cmake` folder created above and select the `rippled.sln`

View File

@@ -30,9 +30,9 @@ with the following process: After changing to the directory where
you wish to download and compile boost, run you wish to download and compile boost, run
``` ```
$ wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz $ wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
$ tar -xzf boost_1_67_0.tar.gz $ tar -xzf boost_1_68_0.tar.gz
$ cd boost_1_67_0 $ cd boost_1_68_0
$ ./bootstrap.sh $ ./bootstrap.sh
$ ./b2 headers $ ./b2 headers
$ ./b2 -j<Num Parallel> $ ./b2 -j<Num Parallel>
@@ -81,14 +81,14 @@ git checkout develop
If you didn't persistently set the `BOOST_ROOT` environment variable to the 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. directory in which you compiled boost, then you should set it temporarily.
For example, you built Boost in your home directory `~/boost_1_67_0`, you For example, you built Boost in your home directory `~/boost_1_68_0`, you
would do for any shell in which you want to build: would do for any shell in which you want to build:
``` ```
export BOOST_ROOT=~/boost_1_67_0 export BOOST_ROOT=~/boost_1_68_0
``` ```
Alternatively, you can add `DBOOST_ROOT=~/boost_1_67_0` to the command line when Alternatively, you can add `DBOOST_ROOT=~/boost_1_68_0` to the command line when
invoking `cmake`. invoking `cmake`.
### Generate and Build ### Generate and Build

View File

@@ -64,7 +64,7 @@ Boost 1.67 or later is required.
We want to compile boost with clang/libc++ We want to compile boost with clang/libc++
Download [a release](https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.bz2) Download [a release](https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.bz2)
Extract it to a folder, making note of where, open a terminal, then: Extract it to a folder, making note of where, open a terminal, then:
@@ -120,11 +120,11 @@ If you didn't persistently set the `BOOST_ROOT` environment variable to the
root of the extracted directory above, then you should set it temporarily. root of the extracted directory above, then you should set it temporarily.
For example, assuming your username were `Abigail` and you extracted Boost For example, assuming your username were `Abigail` and you extracted Boost
1.67.0 in `/Users/Abigail/Downloads/boost_1_67_0`, you would do for any 1.68.0 in `/Users/Abigail/Downloads/boost_1_68_0`, you would do for any
shell in which you want to build: shell in which you want to build:
``` ```
export BOOST_ROOT=/Users/Abigail/Downloads/boost_1_67_0 export BOOST_ROOT=/Users/Abigail/Downloads/boost_1_68_0
``` ```
### Generate and Build ### Generate and Build

View File

@@ -48,21 +48,12 @@ struct is_boost_reverse_iterator
explicit is_boost_reverse_iterator() = default; explicit is_boost_reverse_iterator() = default;
}; };
#if BOOST_VERSION >= 105800
template <class It> template <class It>
struct is_boost_reverse_iterator<boost::intrusive::reverse_iterator<It>> struct is_boost_reverse_iterator<boost::intrusive::reverse_iterator<It>>
: std::true_type : std::true_type
{ {
explicit is_boost_reverse_iterator() = default; explicit is_boost_reverse_iterator() = default;
}; };
#else
template <class It>
struct is_boost_reverse_iterator<boost::intrusive::detail::reverse_iterator<It>>
: std::true_type
{
explicit is_boost_reverse_iterator() = default;
};
#endif
/** Associative container where each element is also indexed by time. /** Associative container where each element is also indexed by time.

View File

@@ -354,7 +354,6 @@ public:
// Break up the array of strings into blocks // Break up the array of strings into blocks
// that each fit into one UDP packet. // that each fit into one UDP packet.
// //
boost::system::error_code ec;
std::vector <boost::asio::const_buffer> buffers; std::vector <boost::asio::const_buffer> buffers;
buffers.reserve (m_data.size ()); buffers.reserve (m_data.size ());
std::size_t size (0); std::size_t size (0);

View File

@@ -73,7 +73,6 @@ ConnectAttempt::stop()
void void
ConnectAttempt::run() ConnectAttempt::run()
{ {
error_code ec;
stream_.next_layer().async_connect (remote_endpoint_, stream_.next_layer().async_connect (remote_endpoint_,
strand_.wrap (std::bind (&ConnectAttempt::onConnect, strand_.wrap (std::bind (&ConnectAttempt::onConnect,
shared_from_this(), std::placeholders::_1))); shared_from_this(), std::placeholders::_1)));

View File

@@ -88,7 +88,6 @@ OverlayImpl::Timer::stop()
void void
OverlayImpl::Timer::run() OverlayImpl::Timer::run()
{ {
error_code ec;
timer_.expires_from_now (std::chrono::seconds(1)); timer_.expires_from_now (std::chrono::seconds(1));
timer_.async_wait(overlay_.strand_.wrap( timer_.async_wait(overlay_.strand_.wrap(
std::bind(&Timer::on_timer, shared_from_this(), std::bind(&Timer::on_timer, shared_from_this(),

View File

@@ -1628,7 +1628,6 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMHaveTransactionSet> const& m)
void void
PeerImp::onMessage (std::shared_ptr <protocol::TMValidation> const& m) PeerImp::onMessage (std::shared_ptr <protocol::TMValidation> const& m)
{ {
error_code ec;
auto const closeTime = app_.timeKeeper().closeTime(); auto const closeTime = app_.timeKeeper().closeTime();
if (m->has_hops() && ! slot_->cluster()) if (m->has_hops() && ! slot_->cluster())

View File

@@ -85,11 +85,12 @@ struct json_body
using const_buffers_type = using const_buffers_type =
boost::asio::const_buffer; boost::asio::const_buffer;
template<bool isRequest, class Fields> template <bool isRequest, class Fields>
explicit explicit
writer(boost::beast::http::message<isRequest, writer(
json_body, Fields> const& msg) boost::beast::http::header<isRequest, Fields> const& fields,
: body_string_(to_string(msg.body())) value_type const& value)
: body_string_(to_string(value))
{ {
} }

View File

@@ -113,7 +113,6 @@ class WSClientImpl : public WSClient
cleanup() cleanup()
{ {
ios_.post(strand_.wrap([this] { ios_.post(strand_.wrap([this] {
error_code ec;
if (!peerClosed_) if (!peerClosed_)
{ {
ws_.async_close({}, strand_.wrap([&](error_code ec) { ws_.async_close({}, strand_.wrap([&](error_code ec) {

View File

@@ -97,9 +97,13 @@ class ServerStatus_test :
req.insert("User-Agent", "test"); req.insert("User-Agent", "test");
req.method(boost::beast::http::verb::get); req.method(boost::beast::http::verb::get);
req.insert("Upgrade", "websocket"); req.insert("Upgrade", "websocket");
boost::beast::websocket::detail::maskgen maskgen;
boost::beast::websocket::detail::sec_ws_key_type key; boost::beast::websocket::detail::sec_ws_key_type key;
#if BOOST_VERSION >= 106800
boost::beast::websocket::detail::make_sec_ws_key(key);
#else
boost::beast::websocket::detail::maskgen maskgen;
boost::beast::websocket::detail::make_sec_ws_key(key, maskgen); boost::beast::websocket::detail::make_sec_ws_key(key, maskgen);
#endif
req.insert("Sec-WebSocket-Key", key); req.insert("Sec-WebSocket-Key", key);
req.insert("Sec-WebSocket-Version", "13"); req.insert("Sec-WebSocket-Version", "13");
req.insert(boost::beast::http::field::connection, "upgrade"); req.insert(boost::beast::http::field::connection, "upgrade");