]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-libyang.rst
Merge pull request #4096 from donaldsharp/pim_nht_cleanup
[mirror_frr.git] / doc / developer / building-libyang.rst
1 FRR depends on the relatively new ``libyang`` library to provide YANG/NETCONF
2 support. Unfortunately, most distributions do not yet offer a ``libyang``
3 package from their repositories. Therefore we offer two options to install this
4 library.
5
6 **Option 1: Binary Install**
7
8 The FRR project builds binary ``libyang`` packages, which we offer for download
9 `here <https://ci1.netdef.org/browse/LIBYANG-YANGRELEASE/latestSuccessful/artifact>`_.
10
11 .. warning::
12
13 ``libyang`` version 0.16.74 or newer is required to build FRR.
14
15 .. note::
16
17 The ``libyang`` development packages need to be installed in addition to the
18 libyang core package in order to build FRR successfully. Make sure to
19 download and install those from the link above alongside the binary
20 packages.
21
22 Depending on your platform, you may also need to install the PCRE
23 development package. Typically this is ``libpcre-dev`` or ``pcre-devel``.
24
25 .. note::
26
27 For Debian-based systems, the official ``libyang`` package requires recent
28 versions of ``swig`` (3.0.12) and ``debhelper`` (11) which are only
29 available in Debian buster (10). However, ``libyang`` packages built on
30 Debian buster can be installed on both Debian jessie (8) and Debian stretch
31 (9), as well as various Ubuntu systems. The ``python3-yang`` package will
32 not work, but the other packages (``libyang-dev`` is the one needed for FRR)
33 will.
34
35 **Option 2: Source Install**
36
37 .. note::
38
39 Ensure that the `libyang build requirements
40 <https://github.com/CESNET/libyang/blob/master/README.md#build-requirements>`_
41 are met before continuing. Usually this entails installing ``cmake`` and
42 ``libpcre-dev`` or ``pcre-devel``.
43
44 .. code-block:: console
45
46 git clone https://github.com/CESNET/libyang.git
47 cd libyang
48 mkdir build; cd build
49 cmake -DENABLE_LYD_PRIV=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
50 make
51 sudo make install
52
53 When building ``libyang`` version ``0.16.x`` it's also necessary to pass the
54 ``-DENABLE_CACHE=OFF`` parameter to ``cmake`` to work around a
55 `known bug <https://github.com/CESNET/libyang/issues/752>`_ in libyang.
56