Skip to content

Commit

Permalink
build+docs: align minimum requirements with ndn-cxx/NFD
Browse files Browse the repository at this point in the history
 * Recommend boost >= 1.65.1 and gcc >= 7.4.0
 * Require clang >= 4.0, or Xcode >= 9.0 on macOS
 * Silence an ABI-related diagnostic message from gcc on armv7
 * Update waf to version 2.0.21
 * Make graphviz optional for building documentation
 * Sync sphinx configuration

Change-Id: Ib271da841cd12e7595ae83d75bd0fc681f8c231f
  • Loading branch information
Pesa committed Oct 14, 2021
1 parent 6f0f35d commit 7ae8b08
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 422 deletions.
20 changes: 4 additions & 16 deletions .jenkins.d/20-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,7 @@ set -ex

# Prepare environment
rm -rf ~/.ndn

BOOST_VERSION=$(python3 -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")

ut_log_args() {
if (( BOOST_VERSION >= 106200 )); then
echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
else
if [[ -n $XUNIT ]]; then
echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
--log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
else
echo --log_level=test_suite
fi
fi
}
ndnsec key-gen "/tmp/jenkins/$NODE_NAME" | ndnsec cert-install -

# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
ASAN_OPTIONS="color=always"
Expand All @@ -32,6 +18,8 @@ export ASAN_OPTIONS

export BOOST_TEST_BUILD_INFO=1
export BOOST_TEST_COLOR_OUTPUT=1
export BOOST_TEST_DETECT_MEMORY_LEAK=0
export BOOST_TEST_LOGGER=HRF,test_suite,stdout:XML,all,build/xunit-log.xml

# Run unit tests
./build/unit-tests-nlsr $(ut_log_args)
./build/unit-tests-nlsr
57 changes: 34 additions & 23 deletions .waf-tools/default-compiler-flags.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

import platform
from waflib import Configure, Logs, Utils

def options(opt):
opt.add_option('--debug', '--with-debug', action='store_true', default=False,
help='Compile in debugging mode with minimal optimizations (-O0 or -Og)')
help='Compile in debugging mode with minimal optimizations (-Og)')

def configure(conf):
conf.start_msg('Checking C++ compiler version')
Expand All @@ -17,23 +18,29 @@ def configure(conf):
if cxx == 'gcc':
if ccver < (5, 3, 0):
errmsg = ('The version of gcc you are using is too old.\n'
'The minimum supported gcc version is 5.3.0.')
'The minimum supported gcc version is 7.4.0.')
elif ccver < (7, 4, 0):
warnmsg = ('Using a version of gcc older than 7.4.0 is not '
'officially supported and may result in build failures.')
conf.flags = GccFlags()
elif cxx == 'clang':
if ccver < (3, 6, 0):
if Utils.unversioned_sys_platform() == 'darwin' and ccver < (9, 0, 0):
errmsg = ('The version of Xcode you are using is too old.\n'
'The minimum supported Xcode version is 9.0.')
elif ccver < (4, 0, 0):
errmsg = ('The version of clang you are using is too old.\n'
'The minimum supported clang version is 3.6.0.')
'The minimum supported clang version is 4.0.')
conf.flags = ClangFlags()
else:
warnmsg = 'Note: %s compiler is unsupported' % cxx
warnmsg = '%s compiler is unsupported' % cxx
conf.flags = CompilerFlags()

if errmsg:
conf.end_msg(ccverstr, color='RED')
conf.fatal(errmsg)
elif warnmsg:
conf.end_msg(ccverstr, color='YELLOW')
Logs.warn(warnmsg)
Logs.warn('WARNING: ' + warnmsg)
else:
conf.end_msg(ccverstr)

Expand Down Expand Up @@ -137,13 +144,14 @@ def getGeneralFlags(self, conf):

