build: require boost >= 1.71.0
Refs: #5276 Change-Id: I6eaae86beb89e00adf3891deb87816a1f176fdd6
This commit is contained in:
1 parent
2ecb059eb9
commit
5849ee7582
9 files changed
+54
-54
No files matched your search
@@ -128,7 +128,11 @@ class CompilerFlags:
|
|||||||
|
|
||||||
def getGeneralFlags(self, conf):
|
def getGeneralFlags(self, conf):
|
||||||
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
|
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
|
||||||
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
|
return {
|
||||||
|
'CXXFLAGS': [],
|
||||||
|
'LINKFLAGS': [],
|
||||||
|
'DEFINES': ['BOOST_ASIO_NO_DEPRECATED', 'BOOST_FILESYSTEM_NO_DEPRECATED'],
|
||||||
|
}
|
||||||
|
|
||||||
def getDebugFlags(self, conf):
|
def getDebugFlags(self, conf):
|
||||||
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
|
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
|
||||||
@@ -158,7 +162,6 @@ class GccClangCommonFlags(CompilerFlags):
|
|||||||
'-Wpedantic',
|
'-Wpedantic',
|
||||||
'-Wenum-conversion',
|
'-Wenum-conversion',
|
||||||
'-Wextra-semi',
|
'-Wextra-semi',
|
||||||
'-Wnon-virtual-dtor',
|
|
||||||
'-Wno-unused-parameter',
|
'-Wno-unused-parameter',
|
||||||
]
|
]
|
||||||
__linkFlags = ['-Wl,-O1']
|
__linkFlags = ['-Wl,-O1']
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ should be run as root:
|
|||||||
$ dnf list --installed gcc
|
$ dnf list --installed gcc
|
||||||
$ dnf list --installed gcc-c++
|
$ dnf list --installed gcc-c++
|
||||||
|
|
||||||
#. Python version 3.6 or later
|
#. Python version 3.8 or later
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ should be run as root:
|
|||||||
|
|
||||||
$ dnf list --installed pkgconf*
|
$ dnf list --installed pkgconf*
|
||||||
|
|
||||||
#. Boost libraries version 1.65.1 or later
|
#. Boost libraries version 1.71.0 or later
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <ndn-cxx/net/face-uri.hpp>
|
#include <ndn-cxx/net/face-uri.hpp>
|
||||||
#include <ndn-cxx/util/io.hpp>
|
#include <ndn-cxx/util/io.hpp>
|
||||||
|
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/property_tree/info_parser.hpp>
|
#include <boost/property_tree/info_parser.hpp>
|
||||||
|
|
||||||
@@ -127,8 +128,8 @@ private:
|
|||||||
private:
|
private:
|
||||||
const std::string m_key;
|
const std::string m_key;
|
||||||
const ConfParameterCallback m_setterCallback;
|
const ConfParameterCallback m_setterCallback;
|
||||||
T m_defaultValue;
|
|
||||||
|
|
||||||
|
T m_defaultValue;
|
||||||
T m_minValue;
|
T m_minValue;
|
||||||
T m_maxValue;
|
T m_maxValue;
|
||||||
|
|
||||||
@@ -493,7 +494,7 @@ ConfFileProcessor::processConfSectionNeighbors(const ConfigSection& section)
|
|||||||
m_io,
|
m_io,
|
||||||
TIME_ALLOWED_FOR_CANONIZATION);
|
TIME_ALLOWED_FOR_CANONIZATION);
|
||||||
m_io.run();
|
m_io.run();
|
||||||
m_io.reset();
|
m_io.restart();
|
||||||
|
|
||||||
if (failedToCanonize) {
|
if (failedToCanonize) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -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-2021, The University of Memphis,
|
* Copyright (c) 2014-2023, The University of Memphis,
|
||||||
* Regents of the University of California,
|
* Regents of the University of California,
|
||||||
* Arizona Board of Regents.
|
* Arizona Board of Regents.
|
||||||
*
|
*
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "conf-parameter.hpp"
|
#include "conf-parameter.hpp"
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/asio/io_context.hpp>
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
|
|
||||||
namespace nlsr {
|
namespace nlsr {
|
||||||
@@ -118,8 +118,8 @@ private:
|
|||||||
std::string m_confFileName;
|
std::string m_confFileName;
|
||||||
/*! m_confParam The ConfFileProcessor object to configure as parsing is done. */
|
/*! m_confParam The ConfFileProcessor object to configure as parsing is done. */
|
||||||
ConfParameter& m_confParam;
|
ConfParameter& m_confParam;
|
||||||
/*! m_io For canonization of faceUri. */
|
/*! m_io For canonization of FaceUri. */
|
||||||
boost::asio::io_service m_io;
|
boost::asio::io_context m_io;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace nlsr
|
} // namespace nlsr
|
||||||
|
|||||||
+2
-4
@@ -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-2021, The University of Memphis,
|
* Copyright (c) 2014-2023, The University of Memphis,
|
||||||
* Regents of the University of California,
|
* Regents of the University of California,
|
||||||
* Arizona Board of Regents.
|
* Arizona Board of Regents.
|
||||||
*
|
*
|
||||||
@@ -63,13 +63,11 @@ main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::asio::io_service ioService;
|
|
||||||
ndn::Face face(ioService);
|
|
||||||
ndn::KeyChain keyChain;
|
ndn::KeyChain keyChain;
|
||||||
|
ndn::Face face(nullptr, keyChain);
|
||||||
|
|
||||||
nlsr::ConfParameter confParam(face, keyChain, configFileName);
|
nlsr::ConfParameter confParam(face, keyChain, configFileName);
|
||||||
nlsr::ConfFileProcessor configProcessor(confParam);
|
nlsr::ConfFileProcessor configProcessor(confParam);
|
||||||
|
|
||||||
if (!configProcessor.processConfFile()) {
|
if (!configProcessor.processConfFile()) {
|
||||||
std::cerr << "Error in configuration file processing" << std::endl;
|
std::cerr << "Error in configuration file processing" << std::endl;
|
||||||
return 2;
|
return 2;
|
||||||
|
|||||||
@@ -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 nlsr::test {
|
namespace nlsr::test {
|
||||||
|
|
||||||
@@ -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 nlsr::test
|
} // namespace nlsr::test
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include "tests/test-common.hpp"
|
#include "tests/test-common.hpp"
|
||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
#include <boost/mp11/list.hpp>
|
||||||
|
|
||||||
namespace nlsr {
|
namespace nlsr {
|
||||||
namespace test {
|
namespace test {
|
||||||
@@ -97,8 +98,10 @@ public:
|
|||||||
uint64_t nameLsaSeqNoBeforeInterest;
|
uint64_t nameLsaSeqNoBeforeInterest;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef boost::mpl::vector<update::NfdRibRegisterCommand,
|
using Commands = boost::mp11::mp_list<
|
||||||
update::NfdRibUnregisterCommand> Commands;
|
update::NfdRibRegisterCommand,
|
||||||
|
update::NfdRibUnregisterCommand
|
||||||
|
>;
|
||||||
|
|
||||||
BOOST_FIXTURE_TEST_SUITE(TestNfdRibCommandProcessor, NfdRibCommandProcessorFixture)
|
BOOST_FIXTURE_TEST_SUITE(TestNfdRibCommandProcessor, NfdRibCommandProcessorFixture)
|
||||||
|
|
||||||
|
|||||||
+8
-10
@@ -1,6 +1,6 @@
|
|||||||
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||||
"""
|
"""
|
||||||
Copyright (c) 2014-2022, The University of Memphis
|
Copyright (c) 2014-2023, The University of Memphis
|
||||||
Regents of the University of California
|
Regents of the University of California
|
||||||
|
|
||||||
This file is part of NLSR (Named-data Link State Routing).
|
This file is part of NLSR (Named-data Link State Routing).
|
||||||
@@ -21,12 +21,10 @@ NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
top = '..'
|
top = '..'
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
bld.objects(target='unit-test-objects',
|
bld.program(
|
||||||
source=bld.path.ant_glob('**/*.cpp', excl=['main.cpp']),
|
target=f'{top}/unit-tests-nlsr',
|
||||||
use='nlsr-objects')
|
name='unit-tests-nlsr',
|
||||||
|
source=bld.path.ant_glob('**/*.cpp'),
|
||||||
bld.program(target='../unit-tests-nlsr',
|
use='BOOST_TESTS nlsr-objects',
|
||||||
name='unit-tests-nlsr',
|
includes=top,
|
||||||
source='main.cpp',
|
install_path=None)
|
||||||
use='unit-test-objects',
|
|
||||||
install_path=None)
|
|
||||||
@@ -19,8 +19,9 @@ You should have received a copy of the GNU General Public License along with
|
|||||||
NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
from waflib import Context, Logs, Utils
|
from waflib import Context, Logs, Utils
|
||||||
import os, subprocess
|
|
||||||
|
|
||||||
VERSION = '0.7.0'
|
VERSION = '0.7.0'
|
||||||
APPNAME = 'nlsr'
|
APPNAME = 'nlsr'
|
||||||
@@ -71,16 +72,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', 'iostreams', 'filesystem', 'regex']
|
conf.check_boost(lib='filesystem', 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.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')
|
||||||
|
|
||||||
if conf.options.with_chronosync:
|
if conf.options.with_chronosync:
|
||||||
conf.check_cfg(package='ChronoSync', args=['ChronoSync >= 0.5.5', '--cflags', '--libs'],
|
conf.check_cfg(package='ChronoSync', args=['ChronoSync >= 0.5.5', '--cflags', '--libs'],
|
||||||
uselib_store='CHRONOSYNC', pkg_config_path=pkg_config_path)
|
uselib_store='CHRONOSYNC', pkg_config_path=pkg_config_path)
|
||||||
@@ -104,7 +104,7 @@ def configure(conf):
|
|||||||
conf.load('sanitizers')
|
conf.load('sanitizers')
|
||||||
|
|
||||||
conf.define_cond('WITH_TESTS', conf.env.WITH_TESTS)
|
conf.define_cond('WITH_TESTS', conf.env.WITH_TESTS)
|
||||||
conf.define('DEFAULT_CONFIG_FILE', '%s/ndn/nlsr.conf' % conf.env.SYSCONFDIR)
|
conf.define('DEFAULT_CONFIG_FILE', f'{conf.env.SYSCONFDIR}/ndn/nlsr.conf')
|
||||||
# The config header will contain all defines that were added using conf.define()
|
# The config header will contain all defines that were added using conf.define()
|
||||||
# or conf.define_cond(). Everything that was added directly to conf.env.DEFINES
|
# or conf.define_cond(). Everything that was added directly to conf.env.DEFINES
|
||||||
# will not appear in the config header, but will instead be passed directly to the
|
# will not appear in the config header, but will instead be passed directly to the
|
||||||
@@ -118,6 +118,7 @@ def build(bld):
|
|||||||
name='version.hpp',
|
name='version.hpp',
|
||||||
source='src/version.hpp.in',
|
source='src/version.hpp.in',
|
||||||
target='src/version.hpp',
|
target='src/version.hpp',
|
||||||
|
install_path=None,
|
||||||
VERSION_STRING=VERSION_BASE,
|
VERSION_STRING=VERSION_BASE,
|
||||||
VERSION_BUILD=VERSION,
|
VERSION_BUILD=VERSION,
|
||||||
VERSION=int(VERSION_SPLIT[0]) * 1000000 +
|
VERSION=int(VERSION_SPLIT[0]) * 1000000 +
|
||||||
@@ -129,32 +130,32 @@ def build(bld):
|
|||||||
|
|
||||||
bld.objects(
|
bld.objects(
|
||||||
target='nlsr-objects',
|
target='nlsr-objects',
|
||||||
source=bld.path.ant_glob('src/**/*.cpp',
|
source=bld.path.ant_glob('src/**/*.cpp', excl=['src/main.cpp']),
|
||||||
excl=['src/main.cpp']),
|
use='BOOST NDN_CXX CHRONOSYNC PSYNC SVS',
|
||||||
use='NDN_CXX BOOST CHRONOSYNC PSYNC SVS',
|
|
||||||
includes='. src',
|
includes='. src',
|
||||||
export_includes='. src')
|
export_includes='. src')
|
||||||
|
|
||||||
bld.program(
|
bld.program(
|
||||||
target='bin/nlsr',
|
|
||||||
name='nlsr',
|
name='nlsr',
|
||||||
|
target='bin/nlsr',
|
||||||
source='src/main.cpp',
|
source='src/main.cpp',
|
||||||
use='nlsr-objects')
|
use='nlsr-objects')
|
||||||
|
|
||||||
bld.program(
|
bld.program(
|
||||||
target='bin/nlsrc',
|
|
||||||
name='nlsrc',
|
name='nlsrc',
|
||||||
|
target='bin/nlsrc',
|
||||||
source='tools/nlsrc.cpp',
|
source='tools/nlsrc.cpp',
|
||||||
use='nlsr-objects')
|
use='nlsr-objects')
|
||||||
|
|
||||||
if bld.env.WITH_TESTS:
|
if bld.env.WITH_TESTS:
|
||||||
bld.recurse('tests')
|
bld.recurse('tests')
|
||||||
|
|
||||||
|
# Install sample config
|
||||||
bld.install_as('${SYSCONFDIR}/ndn/nlsr.conf.sample', 'nlsr.conf')
|
bld.install_as('${SYSCONFDIR}/ndn/nlsr.conf.sample', 'nlsr.conf')
|
||||||
|
|
||||||
if Utils.unversioned_sys_platform() == 'linux':
|
if Utils.unversioned_sys_platform() == 'linux':
|
||||||
bld(features='subst',
|
bld(features='subst',
|
||||||
name='nlsr.service',
|
name='systemd-units',
|
||||||
source='systemd/nlsr.service.in',
|
source='systemd/nlsr.service.in',
|
||||||
target='systemd/nlsr.service')
|
target='systemd/nlsr.service')
|
||||||
|
|
||||||
@@ -220,16 +221,16 @@ def version(ctx):
|
|||||||
# first, try to get a version string from git
|
# first, try to get a version string from git
|
||||||
gotVersionFromGit = False
|
gotVersionFromGit = False
|
||||||
try:
|
try:
|
||||||
cmd = ['git', 'describe', '--always', '--match', '%s*' % GIT_TAG_PREFIX]
|
cmd = ['git', 'describe', '--always', '--match', f'{GIT_TAG_PREFIX}*']
|
||||||
out = subprocess.check_output(cmd, universal_newlines=True).strip()
|
out = subprocess.run(cmd, capture_output=True, check=True, text=True).stdout.strip()
|
||||||
if out:
|
if out:
|
||||||
gotVersionFromGit = True
|
gotVersionFromGit = True
|
||||||
if out.startswith(GIT_TAG_PREFIX):
|
if out.startswith(GIT_TAG_PREFIX):
|
||||||
Context.g_module.VERSION = out.lstrip(GIT_TAG_PREFIX)
|
Context.g_module.VERSION = out.lstrip(GIT_TAG_PREFIX)
|
||||||
else:
|
else:
|
||||||
# no tags matched
|
# no tags matched
|
||||||
Context.g_module.VERSION = '%s-commit-%s' % (VERSION_BASE, out)
|
Context.g_module.VERSION = f'{VERSION_BASE}-commit-{out}'
|
||||||
except (OSError, subprocess.CalledProcessError):
|
except (OSError, subprocess.SubprocessError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
versionFile = ctx.path.find_node('VERSION.info')
|
versionFile = ctx.path.find_node('VERSION.info')
|
||||||
@@ -247,14 +248,14 @@ def version(ctx):
|
|||||||
# already up-to-date
|
# already up-to-date
|
||||||
return
|
return
|
||||||
except EnvironmentError as e:
|
except EnvironmentError as e:
|
||||||
Logs.warn('%s exists but is not readable (%s)' % (versionFile, e.strerror))
|
Logs.warn(f'{versionFile} exists but is not readable ({e.strerror})')
|
||||||
else:
|
else:
|
||||||
versionFile = ctx.path.make_node('VERSION.info')
|
versionFile = ctx.path.make_node('VERSION.info')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
versionFile.write(Context.g_module.VERSION)
|
versionFile.write(Context.g_module.VERSION)
|
||||||
except EnvironmentError as e:
|
except EnvironmentError as e:
|
||||||
Logs.warn('%s is not writable (%s)' % (versionFile, e.strerror))
|
Logs.warn(f'{versionFile} is not writable ({e.strerror})')
|
||||||
|
|
||||||
def dist(ctx):
|
def dist(ctx):
|
||||||
ctx.algo = 'tar.xz'
|
ctx.algo = 'tar.xz'
|
||||||
|
|||||||
Reference in new issue
Block a user