frr icon indicating copy to clipboard operation
frr copied to clipboard

libjson-c.so.5: cannot open shared object file: No such file or directory

Open sakthishanmugam02 opened this issue 3 years ago • 1 comments

Describe the bug

In RedHat 8

lib/clippy: error while loading shared libraries: libjson-c.so.5: cannot open shared object file: No such file or directory
make[1]: *** [Makefile:17634: lib/filter_cli_clippy.c] Error 127
make[1]: Leaving directory '/root/frr'
make: *** [Makefile:6369: all] Error 2

sakthishanmugam02 avatar Aug 09 '22 11:08 sakthishanmugam02

@ton31337 please help

sakthishanmugam02 avatar Aug 09 '22 13:08 sakthishanmugam02

Do you have json-c-devel installed?

ton31337 avatar Aug 10 '22 14:08 ton31337

@ton31337 I was able to package RedHAT and successfully install FRR -

Here is the steps for future references - if it is required for someone

Install all dependencies to build FRR and packaging rpms

yum install rpm-build net-snmp-devel pam-devel libcap-devel python3-devel python3-sphinx platform-python-devel git libtool readline-devel wget flex cmake c-ares-devel systemd-devel texinfo json-c-devel pcre2-devel bison byacc libssh-devel -y

Install pre-requisite for FRR test [optional - if not done, you might see some warnings during compilation]

pip3 install pytest

Libyang is another dependencies - by default RedHAT repositories does not have latest version; FRR depends on this library version > 2.x

So download the RPMs from the repo, and install manually - if you use yum, you will see compilation error due to version mismatch

Create a folder and download RPMs

mkdir libyang && cd libyang

wget https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-2.0.7-1.el8.x86_64.rpm

wget https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-debuginfo-2.0.7-1.el8.x86_64.rpm

wget https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-debugsource-2.0.7-1.el8.x86_64.rpm

wget https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-devel-2.0.7-1.el8.x86_64.rpm

wget https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-tools-2.0.7-1.el8.x86_64.rpm

wget https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-tools-debuginfo-2.0.7-1.el8.x86_64.rpm

wget https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-2.0.7-1.el8.x86_64.rpm

Install using libyang package using rpm command

rpm -ivh libyang2-debuginfo-2.0.7-1.el8.x86_64.rpm

rpm -ivh libyang2-debugsource-2.0.7-1.el8.x86_64.rpm

rpm -ivh libyang2-tools-debuginfo-2.0.7-1.el8.x86_64.rpm

rpm -ivh libyang2-2.0.7-1.el8.x86_64.rpm

rpm -ivh libyang2-devel-2.0.7-1.el8.x86_64.rpm

rpm -ivh libyang2-tools-2.0.7-1.el8.x86_64.rpm

cd

Another library dependencies that requires manual installation is librtr

mkdir librtr && cd librtr

wget https://ci1.netdef.org/browse/RPKI-RTRLIB-147/artifact/shared/RedHat-8-x86_64-Packages/#:~:text=librtr%2D0.8.0%2D1.el8.src.rpm

wget https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-147/RedHat-8-x86_64-Packages/librtr-0.8.0-1.el8.x86_64.rpm

wget https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-147/RedHat-8-x86_64-Packages/librtr-devel-0.8.0-1.el8.x86_64.rpm

wget https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-147/RedHat-8-x86_64-Packages/librtr-doc-0.8.0-1.el8.noarch.rpm

wget https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-147/RedHat-8-x86_64-Packages/rtr-tools-0.8.0-1.el8.x86_64.rpm

Install the librtr package using rpm command

rpm -ivh *.rpm

cd

Now, we are ready for FRR installation, clone the repo

git clone https://github.com/frrouting/frr.git frr

cd frr

export LC_ALL=en_US.UTF-8

export LANG=en_US.UTF-8

Prepare for compilation

./bootstrap.sh

./configure --with-pkg-extra-version=-MyRPMVersion

make dist

Make RPMs

mkdir rpmbuild mkdir rpmbuild/SOURCES mkdir rpmbuild/SPECS cp redhat/.spec rpmbuild/SPECS/ cp frr.tar.gz rpmbuild/SOURCES/

Edit the FRR spec as required; default FPM is enabled as per this config - if required EDIT, otherwise skip it

rpmbuild/SPECS/frr.spec

Build RPMs

rpmbuild --define "_topdir pwd/rpmbuild" -ba rpmbuild/SPECS/frr.spec

You should have RPMs in rpmbuild/RPMS/x86_64/ path, install using rpm command

rpm -ivh *.rpm

Edit the /etc/frr/daemons to enable bgpd

bgpd=yes [from no]

Start the FRR daemon

systemctl start frr

Check the status of FRR

systemctl status frr

sakthishanmugam02 avatar Aug 10 '22 17:08 sakthishanmugam02

Thanks @ton31337

sakthishanmugam02 avatar Aug 10 '22 17:08 sakthishanmugam02

@ton31337 Now I am looking for some references to listen to route change events using FPM and sends the routes information to our remote data plane - any references to that?

sakthishanmugam02 avatar Aug 10 '22 17:08 sakthishanmugam02

Let's get back to https://github.com/FRRouting/frr/discussions/11746

ton31337 avatar Aug 10 '22 17:08 ton31337