build: require boost >= 1.71.0

Refs: #5276
Change-Id: Ib62b24b041e21b2c017cd9c290f7d5dc09003d63
This commit is contained in:
Davide Pesavento committed 2023-09-15 22:08:22 -04:00
1 parent b6e10dd86a
commit 2ab04a2b9f
9 files changed
+32 -30

No files matched your search

+1 -1
View File
@@ -119,5 +119,5 @@ main(int argc, char* argv[])
### Command Line Arguments ### Command Line Arguments
[Boost.Program\_options](https://www.boost.org/doc/libs/1_65_1/doc/html/program_options.html) [Boost.Program\_options](https://www.boost.org/doc/libs/1_71_0/doc/html/program_options.html)
is strongly preferred over `getopt(3)` for parsing command line arguments. is strongly preferred over `getopt(3)` for parsing command line arguments.
+7 -3
View File
@@ -8,15 +8,19 @@ except the object that contains the `main()` function.
For example: For example:
bld(features='cxx', ```python
name='tool-subtool-objects', def build(bld):
bld.objects(
target='tool-subtool-objects',
source=bld.path.ant_glob('subtool/*.cpp', excl='subtool/main.cpp'), source=bld.path.ant_glob('subtool/*.cpp', excl='subtool/main.cpp'),
use='core-objects') use='core-objects')
bld(features='cxx cxxprogram', bld.program(
name='subtool',
target='../../bin/subtool', target='../../bin/subtool',
source='subtool/main.cpp', source='subtool/main.cpp',
use='tool-subtool-objects') use='tool-subtool-objects')
bld(name='tool-objects', bld(name='tool-objects',
use='tool-subtool-objects') use='tool-subtool-objects')
```
+3 -7
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/* /*
* Copyright (c) 2014-2022, Regents of the University of California, * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents, * Arizona Board of Regents,
* Colorado State University, * Colorado State University,
* University Pierre & Marie Curie, Sorbonne University, * University Pierre & Marie Curie, Sorbonne University,
@@ -28,7 +28,7 @@
#include "tests/clock-fixture.hpp" #include "tests/clock-fixture.hpp"
#include <boost/asio/io_service.hpp> #include <boost/asio/io_context.hpp>
namespace ndn::tests { namespace ndn::tests {
@@ -39,17 +39,13 @@ private:
afterTick() final afterTick() final
{ {
if (m_io.stopped()) { if (m_io.stopped()) {
#if BOOST_VERSION >= 106600
m_io.restart(); m_io.restart();
#else
m_io.reset();
#endif
} }
m_io.poll(); m_io.poll();
} }
protected: protected:
boost::asio::io_service m_io; boost::asio::io_context m_io;
}; };
} // namespace ndn::tests } // namespace ndn::tests
+1 -2
View File
@@ -24,7 +24,6 @@
#include <ndn-cxx/util/dummy-client-face.hpp> #include <ndn-cxx/util/dummy-client-face.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/test/tools/output_test_stream.hpp> #include <boost/test/tools/output_test_stream.hpp>
namespace ndn::peek::tests { namespace ndn::peek::tests {
@@ -129,7 +128,7 @@ public:
BOOST_AUTO_TEST_SUITE(Peek) BOOST_AUTO_TEST_SUITE(Peek)
BOOST_FIXTURE_TEST_SUITE(TestNdnPeek, NdnPeekFixture) BOOST_FIXTURE_TEST_SUITE(TestNdnPeek, NdnPeekFixture)
using OutputChecks = boost::mpl::vector<OutputFull, OutputPayloadOnly>; using OutputChecks = std::tuple<OutputFull, OutputPayloadOnly>;
BOOST_AUTO_TEST_CASE_TEMPLATE(Default, OutputCheck, OutputChecks) BOOST_AUTO_TEST_CASE_TEMPLATE(Default, OutputCheck, OutputChecks)
{ {
+2 -1
View File
@@ -25,6 +25,7 @@
#include "tests/key-chain-fixture.hpp" #include "tests/key-chain-fixture.hpp"
#include <ndn-cxx/util/dummy-client-face.hpp> #include <ndn-cxx/util/dummy-client-face.hpp>
#include <boost/asio/post.hpp>
namespace ndn::ping::tests { namespace ndn::ping::tests {
@@ -53,7 +54,7 @@ protected:
void void
receive(DummyClientFace& face, const Packet& pkt) receive(DummyClientFace& face, const Packet& pkt)
{ {
m_io.post([=, &face] { boost::asio::post(m_io, [=, &face] {
if (!wantLoss) { if (!wantLoss) {
face.receive(pkt); face.receive(pkt);
} }
+1 -1
View File
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE(Test1)
int i = 0; int i = 0;
// For reference of available Boost.Test macros, see // For reference of available Boost.Test macros, see
// https://www.boost.org/doc/libs/1_65_1/libs/test/doc/html/boost_test/testing_tools/summary.html // https://www.boost.org/doc/libs/1_71_0/libs/test/doc/html/boost_test/testing_tools/summary.html
BOOST_REQUIRE_NO_THROW(i = 1); BOOST_REQUIRE_NO_THROW(i = 1);
BOOST_CHECK_EQUAL(i, 1); BOOST_CHECK_EQUAL(i, 1);
+1 -1
View File
@@ -6,5 +6,5 @@ def build(bld):
target=f'{top}/unit-tests', target=f'{top}/unit-tests',
name='unit-tests', name='unit-tests',
source=bld.path.ant_glob(['*.cpp'] + [f'{tool}/**/*.cpp' for tool in bld.env.BUILD_TOOLS]), source=bld.path.ant_glob(['*.cpp'] + [f'{tool}/**/*.cpp' for tool in bld.env.BUILD_TOOLS]),
use=['core-objects'] + [f'{tool}-objects' for tool in bld.env.BUILD_TOOLS], use=['BOOST_TESTS', 'core-objects'] + [f'{tool}-objects' for tool in bld.env.BUILD_TOOLS],
install_path=None) install_path=None)
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/* /*
* Copyright (c) 2016-2022, Regents of the University of California, * Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University, * Colorado State University,
* University Pierre & Marie Curie, Sorbonne University. * University Pierre & Marie Curie, Sorbonne University.
* *
@@ -31,7 +31,8 @@
#include "pipeline-interests.hpp" #include "pipeline-interests.hpp"
#include "data-fetcher.hpp" #include "data-fetcher.hpp"
#include <boost/asio/io_service.hpp> #include <boost/asio/io_context.hpp>
#include <boost/asio/post.hpp>
namespace ndn::chunks { namespace ndn::chunks {
@@ -101,8 +102,9 @@ PipelineInterests::onFailure(const std::string& reason)
cancel(); cancel();
if (m_onFailure) if (m_onFailure) {
m_face.getIoService().post([this, reason] { m_onFailure(reason); }); boost::asio::post(m_face.getIoService(), [this, reason] { m_onFailure(reason); });
}
} }
void void
+10 -10
View File
@@ -37,17 +37,15 @@ def configure(conf):
conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.1', '--cflags', '--libs'], conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.1', '--cflags', '--libs'],
uselib_store='NDN_CXX', pkg_config_path=pkg_config_path) uselib_store='NDN_CXX', pkg_config_path=pkg_config_path)
boost_libs = ['system', 'program_options'] conf.check_boost(lib='program_options', mt=True)
if conf.env.WITH_TESTS: if conf.env.BOOST_VERSION_NUMBER < 107100:
boost_libs.append('unit_test_framework') conf.fatal('The minimum supported version of Boost is 1.71.0.\n'
conf.define('WITH_TESTS', 1)
conf.check_boost(lib=boost_libs, mt=True)
if conf.env.BOOST_VERSION_NUMBER < 106501:
conf.fatal('The minimum supported version of Boost is 1.65.1.\n'
'Please upgrade your distribution or manually install a newer version of Boost.\n' 'Please upgrade your distribution or manually install a newer version of Boost.\n'
'For more information, see https://redmine.named-data.net/projects/nfd/wiki/Boost') 'For more information, see https://redmine.named-data.net/projects/nfd/wiki/Boost')
if conf.env.WITH_TESTS:
conf.check_boost(lib='unit_test_framework', mt=True, uselib_store='BOOST_TESTS')
conf.recurse('tools') conf.recurse('tools')
conf.check_compiler_flags() conf.check_compiler_flags()
@@ -56,6 +54,8 @@ def configure(conf):
conf.load('coverage') conf.load('coverage')
conf.load('sanitizers') conf.load('sanitizers')
conf.define_cond('WITH_TESTS', conf.env.WITH_TESTS)
conf.msg('Tools to build', ', '.join(conf.env.BUILD_TOOLS)) conf.msg('Tools to build', ', '.join(conf.env.BUILD_TOOLS))
def build(bld): def build(bld):
@@ -69,8 +69,8 @@ def build(bld):
bld.objects( bld.objects(
target='core-objects', target='core-objects',
source=bld.path.find_node('core').ant_glob('*.cpp') + ['core/version.cpp'], source=bld.path.find_dir('core').ant_glob('*.cpp') + ['core/version.cpp'],
use='NDN_CXX BOOST', use='BOOST NDN_CXX',
includes='.', includes='.',
export_includes='.') export_includes='.')