-
Notifications
You must be signed in to change notification settings - Fork 2
Install NDN dependencies on RHEL 7.9
These are instructions to install NDN-IND plus NFD-IND and sentinel-transport on Red Hat Enterprise Linux 7.9 .
Install Red Hat Enterprise Linux 7.9 from the Binary DVD or other media. (Hint: During installation, in "Network and Host Name", enable your ethernet port. It is much easier to do this during installation.)
When you log in to Red Hat, use the Subscription Manager to register so that you can use the yum package manager. (Use your Red Hat username, not your email address.)
The packages from the install DVD need to be updated. In a terminal, enter:
sudo yum upgrade -y
Reboot.
We need to upgrade the compiler.
In a terminal, enter:
sudo subscription-manager repos --enable rhel-7-server-devtools-rpms \
--enable rhel-7-server-optional-rpms \
--enable rhel-server-rhscl-7-rpms
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Install the basic dev tools, including gcc 11:
sudo -S -k yum install -y make git gitk sshpass scl-utils autoconf automake ninja-build \
openssl-devel devtoolset-11 llvm-toolset-11.0 python2-devel
Make clang 11 and gcc 11 toolset persist in new terminals:
echo "source scl_source enable devtoolset-11" >> ~/.bashrc
echo "source scl_source enable llvm-toolset-11.0" >> ~/.bashrc
Activate clang 11 and gcc 11 for this terminal:
source scl_source enable devtoolset-11
source scl_source enable llvm-toolset-11.0
Install cmake v3.22
cd ~
git clone https://github.com/Kitware/CMake/
cd CMake
git checkout v3.22.0
./bootstrap
make
sudo make install
Create the Operant directory structure:
sudo mkdir /opt/operant &> /dev/null
sudo mkdir /opt/operant/bin &> /dev/null
sudo mkdir /opt/operant/etc &> /dev/null
sudo mkdir /opt/operant/etc/cert &> /dev/null
sudo mkdir /opt/operant/etc/template &> /dev/null
sudo mkdir /opt/operant/log &> /dev/null
Add /opt/operant/bin and /usr/local/bin to the path in new terminals:
cat "PATH=/opt/operant/bin:/usr/local/bin:$PATH" >> ~/.bashrc
To install the NFD prerequisites, in a terminal, enter:
sudo yum install -y git openssl-devel sqlite-devel libpcap-devel python2-devel python3-devel zlib-devel bzip2-devel log4cxx-devel autoconf automake libtool
To set up PKG_CONFIG_PATH, enter:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig
To make the package configuration path persist in new terminals:
echo "export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig" >> ~/.bashrc
Link to Python 2:
sudo alternatives --install /usr/bin/python python /usr/bin/python2.7 2
sudo alternatives --install /usr/bin/python python /usr/bin/python3.6 1
sudo alternatives --config python
The version of Boost provided by yum is too old, so we need to build it. In a terminal, enter:
cd ~
wget https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.gz
tar xvfz boost_1_71_0.tar.gz
cd boost_1_71_0
./bootstrap.sh --with-toolset=clang --with-libraries=all
./b2
sudo ./b2 install
sudo ldconfig
Yum doesn't have Protobuf, so we need to build it. In a terminal, enter:
cd ~
git clone --recursive https://github.com/protocolbuffers/protobuf
cd protobuf
git checkout v3.15.0
./autogen.sh
CC=clang CXX=clang++ ./configure
make
sudo make install
sudo ldconfig
To build NDN-CXX, in a terminal, enter:
cd ~
git clone https://github.com/named-data/ndn-cxx
cd ndn-cxx
git checkout 5149350bb437201e59b5d541568ce86e91993034
./waf configure --check-cxx-compiler=clang++ --boost-includes=/usr/local/include --boost-libs=/usr/local/lib
./waf
sudo ./waf install
To build the patched version of NFD, in a terminal, enter:
cd ~
git clone --recursive https://github.com/operantnetworks/nfd-ind
cd nfd-ind
git checkout patched
./waf configure --check-cxx-compiler=clang++ --boost-includes=/usr/local/include --boost-libs=/usr/local/lib
./waf
sudo ./waf install
sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
To install the NDN-IND prerequisites, in a terminal, enter:
sudo yum install -y openssl-devel sqlite-devel
Ensure that the PKG_CONFIG_PATH update (in NFD Prerequisites) has been done.
The OpenSSL library from yum is OpenSSL 1.0. But NDN-IND needs ChaCha20 which is in OpenSLL 1.1, so we need to build it in a local directory. In a terminal, enter:
cd ~
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
tar xvf openssl-1.1.1g.tar.gz
cd openssl-1.1.1g
./config no-shared --prefix=$HOME/openssl --openssldir=$HOME/openssl
make
make install
This installs libcrypto.a in ~/openssl/lib. We build only the static library which will be statically linked into NDN-IND. But we need to rename it so that it doesn’t conflict with the OpenSSL 1.0 library in /usr/lib64 :
mv $HOME/openssl/lib/libcrypto.a $HOME/openssl/lib/libcrypto1_1.a
To build NDN-IND, first we need to remove the OpenSSL 1.0 include files in /usr/include/openssl:
sudo yum remove openssl-devel
To build NDN-IND, enter the following which includes configure options to use OpenSSL 1.1 in the local directory:
cd ~
git clone https://github.com/operantnetworks/ndn-ind
cd ndn-ind
CC=clang CXX=clang++ ./configure ADD_CFLAGS=-I$HOME/openssl/include ADD_CXXFLAGS=-I$HOME/openssl/include ADD_LDFLAGS=-L$HOME/openssl/lib
make
sudo make install
Now that NDN-IND is statically linked to OpenSSL 1.1 and installed, we restore the OpenSSL 1.0 include files in /usr/include/openssl which are needed by other packages.
sudo yum install openssl-devel
The usual library directories are not on the load path by default. The following needs to be run once to configure the system:
sudo sh -c "echo /usr/local/lib64 >> /etc/ld.so.conf"
sudo sh -c "echo /usr/local/lib >> /etc/ld.so.conf"
sudo ldconfig
If you get a compiler error like "g++ not found" or "strchr not found", remember that you need enter the special bash shell. See "Make clang 11 and gcc 11 toolset persist in new terminals" and "Activate clang 11 and gcc 11 for this terminal".
If you get an error like "libndn-cxx not found", remember that you need to update PKG_CONFIG_PATH. See "To set up PKG_CONFIG_PATH" and "To make the package configuration path persist in new terminals".
If you run an application and get an error that a library is not found, make sure you run the commands in the "ldconfig" section to add the library directories:
sudo ldconfig