build+ci: support CentOS Stream 9 and macOS/arm64
This commit also syncs the CI config and scripts with ndn-cxx
Change-Id: Ie46b1d4b299bc95b03aa05d48efe366e1c72d54d
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 47d9a6a..3495a8f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -13,22 +13,24 @@
jobs:
linux:
name: ${{ matrix.compiler }} on ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
- compiler: [g++-8, g++-9, g++-10, g++-11,
- clang++-7, clang++-8, clang++-9, clang++-10, clang++-11, clang++-12]
os: [ubuntu-20.04]
+ compiler: [g++-7, g++-8, g++-9, g++-10,
+ clang++-7, clang++-8, clang++-9, clang++-10, clang++-11, clang++-12]
include:
- - compiler: g++-7
- os: ubuntu-18.04
- - compiler: clang++-6.0
- os: ubuntu-18.04
- runs-on: ${{ matrix.os }}
+ - os: ubuntu-22.04
+ compiler: g++-11
+ - os: ubuntu-22.04
+ compiler: g++-12
+ - os: ubuntu-22.04
+ compiler: clang++-13
+ - os: ubuntu-22.04
+ compiler: clang++-14
env:
CXX: ${{ matrix.compiler }}
- NODE_LABELS: Linux Ubuntu
- WAF_JOBS: 2
steps:
- name: Install C++ compiler
run: |
@@ -41,20 +43,15 @@
macos:
name: Xcode ${{ matrix.xcode }} on ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
- xcode: ['11.3', '11.7', '12.4']
- os: [macos-10.15]
+ os: [macos-11]
+ xcode: ['12.4', '12.5', '13.2']
include:
- - xcode: '12.5'
- os: macos-11
- - xcode: '13.2'
- os: macos-11
- runs-on: ${{ matrix.os }}
- env:
- NODE_LABELS: OSX
- WAF_JOBS: 3
+ - os: macos-12
+ xcode: '13.4'
steps:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index f27285b..0641c21 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -11,23 +11,18 @@
jobs:
build:
+ runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
- os: [macos-11, ubuntu-20.04]
- runs-on: ${{ matrix.os }}
+ os: [macos-12, ubuntu-20.04]
env:
JOB_NAME: Docs
- WAF_JOBS: 3
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
- case ${RUNNER_OS} in
- Linux) export NODE_LABELS="Linux Ubuntu" ;;
- macOS) export NODE_LABELS="OSX" ;;
- esac
find .jenkins.d/ -type f -name '[1-9]*.sh' -exec chmod -x '{}' +
./.jenkins
- name: Build documentation
diff --git a/.jenkins b/.jenkins
index da10d69..ee16e29 100755
--- a/.jenkins
+++ b/.jenkins
@@ -1,12 +1,30 @@
#!/usr/bin/env bash
-set -e
-source .jenkins.d/util.sh
+set -eo pipefail
-if has Linux $NODE_LABELS; then
- export PATH="${HOME}/.local/bin${PATH:+:}${PATH}"
-fi
+case $(uname) in
+ Linux)
+ if [[ -e /etc/os-release ]]; then
+ source /etc/os-release
+ else
+ source /usr/lib/os-release
+ fi
+ export ID VERSION_ID
+ export ID_LIKE="${ID} ${ID_LIKE} linux"
+ export PATH="${HOME}/.local/bin${PATH:+:}${PATH}"
+ ;;
+ Darwin)
+ # Emulate a subset of os-release(5)
+ export ID=macos
+ export VERSION_ID=$(sw_vers -productVersion)
+ if [[ -x /opt/homebrew/bin/brew ]]; then
+ eval "$(/opt/homebrew/bin/brew shellenv)"
+ elif [[ -x /usr/local/bin/brew ]]; then
+ eval "$(/usr/local/bin/brew shellenv)"
+ fi
+ ;;
+esac
+
export CACHE_DIR=${CACHE_DIR:-/tmp}
-export WAF_JOBS=${WAF_JOBS:-1}
[[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes
for file in .jenkins.d/*; do
diff --git a/.jenkins.d/00-deps.sh b/.jenkins.d/00-deps.sh
index a287116..12b5de3 100755
--- a/.jenkins.d/00-deps.sh
+++ b/.jenkins.d/00-deps.sh
@@ -1,45 +1,44 @@
#!/usr/bin/env bash
-set -ex
+set -eo pipefail
-if has OSX $NODE_LABELS; then
- FORMULAE=(boost openssl pkg-config)
- if [[ $JOB_NAME == *"Docs" ]]; then
+APT_PKGS=(build-essential pkg-config python3-minimal
+ libboost-all-dev libssl-dev libsqlite3-dev)
+FORMULAE=(boost openssl pkg-config)
+PIP_PKGS=()
+case $JOB_NAME in
+ *code-coverage)
+ APT_PKGS+=(lcov python3-pip)
+ PIP_PKGS+=('gcovr~=5.2')
+ ;;
+ *Docs)
+ APT_PKGS+=(doxygen graphviz python3-pip)
FORMULAE+=(doxygen graphviz)
- fi
+ PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
+ ;;
+esac
+set -x
+
+if [[ $ID == macos ]]; then
if [[ -n $GITHUB_ACTIONS ]]; then
- # GitHub Actions runners have a large number of pre-installed
- # Homebrew packages. Don't waste time upgrading all of them.
- brew list --versions "${FORMULAE[@]}" || brew update
- for FORMULA in "${FORMULAE[@]}"; do
- brew list --versions "$FORMULA" || brew install "$FORMULA"
- done
- # Ensure /usr/local/opt/openssl exists
- brew reinstall openssl
- else
- brew update
- brew upgrade
- brew install "${FORMULAE[@]}"
- brew cleanup
+ export HOMEBREW_NO_INSTALL_UPGRADE=1
+ fi
+ brew update
+ brew install --formula "${FORMULAE[@]}"
+
+ if (( ${#PIP_PKGS[@]} )); then
+ pip3 install --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
fi
- if [[ $JOB_NAME == *"Docs" ]]; then
- pip3 install --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
- fi
-
-elif has Ubuntu $NODE_LABELS; then
+elif [[ $ID_LIKE == *debian* ]]; then
sudo apt-get -qq update
- sudo apt-get -qy install build-essential pkg-config python3-minimal \
- libboost-all-dev libssl-dev libsqlite3-dev
+ sudo apt-get -qy install "${APT_PKGS[@]}"
- case $JOB_NAME in
- *code-coverage)
- sudo apt-get -qy install lcov python3-pip
- pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.1'
- ;;
- *Docs)
- sudo apt-get -qy install doxygen graphviz python3-pip
- pip3 install --user --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
- ;;
- esac
+ if (( ${#PIP_PKGS[@]} )); then
+ pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
+ fi
+
+elif [[ $ID_LIKE == *fedora* ]]; then
+ sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
+ boost-devel openssl-devel sqlite-devel
fi
diff --git a/.jenkins.d/01-ndn-cxx.sh b/.jenkins.d/01-ndn-cxx.sh
index 4e0e154..91ebefd 100755
--- a/.jenkins.d/01-ndn-cxx.sh
+++ b/.jenkins.d/01-ndn-cxx.sh
@@ -1,11 +1,11 @@
#!/usr/bin/env bash
-set -ex
+set -exo pipefail
pushd "$CACHE_DIR" >/dev/null
INSTALLED_VERSION=
-if has OSX $NODE_LABELS; then
- BOOST=$(brew ls --versions boost)
+if [[ $ID == macos ]]; then
+ BOOST=$(brew list --formula --versions boost)
OLD_BOOST=$(cat boost.txt || :)
if [[ $OLD_BOOST != $BOOST ]]; then
echo "$BOOST" > boost.txt
@@ -35,21 +35,16 @@
pushd ndn-cxx >/dev/null
-if has CentOS-8 $NODE_LABELS; then
- # https://bugzilla.redhat.com/show_bug.cgi?id=1721553
- PCH="--without-pch"
-fi
-
-./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain $PCH
-./waf --color=yes build -j$WAF_JOBS
-sudo_preserve_env PATH -- ./waf --color=yes install
+./waf --color=yes configure --without-osx-keychain
+./waf --color=yes build
+sudo ./waf --color=yes install
popd >/dev/null
popd >/dev/null
-if has CentOS-8 $NODE_LABELS; then
+if [[ $ID_LIKE == *fedora* ]]; then
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
fi
-if has Linux $NODE_LABELS; then
+if [[ $ID_LIKE == *linux* ]]; then
sudo ldconfig
fi
diff --git a/.jenkins.d/02-chronosync.sh b/.jenkins.d/02-chronosync.sh
index 642e469..145273c 100755
--- a/.jenkins.d/02-chronosync.sh
+++ b/.jenkins.d/02-chronosync.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-set -ex
+set -exo pipefail
PROJ=ChronoSync
@@ -35,12 +35,15 @@
pushd "$PROJ" >/dev/null
./waf --color=yes configure
-./waf --color=yes build -j$WAF_JOBS
-sudo_preserve_env PATH -- ./waf --color=yes install
+./waf --color=yes build
+sudo ./waf --color=yes install
popd >/dev/null
popd >/dev/null
-if has Linux $NODE_LABELS; then
+if [[ $ID_LIKE == *fedora* ]]; then
+ sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
+fi
+if [[ $ID_LIKE == *linux* ]]; then
sudo ldconfig
fi
diff --git a/.jenkins.d/03-psync.sh b/.jenkins.d/03-psync.sh
index c4b88b2..4694517 100755
--- a/.jenkins.d/03-psync.sh
+++ b/.jenkins.d/03-psync.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-set -ex
+set -exo pipefail
PROJ=PSync
@@ -35,12 +35,15 @@
pushd "$PROJ" >/dev/null
./waf --color=yes configure
-./waf --color=yes build -j$WAF_JOBS
-sudo_preserve_env PATH -- ./waf --color=yes install
+./waf --color=yes build
+sudo ./waf --color=yes install
popd >/dev/null
popd >/dev/null
-if has Linux $NODE_LABELS; then
+if [[ $ID_LIKE == *fedora* ]]; then
+ sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
+fi
+if [[ $ID_LIKE == *linux* ]]; then
sudo ldconfig
fi
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index 99eb066..55f50f4 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -1,8 +1,5 @@
#!/usr/bin/env bash
-set -ex
-
-git submodule sync
-git submodule update --init
+set -eo pipefail
if [[ -z $DISABLE_ASAN ]]; then
ASAN="--with-sanitizer=address"
@@ -11,17 +8,19 @@
COVERAGE="--with-coverage"
fi
+set -x
+
if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
# Build in release mode with tests
./waf --color=yes configure --with-tests
- ./waf --color=yes build -j$WAF_JOBS
+ ./waf --color=yes build
# Cleanup
./waf --color=yes distclean
# Build in release mode without tests
./waf --color=yes configure
- ./waf --color=yes build -j$WAF_JOBS
+ ./waf --color=yes build
# Cleanup
./waf --color=yes distclean
@@ -29,9 +28,9 @@
# Build in debug mode with tests
./waf --color=yes configure --debug --with-chronosync --with-tests $ASAN $COVERAGE
-./waf --color=yes build -j$WAF_JOBS
+./waf --color=yes build
# (tests will be run against the debug version)
# Install
-sudo_preserve_env PATH -- ./waf --color=yes install
+sudo ./waf --color=yes install
diff --git a/.jenkins.d/20-tests.sh b/.jenkins.d/20-tests.sh
index 0850265..5490d0f 100755
--- a/.jenkins.d/20-tests.sh
+++ b/.jenkins.d/20-tests.sh
@@ -1,9 +1,5 @@
#!/usr/bin/env bash
-set -ex
-
-# Prepare environment
-rm -rf ~/.ndn
-ndnsec key-gen "/tmp/jenkins/$NODE_NAME" | ndnsec cert-install -
+set -eo pipefail
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
ASAN_OPTIONS="color=always"
@@ -16,10 +12,16 @@
ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
export ASAN_OPTIONS
+# https://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/runtime_config/summary.html
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
+set -x
+
+# Prepare environment
+rm -rf ~/.ndn
+
# Run unit tests
./build/unit-tests-nlsr
diff --git a/.jenkins.d/30-coverage.sh b/.jenkins.d/30-coverage.sh
index 4ff1c3e..c758aaa 100755
--- a/.jenkins.d/30-coverage.sh
+++ b/.jenkins.d/30-coverage.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-set -ex
+set -exo pipefail
if [[ $JOB_NAME == *"code-coverage" ]]; then
# Generate an XML report (Cobertura format) and a detailed HTML report using gcovr
diff --git a/.jenkins.d/README.md b/.jenkins.d/README.md
index e8dbf37..385af34 100644
--- a/.jenkins.d/README.md
+++ b/.jenkins.d/README.md
@@ -1,28 +1,36 @@
-# CONTINUOUS INTEGRATION SCRIPTS
+# Continuous Integration Scripts
-## Environment Variables Used in Build Scripts
+## Environment Variables
-- `NODE_LABELS`: space-separated list of platform properties. The included values are used by
- the build scripts to select the proper behavior for different operating systems and versions.
+- `ID`: lower-case string that identifies the operating system, for example: `ID=ubuntu`,
+ `ID=centos`. See [os-release(5)] for more information. On macOS, where `os-release` is
+ not available, we emulate it by setting `ID=macos`.
- The list should normally contain `[OS_TYPE]`, `[DISTRO_TYPE]`, and `[DISTRO_VERSION]`.
+- `ID_LIKE`: space-separated list of operating system identifiers that are closely related
+ to the running OS. See [os-release(5)] for more information. The listed values are used
+ by the CI scripts to select the proper behavior for different platforms and OS flavors.
- Example values:
+ Examples:
- - `[OS_TYPE]`: `Linux`, `OSX`
- - `[DISTRO_TYPE]`: `Ubuntu`, `CentOS`
- - `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`, `CentOS-8`, `OSX-10.14`, `OSX-10.15`
+ - On CentOS, `ID_LIKE="centos rhel fedora linux"`
+ - On Ubuntu, `ID_LIKE="ubuntu debian linux"`
-- `JOB_NAME`: optional variable that defines the type of build job. Depending on the job type,
- the build scripts can perform different tasks.
+- `VERSION_ID`: identifies the operating system version, excluding any release code names.
+ See [os-release(5)] for more information. Examples: `VERSION_ID=42`, `VERSION_ID=22.04`.
- Possible values:
+- `JOB_NAME`: defines the type of the current CI job. Depending on the job type, the CI
+ scripts can perform different tasks.
+
+ Supported values:
- empty: default build task
- - `code-coverage`: debug build with tests and code coverage analysis (Ubuntu Linux is assumed)
+ - `code-coverage`: debug build with tests and code coverage analysis
- `limited-build`: only a single debug build with tests
-- `CACHE_DIR`: directory containing cached files from previous builds, e.g., a compiled version
- of ndn-cxx. If not set, `/tmp` is used.
+- `CACHE_DIR`: directory containing cached files from previous builds, e.g., a compiled
+ version of ndn-cxx. If not set, `/tmp` is used.
-- `WAF_JOBS`: number of parallel build threads used by waf, defaults to 1.
+- `DISABLE_ASAN`: disable building with AddressSanitizer. This is automatically set for
+ the `code-coverage` job type.
+
+[os-release(5)]: https://www.freedesktop.org/software/systemd/man/os-release.html
diff --git a/.jenkins.d/util.sh b/.jenkins.d/util.sh
deleted file mode 100644
index 8077a74..0000000
--- a/.jenkins.d/util.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-has() {
- local saved_xtrace
- [[ $- == *x* ]] && saved_xtrace=-x || saved_xtrace=+x
- set +x
-
- local p=$1
- shift
- local i ret=1
- for i in "$@"; do
- if [[ "${i}" == "${p}" ]]; then
- ret=0
- break
- fi
- done
-
- set ${saved_xtrace}
- return ${ret}
-}
-export -f has
-
-sudo_preserve_env() {
- local saved_xtrace
- [[ $- == *x* ]] && saved_xtrace=-x || saved_xtrace=+x
- set +x
-
- local vars=()
- while [[ $# -gt 0 ]]; do
- local arg=$1
- shift
- case ${arg} in
- --) break ;;
- *) vars+=("${arg}=${!arg}") ;;
- esac
- done
-
- set ${saved_xtrace}
- sudo env "${vars[@]}" "$@"
-}
-export -f sudo_preserve_env
diff --git a/.waf-tools/boost.py b/.waf-tools/boost.py
index 4b2ede5..a6cdabe 100644
--- a/.waf-tools/boost.py
+++ b/.waf-tools/boost.py
@@ -54,8 +54,8 @@
from waflib.Configure import conf
from waflib.TaskGen import feature, after_method
-BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib']
-BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include']
+BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/homebrew/lib', '/opt/local/lib', '/sw/lib', '/lib']
+BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/homebrew/include', '/opt/local/include', '/sw/include']
BOOST_VERSION_FILE = 'boost/version.hpp'
BOOST_VERSION_CODE = '''
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 7c6d282..3ba2dc3 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -33,7 +33,7 @@
'The minimum supported clang version is 6.0.')
conf.flags = ClangFlags()
else:
- warnmsg = '%s compiler is unsupported' % cxx
+ warnmsg = f'{cxx} compiler is unsupported'
conf.flags = CompilerFlags()
if errmsg:
@@ -200,7 +200,8 @@
flags = super(ClangFlags, self).getGeneralFlags(conf)
if Utils.unversioned_sys_platform() == 'darwin':
# Bug #4296
- flags['CXXFLAGS'] += [['-isystem', '/usr/local/include'], # for Homebrew
+ brewdir = '/opt/homebrew' if platform.machine() == 'arm64' else '/usr/local'
+ flags['CXXFLAGS'] += [['-isystem', f'{brewdir}/include'], # for Homebrew
['-isystem', '/opt/local/include']] # for MacPorts
elif Utils.unversioned_sys_platform() == 'freebsd':
# Bug #4790
diff --git a/docs/INSTALL.rst b/docs/INSTALL.rst
index d66d59f..71bc478 100644
--- a/docs/INSTALL.rst
+++ b/docs/INSTALL.rst
@@ -7,26 +7,28 @@
Prerequisites
-------------
-- `NFD <https://named-data.net/doc/NFD/>`_ and its dependencies
+- `NFD <https://named-data.net/doc/NFD/>`_ and its dependencies
-Refer to `Getting started with NFD <https://named-data.net/doc/NFD/current/INSTALL.html>`_
-for detailed installation and running instruction.
+ Refer to `Getting started with NFD <https://named-data.net/doc/NFD/current/INSTALL.html>`_
+ for detailed installation and running instruction.
-- PSync library
+- PSync library
-Download the PSync library and build it according to the instructions available at
-https://github.com/named-data/PSync#build
+ Download the PSync library and build it according to the instructions available at
+ https://github.com/named-data/PSync#build
-- [Optional] ChronoSync library
+- [Optional] ChronoSync library
-For testing purposes, NLSR can be optionally built with Chronosync support.
-Download the ChronoSync library and build it according to the instructions available at
-https://github.com/named-data/ChronoSync#build
+ For testing purposes, NLSR can be optionally built with Chronosync support. Download
+ the ChronoSync library and build it according to the instructions available at
+ https://github.com/named-data/ChronoSync#build
Build
-----
-Execute the following commands to build NLSR::
+Execute the following commands to build NLSR:
+
+.. code-block:: sh
./waf configure
./waf
@@ -35,8 +37,10 @@
Refer to ``./waf --help`` for more options that can be used during the configure stage and
how to properly configure NLSR.
-If your pkgconfig path is not set properly you can do the following before running ``./waf
-configure``::
+If your pkgconfig path is not set properly, you can do the following before running ``./waf
+configure``:
+
+.. code-block:: sh
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
# or
@@ -44,4 +48,6 @@
If ChronoSync support is desired, NLSR needs to be configured with the following option:
- ./waf configure --with-chronosync
+.. code-block:: sh
+
+ ./waf configure --with-chronosync
diff --git a/docs/beginners-guide.rst b/docs/beginners-guide.rst
index 8cc7e99..a41c6d8 100644
--- a/docs/beginners-guide.rst
+++ b/docs/beginners-guide.rst
@@ -17,9 +17,9 @@
The following instructions are based on the information provided at the
Named Data Networking project web page [NDNmain]_.
-Before installing NLSR it is necessary to install different libraries
-and programs: ndn-cxx, NFD, ChronoSync [optional], and PSync. This document describes the
-necessary steps to correctly install these programs (§ `2 <#ndncxx>`__,
+Before installing NLSR it is necessary to install different libraries and
+programs: ndn-cxx, NFD, ChronoSync [optional], and PSync. This document describes
+the necessary steps to correctly install these programs (§ `2 <#ndncxx>`__,
`3 <#nfd>`__ and `4 <#nlsr>`__) and a brief guide on how to configure
and test NLSR using a simple two-node network (§ `5 <#test>`__).
@@ -32,7 +32,7 @@
$ sudo -i
-And then using the *passwd* command to set up a password. After setting
+And then using the ``passwd`` command to set up a password. After setting
up the root user, it is possible to become root by employing the
following command and providing the root password when prompted:
@@ -40,7 +40,7 @@
$ su -
-Fedora employs the *dnf* command to install and verify installed
+Fedora employs the ``dnf`` command to install and verify installed
packages. The following commands may become useful during the
installation process and should be executed as root:
@@ -75,7 +75,7 @@
programs may get installed. The name of this directory is not important.
However, the following are provided as suggestions: project, NDNproject,
NDNprograms. Each of the programs in the following sections should be
-downloaded to their own directory using the *git* command, and then
+downloaded to their own directory using the ``git`` command, and then
compiled in this directory.
.. _ndncxx:
@@ -88,7 +88,7 @@
An updated list of the packages and programs that need to be installed
before installing ndn-cxx, is provided at [NDN-cxx]_.
-This list is also reproduced bellow with the commands to verify that all
+This list is also reproduced below with the commands to verify that all
the packages have been installed in the system. The following commands
should be run as root:
@@ -99,24 +99,22 @@
$ dnf list --installed gcc
$ dnf list --installed gcc-c++
-#. Python version 2.6 or later
+#. Python version 3.6 or later
::
- $ python -V
+ $ python3 -V
-#. libsqlite3
+#. SQLite 3.x
::
- $ dnf list --installed sqlite
$ dnf list --installed sqlite-devel
-#. openssl version 1.0.1 or later
+#. OpenSSL version 1.1.1 or later
::
- $ openssl version
$ dnf list --installed openssl-devel
#. pkgconf that replaces pkg-config
@@ -125,73 +123,47 @@
$ dnf list --installed pkgconf*
-#. boost libraries version 1.54 or later
+#. Boost libraries version 1.65.1 or later
::
- $ dnf list --installed boost
$ dnf list --installed boost-devel
-#. doxygen
+#. git
+
+ ::
+
+ $ dnf list --installed git
+
+#. doxygen (optional)
::
$ dnf list --installed doxygen
-#. graphviz
+#. graphviz (optional)
::
$ dnf list --installed graphviz
-#. python2-sphinx that replaces python-sphinx
+#. python3-pip (optional)
::
- $ dnf list --installed python2-sphinx
+ $ dnf list --installed python3-pip
-#. After verifying that the python-sphinx package has been installed, it
- is necessary to run the following two commands:
+#. After verifying that the python3-pip package has been installed, it
+ is necessary to run the following command:
::
- $ pip-3 install sphinxcontrib-doxylink
- $ pip install sphinxcontrib-googleanalytics
-
- Note: When the two previous commands are run before correctly
- installing python-sphinx, the following error message is produced
- when trying to install this latter package: “Error unpacking rpm
- package python2-urllib3-1.22-3.fc27.noarch”. To fix this problem, it
- is necessary to run the following commands before installing
- python-sphinx again:
-
- ::
-
- $ dnf remove python2-sphinx
- $ pip uninstall sphinxcontrib-googleanalytics
- $ pip-3 uninstall sphinxcontrib-doxylink
- $ pip uninstall urllib3
-
-#. dpkg-architecture
-
- ::
-
- $ dnf list --installed dpkg
- $ dnf list --installed dpkg-dev
-
-#. git and valgrind, which is used when installing NFD (§
- `3 <#nfd>`__).
-
- ::
-
- $ dnf list --installed valgrind
- $ dnf list --installed valgrind-devel
- $ dnf list --installed git
+ $ pip install sphinx sphinxcontrib-doxylink
2.2 Downloading and installing ndn-cxx
--------------------------------------
-The *git* command allows to download the ndn-cxx library in its own
+The ``git`` command allows to download the ndn-cxx library in its own
folder, also called *ndn-cxx*. Therefore it is recommended to execute
this command at the directory created at § `1 <#intro>`__:
@@ -214,7 +186,7 @@
$ ./waf configure --with-examples
Compile the ndn-cxx library and install the compiled files at the
-system’s directories:
+system's directories:
::
@@ -248,8 +220,7 @@
::
- $ echo export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig >>
- /etc/profile.d/ndn.sh
+ $ echo export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig >> /etc/profile.d/ndn.sh
After this command has been executed, it is necessary to apply the
changes by either logging out and back in, and then running the
@@ -281,17 +252,16 @@
before NFD is provided at [NDNNFD]_. Before installing
NFD it is necessary to verify that the following packages are installed:
-#. libpcap libraries
+#. pcap library
::
- $ dnf list --installed libpcap
$ dnf list --installed libpcap-devel
3.2 Downloading and installing NFD
----------------------------------
-This library is downloaded and installed in a folder called *NFD*, which
+This software is downloaded and installed in a folder called *NFD*, which
should be created at the directory defined at § `1 <#intro>`__. The
following commands need to be run as a regular user:
@@ -303,25 +273,15 @@
If the previous command prints an error message saying that waf cannot
find WebSocket, it is necessary to follow the instructions provided by
-this same output, which tells the user to execute either of the
-following two set of commands:
+this same output, which tells the user to run the following command:
::
- $ git submodule init && git submodule update
+ $ git submodule update --init
-Or:
-
-::
-
- $ mkdir websocketpp
- $ curl -L https://github.com/zaphoyd/websocketpp/archive/0.7.0.tar.gz
- > websocket.tar.gz
- $ tar zxf websocket.tar.gz -C websocketpp/ --strip 1
-
-After executing either of these instructions, complete the configuration
-by running *./waf configure* again. Then complete the installation by
-means of the following commands:
+After executing these instructions, complete the configuration by running
+``./waf configure`` again. Then complete the installation by means of the
+following commands:
::
@@ -337,7 +297,7 @@
$ cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
-After the configuration file has been created, NFD’s behavior may be
+After the configuration file has been created, NFD's behavior may be
changed by modifying this file. Once the configuration file has been
created, it is recommended to start NFD by using the following command:
@@ -348,7 +308,7 @@
This command does not properly allow to employ the command window to
enter new commands; however it displays the NFD logs. Therefore, it is
recommended to open a new command window. This second window may be used
-to verify NDF’s status and then stop NFD by using the following
+to verify NDF's status and then stop NFD by using the following
commands:
::
@@ -583,10 +543,10 @@
router2. *Figure 2* shows this
configuration. For router1, the twelve steps described before need to be
executed except for exchanging files between computers. For the router2,
-only steps 10 to 12 are needed to generate this router’s certificate.
+only steps 10 to 12 are needed to generate this router's certificate.
Additionally, the following command may be used to print a list and a
-brief description of all the *ndnsec* commands:
+brief description of all the ``ndnsec`` commands:
::
@@ -614,12 +574,12 @@
configure the network addresses and cards for all the computers in the
network. It is important to remember that computers that are connected
to each other should use the same subnetwork address. It is possible to
-verify the network configuration in a Linux computer by means of the *ip
-addr* command
+verify the network configuration in a Linux computer by means of the
+``ip addr`` command.
Once the physical network and network cards have been configured, it is
necessary to verify that the computers can communicate with each other.
-The simplest way to do this is by using the *ping* command:
+The simplest way to do this is by using the ``ping`` command:
::
@@ -629,7 +589,7 @@
--------------------------------
To start and configure NFD it is necessary to open two terminal windows.
-The first one will be used to start NFD by means of the *nfd-start*
+The first one will be used to start NFD by means of the ``nfd-start``
command. This terminal will also display the logs that NFD generates. By
default, NFD only generates informational logs (INFO). However, it is
possible to obtain different levels of verbosity for these logs. These
@@ -653,7 +613,7 @@
$ nfdc face create udp4://<remote-ip-address>
-The face id may be displayed by running either *nfd-status* or:
+The face id may be displayed by running:
::
@@ -677,7 +637,7 @@
-------------------------------------
Instructions on how to use the configuration file are already provided
-at the NLSR’s Router Configuration page [NLSRrtrconf]_.
+at the NLSR's Router Configuration page [NLSRrtrconf]_.
Read the information in this page to understand NLSR router
configuration. The following text describes the instructions that have
been modified at the default nlsr.conf file for router1:
@@ -818,19 +778,19 @@
$ nlsr -f <configuration-file>
However, to verify what is NLSR doing, it becomes necessary to employ
-NLSR’s logging facility [NLSRstarting]_. A brief
-description on how to use NDN’s logging facility may be displayed by
-entering the *man ndn-log* command. This guide recommends using one of
-the following two instructions to start NLSR:
+NLSR's logging facility [NLSRstarting]_. A brief
+description on how to use NDN's logging facility may be displayed by
+entering the ``man ndn-log`` command. This guide recommends using one
+of the following two instructions to start NLSR:
::
$ export NDN_LOG=nlsr.*=TRACE && nlsr
- $ export NDN_LOG=nlsr.*=TRACE && nlsr -f <configuration-file>
+ $ export NDN_LOG=nlsr.*=TRACE && nlsr -f <configuration-file>
-The second terminal window may be used to run *nfd-status* again and it
-should be possible to verify that the status has changed, specially at
-the FIB and RIB sections of the generated report.
+The second terminal window may be used to run ``nfd-status`` again and
+it should be possible to verify that the status has changed, specially
+at the FIB and RIB sections of the generated report.
.. _turn_off:
@@ -857,7 +817,7 @@
$ nfd-stop
-#. The crossover Ethernet cable may be unplugged and the computers’
+#. The crossover Ethernet cable may be unplugged and the computers'
network configuration restored to its original settings.
5.7 Where to go from here
@@ -880,13 +840,13 @@
.. [NDNNFDusage] *NFD usage*, http://named-data.net/doc/NFD/current/manpages/nfd.html, May 2018.
-.. [Chronosync] Z. Zhu and A. Afanasyev. *Let’s ChronoSync: Decentralized dataset state synchronization in Named Data Networking*, in IEEE ICNP, October 2013.
+.. [Chronosync] Z. Zhu and A. Afanasyev. *Let's ChronoSync: Decentralized dataset state synchronization in Named Data Networking*, in IEEE ICNP, October 2013.
.. [PSync] M. Zhang, V. Lehman, and L. Wang. *Scalable Name-based Data Synchronization for Named Data Networking*, in IEEE INFOCOM, May 2017.
.. [NLSRsecconf] *NLSR Security Configuration*, http://named-data.net/doc/NLSR/current/SECURITY-CONFIG.html June 2018.
-.. [NLSRdevguide] V. Lehman, M. Chowdhury, N. Gordon, A. Gawande. *NLSR Developer’s Guide*, University of Memphis, November 2017.
+.. [NLSRdevguide] V. Lehman, M. Chowdhury, N. Gordon, A. Gawande. *NLSR Developer's Guide*, University of Memphis, November 2017.
.. [NLSRrtrconf] *NLSR Router Configuration*, http://named-data.net/doc/NLSR/current/ROUTER-CONFIG.html, April 2018.
diff --git a/wscript b/wscript
index b223288..a574ada 100644
--- a/wscript
+++ b/wscript
@@ -46,7 +46,12 @@
conf.env.WITH_TESTS = conf.options.with_tests
- conf.find_program('dot', var='DOT', mandatory=False)
+ conf.find_program('dot', mandatory=False)
+
+ # Prefer pkgconf if it's installed, because it gives more correct results
+ # on Fedora/CentOS/RHEL/etc. See https://bugzilla.redhat.com/show_bug.cgi?id=1953348
+ # Store the result in env.PKGCONFIG, which is the variable used inside check_cfg()
+ conf.find_program(['pkgconf', 'pkg-config'], var='PKGCONFIG')
pkg_config_path = os.environ.get('PKG_CONFIG_PATH', f'{conf.env.LIBDIR}/pkgconfig')
conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.0', '--cflags', '--libs'],