File: FAQ.md

package info (click to toggle)
libyang 0.16.105-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 14,544 kB
  • sloc: ansic: 96,743; xml: 9,300; cpp: 5,023; python: 1,637; java: 1,448; lex: 281; sh: 158; makefile: 72
file content (48 lines) | stat: -rw-r--r-- 2,060 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Frequently Asked Questions

__Q: error while loading shared libraries__

__A:__ libyang is installed into the directory detected by CMake's GNUInstallDirs
   function. However, when it is connected with the installation prefix, the
   target directory is not necessary the path used by the system linker. Check
   the linker's paths in `/etc/ld.so.conf.d/`. If the path where libyang is
   installed is already present, just make `ldconfig` to rebuild its cache:
```
# ldconfig
```
   If the path is not present, you can change the libyang installation prefix
   when running cmake, so the complete compilation and installation sequence is:
```
$ mkdir build; cd build
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
$ make
# make install
```
   or add the libyang's location to the linker paths in `/etc/ld.so.conf.d` and
   then run `ldconfig` to rebuild the linker cache.

__Q: yanglint(1) does not start and, but prints the following error messages:__
```
./yanglint
libyang[0]: Invalid keyword "type" as a child to "annotation". (path: /)
libyang[0]: Module "yang" parsing failed.
Failed to create context.
```

__A:__ To handle complex YANG extensions, libyang (and therefore yanglint(1))
   needs plugins. By default, the plugins are installed into the system path
   (next to the libyang library into the separate `libyang` subdirectory). If
   libyang was not installed, yanglint cannot find these plugins and it fails.
   If you do not want to install libyang, it is possible to specify path to the
   plugins via environment variable. The plugins can be found in the libyang
   build directory in `src/extensions/` subdirectory. So running yanglint(1)
   then can be made this way:
```
$ LIBYANG_EXTENSIONS_PLUGINS_DIR=`pwd`/src/extensions ./yanglint
```
   The same issue occurs for user types and the solution is the same except they
   are built in `src/user_types/` subdirectory and the path should be set with:
```
$ LIBYANG_USER_TYPES_PLUGINS_DIR=`pwd`/src/user_types
```
   However, user types are not required for yanglint(1) to run properly.