build: Raising requirement for boost to be at least 1.48
This requirement matches the requirement of NFD.
Change-Id: I194a5e81018ab6569615854fa0af9d3a7af4cca8
diff --git a/.travis.yml b/.travis.yml
index 6755b23..f2ebc72 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,7 +9,7 @@
- travis_retry sudo add-apt-repository -y ppa:named-data/ppa
- travis_retry sudo apt-get update -qq
- travis_retry sudo apt-get install -qq ndnx-dev
- - travis_retry sudo apt-get install -qq libboost-all-dev
+ - travis_retry sudo apt-get install -qq libboost1.48-all-dev
- travis_retry sudo apt-get install -qq libcrypto++-dev
- travis_retry sudo apt-get install -qq libsqlite3-dev
script:
diff --git a/.waf-tools/boost.py b/.waf-tools/boost.py
index c714b5b..6d79788 100644
--- a/.waf-tools/boost.py
+++ b/.waf-tools/boost.py
@@ -39,9 +39,9 @@
- boost libraries will try to be smart and use the (pretty but often not useful) auto-linking feature of MSVC
So before calling `conf.check_boost` you might want to disabling by adding:
conf.env.DEFINES_BOOST += ['BOOST_ALL_NO_LIB']
- Errors:
+ Errors:
- boost might also be compiled with /MT, which links the runtime statically.
- If you have problems with redefined symbols,
+ If you have problems with redefined symbols,
self.env['DEFINES_%s' % var] += ['BOOST_ALL_NO_LIB']
self.env['CXXFLAGS_%s' % var] += ['/MD', '/EHsc']
Passing `--boost-linkage_autodetect` might help ensuring having a correct linkage in some basic cases.
@@ -59,7 +59,7 @@
BOOST_VERSION_CODE = '''
#include <iostream>
#include <boost/version.hpp>
-int main() { std::cout << BOOST_LIB_VERSION << std::endl; }
+int main() { std::cout << BOOST_LIB_VERSION << ":" << BOOST_VERSION << std::endl; }
'''
# toolsets from {boost_dir}/tools/build/v2/tools/common.jam
@@ -92,16 +92,14 @@
def options(opt):
- opt = opt.add_option_group('Boost Options')
-
+ opt = opt.add_option_group('Boost Options')
+
opt.add_option('--boost-includes', type='string',
default='', dest='boost_includes',
- help='''path to the boost includes root (~boost root)
- e.g. /path/to/boost_1_47_0''')
+ help='''path to the directory where the boost includes are, e.g., /path/to/boost_1_55_0/stage/include''')
opt.add_option('--boost-libs', type='string',
default='', dest='boost_libs',
- help='''path to the directory where the boost libs are
- e.g. /path/to/boost_1_47_0/stage/lib''')
+ help='''path to the directory where the boost libs are, e.g., /path/to/boost_1_55_0/stage/lib''')
opt.add_option('--boost-static', action='store_true',
default=False, dest='boost_static',
help='link with static boost libraries (.lib/.a)')
@@ -109,19 +107,16 @@
default=False, dest='boost_mt',
help='select multi-threaded libraries')
opt.add_option('--boost-abi', type='string', default='', dest='boost_abi',
- help='''select libraries with tags (dgsyp, d for debug),
- see doc Boost, Getting Started, chapter 6.1''')
+ help='''select libraries with tags (dgsyp, d for debug), see doc Boost, Getting Started, chapter 6.1''')
opt.add_option('--boost-linkage_autodetect', action="store_true", dest='boost_linkage_autodetect',
help="auto-detect boost linkage options (don't get used to it / might break other stuff)")
opt.add_option('--boost-toolset', type='string',
default='', dest='boost_toolset',
- help='force a toolset e.g. msvc, vc90, \
- gcc, mingw, mgw45 (default: auto)')
+ help='force a toolset e.g. msvc, vc90, gcc, mingw, mgw45 (default: auto)')
py_version = '%d%d' % (sys.version_info[0], sys.version_info[1])
opt.add_option('--boost-python', type='string',
default=py_version, dest='boost_python',
- help='select the lib python with this version \
- (default: %s)' % py_version)
+ help='select the lib python with this version (default: %s)' % py_version)
@conf
@@ -141,11 +136,16 @@
except (OSError, IOError):
Logs.error("Could not read the file %r" % node.abspath())
else:
- re_but = re.compile('^#define\\s+BOOST_LIB_VERSION\\s+"(.*)"', re.M)
- m = re_but.search(txt)
- if m:
- return m.group(1)
- return self.check_cxx(fragment=BOOST_VERSION_CODE, includes=[d], execute=True, define_ret=True)
+ re_but1 = re.compile('^#define\\s+BOOST_LIB_VERSION\\s+"(.*)"', re.M)
+ m1 = re_but1.search(txt)
+
+ re_but2 = re.compile('^#define\\s+BOOST_VERSION\\s+"(.*)"', re.M)
+ m2 = re_but2.search(txt)
+
+ if m1 and m2:
+ return (m1.group(1), m2.group(1))
+
+ return self.check_cxx(fragment=BOOST_VERSION_CODE, includes=[d], execute=True, define_ret=True).split(":")
@conf
def boost_get_includes(self, *k, **kw):
@@ -285,8 +285,12 @@
self.start_msg('Checking boost includes')
self.env['INCLUDES_%s' % var] = inc = self.boost_get_includes(**params)
- self.env.BOOST_VERSION = self.boost_get_version(inc)
- self.end_msg(self.env.BOOST_VERSION)
+ versions = self.boost_get_version(inc)
+ self.env.BOOST_VERSION = versions[0]
+ self.env.BOOST_VERSION_NUMBER = int(versions[1])
+ self.end_msg("%d.%d.%d" % (int(versions[1]) / 100000,
+ int(versions[1]) / 100 % 1000,
+ int(versions[1]) % 100))
if Logs.verbose:
Logs.pprint('CYAN', ' path : %s' % self.env['INCLUDES_%s' % var])
@@ -370,4 +374,3 @@
self.end_msg("Could not link against boost libraries using supplied options")
self.fatal('The configuration failed')
self.end_msg('ok')
-
diff --git a/INSTALL.md b/INSTALL.md
index 65690a6..3e5a45f 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -12,7 +12,7 @@
* libcrypto
* libsqlite3
* libcrypto++
-* boost libraries
+* boost libraries (>= 1.48)
* OSX Security framework (on OSX platform only)
Following are the detailed steps for each platform to install the prerequisites.
@@ -30,12 +30,16 @@
sudo port install boost sqlite3 libcryptopp
-* Ubuntu 12.04 (64 bit and 32 bit), Ubuntu 13.04 (64 bit)
+* Ubuntu 12.04, Ubuntu 13.10
In a terminal, enter:
sudo apt-get install build-essential
- sudo apt-get install libboost-all-dev libssl-dev libsqlite3-dev libcrypto++-dev
+ # For Ubuntu 12.04
+ sudo apt-get install libboost1.48-all-dev
+ # For Ubuntu 13.10
+ sudo apt-get install libboost-all-dev
+ sudo apt-get install libssl-dev libsqlite3-dev libcrypto++-dev
* Windows Cygwin
@@ -87,10 +91,11 @@
(to be confirmed)
NDN-CPP is tested on the following platforms:
-Ubuntu 12.04 (64 bit and 32 bit) (gcc 4.6.3)
-Ubuntu 13.04 (64 bit) (gcc 4.7.3)
-Mac OS X 10.8.4 (clang 4.2)
-Mac OS X 10.8.4 (gcc 4.2)
+
+* Ubuntu 12.04 (64 bit and 32 bit)
+* Ubuntu 13.10 (64 bit and 32 bit)
+* Mac OS X 10.8
+* Mac OS X 10.9
Development Prerequisites
-------------------------
diff --git a/wscript b/wscript
index 5fd177a..65db4a7 100644
--- a/wscript
+++ b/wscript
@@ -20,8 +20,6 @@
opt.add_option('--with-c++11', action='store_true', default=False, dest='use_cxx11',
help='''Use C++11 features, even if available in the compiler''')
- opt.add_option('--without-system-boost', action='store_false', default=True, dest='use_system_boost',
- help='''Use system's boost libraries''')
opt.add_option('--without-tools', action='store_false', default=True, dest='with_tools',
help='''Do not build tools''')
@@ -97,18 +95,17 @@
conf.check(msg='Checking for type std::function',
type_name="std::function<void()>", header_name="functional", define_name='HAVE_STD_FUNCTION')
conf.define('HAVE_CXX11', 1)
- else:
- if conf.options.use_system_boost:
- USED_BOOST_LIBS = 'system filesystem date_time iostreams regex program_options'
- if conf.env['WITH_TESTS']:
- USED_BOOST_LIBS += " unit_test_framework"
+
+ USED_BOOST_LIBS = ['system', 'filesystem', 'date_time', 'iostreams', 'regex', 'program_options', 'chrono']
+ if conf.env['WITH_TESTS']:
+ USED_BOOST_LIBS += ['unit_test_framework']
- conf.check_boost(lib=USED_BOOST_LIBS)
-
- boost_version = conf.env.BOOST_VERSION.split('_')
- if int(boost_version[0]) > 1 or (int(boost_version[0]) == 1 and int(boost_version[1]) >= 46):
- conf.env['USE_SYSTEM_BOOST'] = True
- conf.define('USE_SYSTEM_BOOST', 1)
+ conf.check_boost(lib=USED_BOOST_LIBS, mandatory=True)
+ if conf.env.BOOST_VERSION_NUMBER < 104800:
+ Logs.error ("Minimum required boost version is 1.48.0")
+ Logs.error ("Please upgrade your distribution or install custom boost libraries" +
+ " (http://redmine.named-data.net/projects/nfd/wiki/Boost_FAQ)")
+ return
conf.check_cxx(lib='pthread', uselib_store='PTHREAD', define_name='HAVE_PTHREAD', mandatory=False)
conf.check_cxx(lib='rt', uselib_store='RT', define_name='HAVE_RT', mandatory=False)