def getDebugFlags(self, conf):
flags = super(GccBasicFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-O0',
'-Og', # gcc >= 4.8, clang >= 4.0
flags['CXXFLAGS'] += ['-Og',
'-g3',
'-pedantic',
'-Wall',
'-Wextra',
'-Werror',
'-Wcatch-value=2',
'-Wextra-semi',
'-Wnon-virtual-dtor',
'-Wno-error=deprecated-declarations', # Bug #3795
'-Wno-error=maybe-uninitialized', # Bug #1615
Expand All @@ -159,6 +167,8 @@ def getOptimizedFlags(self, conf):
'-pedantic',
'-Wall',
'-Wextra',
'-Wcatch-value=2',
'-Wextra-semi',
'-Wnon-virtual-dtor',
'-Wno-unused-parameter',
]
Expand All @@ -168,49 +178,50 @@ def getOptimizedFlags(self, conf):
class GccFlags(GccBasicFlags):
def getDebugFlags(self, conf):
flags = super(GccFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-fdiagnostics-color']
flags['CXXFLAGS'] += ['-fdiagnostics-color',
'-Wredundant-tags',
]
if platform.machine() == 'armv7l' and self.getCompilerVersion(conf) >= (7, 1, 0):
flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
return flags

def getOptimizedFlags(self, conf):
flags = super(GccFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-fdiagnostics-color']
flags['CXXFLAGS'] += ['-fdiagnostics-color',
'-Wredundant-tags',
]
if platform.machine() == 'armv7l' and self.getCompilerVersion(conf) >= (7, 1, 0):
flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
return flags

class ClangFlags(GccBasicFlags):
def getGeneralFlags(self, conf):
flags = super(ClangFlags, self).getGeneralFlags(conf)
if Utils.unversioned_sys_platform() == 'darwin' and self.getCompilerVersion(conf) >= (9, 0, 0):
if Utils.unversioned_sys_platform() == 'darwin':
# Bug #4296
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include'], # for Homebrew
['-isystem', '/opt/local/include']] # for MacPorts
if Utils.unversioned_sys_platform() == 'freebsd':
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']] # Bug #4790
elif Utils.unversioned_sys_platform() == 'freebsd':
# Bug #4790
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']]
return flags

def getDebugFlags(self, conf):
flags = super(ClangFlags, self).getDebugFlags(conf)
flags['CXXFLAGS'] += ['-fcolor-diagnostics',
'-Wextra-semi',
'-Wundefined-func-template',
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
]
version = self.getCompilerVersion(conf)
if version < (3, 9, 0) or (Utils.unversioned_sys_platform() == 'darwin' and version < (8, 1, 0)):
flags['CXXFLAGS'] += ['-Wno-unknown-pragmas']
if version < (6, 0, 0):
if self.getCompilerVersion(conf) < (6, 0, 0):
flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
return flags

def getOptimizedFlags(self, conf):
flags = super(ClangFlags, self).getOptimizedFlags(conf)
flags['CXXFLAGS'] += ['-fcolor-diagnostics',
'-Wextra-semi',
'-Wundefined-func-template',
'-Wno-unused-local-typedef', # Bugs #2657 and #3209
]
version = self.getCompilerVersion(conf)
if version < (3, 9, 0) or (Utils.unversioned_sys_platform() == 'darwin' and version < (8, 1, 0)):
flags['CXXFLAGS'] += ['-Wno-unknown-pragmas']
if version < (6, 0, 0):
if self.getCompilerVersion(conf) < (6, 0, 0):
flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
return flags
6 changes: 3 additions & 3 deletions docs/RELEASE-NOTES.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NLSR Release Notes
==================
Release Notes
=============

.. include:: release-notes-latest.rst
.. include:: release-notes-latest.rst
Empty file removed docs/_static/.gitignore
Empty file.
18 changes: 11 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

Expand All @@ -20,13 +18,13 @@
# -- Project information -----------------------------------------------------

project = u'Named Data Link State Routing Protocol (NLSR)'
copyright = u'Copyright © 2014-2020 Named Data Networking Project.'
copyright = u'Copyright © 2014-2021 Named Data Networking Project.'
author = u'Named Data Networking Project'

# The short X.Y version
# The short X.Y version.
#version = ''

# The full version, including alpha/beta/rc tags
# The full version, including alpha/beta/rc tags.
#release = ''

# There are two options for replacing |today|: either, you set today to some
Expand All @@ -40,7 +38,7 @@

# If your documentation needs a minimal Sphinx version, state it here.
#
needs_sphinx = '1.1'
needs_sphinx = '1.3'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down Expand Up @@ -87,6 +85,12 @@ def addExtensionIfExists(extension):
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

html_copy_source = False
html_show_sourcelink = False

# Disable syntax highlighting of code blocks by default.
highlight_language = 'none'


# -- Options for LaTeX output ------------------------------------------------

Expand Down
34 changes: 3 additions & 31 deletions docs/doxygen.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,6 @@ TAB_SIZE = 4

ALIASES =

# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.

TCL_SUBST =

# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
Expand Down Expand Up @@ -968,13 +962,6 @@ VERBATIM_HEADERS = YES

ALPHABETICAL_INDEX = YES

# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.

COLS_IN_ALPHA_INDEX = 5

# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
Expand Down Expand Up @@ -1989,12 +1976,6 @@ EXTERNAL_GROUPS = YES

EXTERNAL_PAGES = YES

# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of 'which perl').
# The default file (with absolute path) is: /usr/bin/perl.

PERL_PATH = /usr/bin/perl

#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
Expand All @@ -2008,15 +1989,6 @@ PERL_PATH = /usr/bin/perl

CLASS_DIAGRAMS = YES

# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see:
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.

MSCGEN_PATH =

# If set to YES, the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
Expand All @@ -2030,7 +2002,7 @@ HIDE_UNDOC_RELATIONS = NO
# set to NO
# The default value is: NO.

HAVE_DOT = YES
HAVE_DOT = @HAVE_DOT@

# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
Expand Down Expand Up @@ -2146,7 +2118,7 @@ INCLUDED_BY_GRAPH = YES
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.

CALL_GRAPH = YES
CALL_GRAPH = NO

# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
# dependency graph for every global function or class method.
Expand All @@ -2157,7 +2129,7 @@ CALL_GRAPH = YES
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.

CALLER_GRAPH = YES
CALLER_GRAPH = NO

# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one.
Expand Down
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NLSR - Named Data Link State Routing Protocol

NLSR is a routing protocol in NDN that populates NDN's Routing Information Base. NLSR will
continue to evolve alongside the Named Data Networking `protocol
<https://named-data.net/doc/ndn-tlv/>`_.
<https://named-data.net/doc/NDN-packet-spec/current/>`_.

NLSR is an open and free software package licensed under the GPL 3.0 license and free to
all Internet users and developers. For more information about the licensing details and
Expand All @@ -23,11 +23,11 @@ inter-domain routing protocol for NDN. The protocol design is presented in full
the `NLSR Paper`_.

NLSR Documentation
-------------------
------------------

.. toctree::
:hidden:
:maxdepth: 3
:maxdepth: 2

GETTING-STARTED
INSTALL
Expand Down
12 changes: 5 additions & 7 deletions docs/manpages.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
.. _Manpages:

Manpages
========
Man pages
=========

.. toctree::
manpages/nlsr
manpages/nlsr.conf
manpages/nlsrc
:glob:
:maxdepth: 1

manpages/*
18 changes: 3 additions & 15 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,12 @@ NLSR Versions
+++++++++++++

.. toctree::
:glob:
:hidden:
:maxdepth: 1
:reversed:

release-notes/release-notes-0.6.0
release-notes/release-notes-0.5.2
release-notes/release-notes-0.5.1
release-notes/release-notes-0.5.0
release-notes/release-notes-0.4.3
release-notes/release-notes-0.4.2
release-notes/release-notes-0.4.1
release-notes/release-notes-0.4.0
release-notes/release-notes-0.3.2
release-notes/release-notes-0.3.1
release-notes/release-notes-0.3.0
release-notes/release-notes-0.2.2
release-notes/release-notes-0.2.1
release-notes/release-notes-0.2.0
release-notes/release-notes-0.1.0
release-notes/*

* **NLSR version 0.6.0**
(:doc:`Release Notes <release-notes/release-notes-0.6.0>`, `Documentation <https://named-data.net/doc/NLSR/0.6.0/>`__)
Expand Down
Loading

0 comments on commit 7ae8b08

Please sign in to comment.