Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help: I couldn't find a suitable libyang version for compile #63

Open
rockyrth opened this issue Nov 8, 2022 · 0 comments
Open

help: I couldn't find a suitable libyang version for compile #63

rockyrth opened this issue Nov 8, 2022 · 0 comments

Comments

@rockyrth
Copy link

rockyrth commented Nov 8, 2022

From README.md, we can see the follow description:
README.md
Install latest version of pyang tool.
Install libyang from https://github.com/CESNET/libyang along with its dependency.

But Unfortunately, I compile sonic-gnmi (https://github.com/sonic-net/sonic-gnmi) failed.

From the https://github.com/CESNET/libyang, we can see many version:
image

  1. I try libyang Version 2.0.231
    ① install libyang
    ubuntu@VM-40-95-ubuntu:/sonic-community/libyang-2.0.231 $ mkdir build; cd build
    mkdir: cannot create directory ‘build’: File exists
    ubuntu@VM-40-95-ubuntu:
    /sonic-community/libyang-2.0.231/build $ cmake ..
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/ubuntu/sonic-community/libyang-2.0.231/build
    ubuntu@VM-40-95-ubuntu:/sonic-community/libyang-2.0.231/build $ make
    [ 31%] Built target yangobj
    .......
    [100%] Built target yangre
    ubuntu@VM-40-95-ubuntu:
    /sonic-community/libyang-2.0.231/build $ sudo make install
    [ 31%] Built target yangobj
    .......
    [100%] Built target yangre
    Install the project...
    -- Install configuration: "Debug"
    -- Up-to-date: /usr/local/share/yang/modules/libyang
    -- Up-to-date: /usr/local/share/yang/modules/libyang/[email protected]
    -- Up-to-date: /usr/local/share/yang/modules/libyang/[email protected]
    -- Up-to-date: /usr/local/share/yang/modules/libyang/[email protected]
    -- Up-to-date: /usr/local/share/yang/modules/libyang/[email protected]
    -- Up-to-date: /usr/local/share/yang/modules/libyang/[email protected]
    -- Up-to-date: /usr/local/share/yang/modules/libyang/[email protected]
    -- Up-to-date: /usr/local/share/yang/modules/libyang/[email protected]
    -- Up-to-date: /usr/local/lib/libyang.so.2.22.4
    -- Up-to-date: /usr/local/lib/libyang.so.2
    -- Installing: /usr/local/lib/libyang.so
    -- Installing: /usr/local/include/libyang/context.h
    -- Installing: /usr/local/include/libyang/dict.h
    -- Installing: /usr/local/include/libyang/in.h
    -- Installing: /usr/local/include/libyang/libyang.h
    -- Installing: /usr/local/include/libyang/log.h
    -- Installing: /usr/local/include/libyang/out.h
    -- Installing: /usr/local/include/libyang/parser_data.h
    -- Installing: /usr/local/include/libyang/parser_schema.h
    -- Installing: /usr/local/include/libyang/plugins.h
    -- Installing: /usr/local/include/libyang/plugins_exts.h
    -- Installing: /usr/local/include/libyang/plugins_exts_compile.h
    -- Installing: /usr/local/include/libyang/plugins_exts_print.h
    -- Installing: /usr/local/include/libyang/plugins_types.h
    -- Installing: /usr/local/include/libyang/printer_data.h
    -- Installing: /usr/local/include/libyang/printer_schema.h
    -- Installing: /usr/local/include/libyang/set.h
    -- Installing: /usr/local/include/libyang/tree.h
    -- Installing: /usr/local/include/libyang/tree_data.h
    -- Installing: /usr/local/include/libyang/tree_edit.h
    -- Installing: /usr/local/include/libyang/tree_schema.h
    -- Installing: /usr/local/include/libyang/version.h
    -- Installing: /usr/local/include/libyang/config.h
    -- Installing: /usr/local/lib/pkgconfig/libyang.pc
    -- Installing: /usr/local/bin/yanglint
    -- Set runtime path of "/usr/local/bin/yanglint" to ""
    -- Installing: /usr/local/share/man/man1/yanglint.1
    -- Installing: /usr/local/bin/yangre
    -- Set runtime path of "/usr/local/bin/yangre" to ""
    -- Installing: /usr/local/share/man/man1/yangre.1

② complie sonic-gnmi, it failed
ubuntu@VM-40-95-ubuntu:~/sonic-community/sonic-gnmi (master)$ dpkg-buildpackage -rfakeroot -b -us -uc
......
ome/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:93: undefined reference to lyd_new_leaf' /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:109: undefined reference to lyd_validate_value'
/tmp/go-link-1722060546/000028.o: In function lyd_node_leafref_match_in_union': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:174: undefined reference to lyd_validate_value'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cmacro_ly_errno': /tmp/go-build/cgo-gcc-prolog:115: undefined reference to ly_errno_glob_address'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_ly_verb': /tmp/go-build/cgo-gcc-prolog:135: undefined reference to ly_verb'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_merge_to_ctx': /tmp/go-build/cgo-gcc-prolog:231: undefined reference to lyd_merge_to_ctx'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_new': /tmp/go-build/cgo-gcc-prolog:274: undefined reference to lyd_new'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_new_leaf': /tmp/go-build/cgo-gcc-prolog:295: undefined reference to lyd_new_leaf'
/tmp/go-link-1722060546/000028.o: In function lyd_parse_data_path': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:46: undefined reference to lyd_parse_path'
/tmp/go-link-1722060546/000028.o: In function lyd_parse_data_mem': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:51: undefined reference to lyd_parse_mem'
/tmp/go-link-1722060546/000028.o: In function lyd_data_validate': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:66: undefined reference to lyd_validate'
/tmp/go-link-1722060546/000028.o: In function lyd_change_leaf_data': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:193: undefined reference to lyd_change_leaf'
/tmp/go-link-1722060546/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_free_withsiblings': /tmp/go-build/cgo-gcc-prolog:211: undefined reference to lyd_free_withsiblings'
/tmp/go-link-1722060546/000030.o: In function ly_set_log_callback': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/util/util.go:37: undefined reference to ly_verb'
/home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/util/util.go:35: undefined reference to `ly_verb'
collect2: error: ld returned 1 exit status

  1. I try libyang-2.0.194, it failed to compile sonic-gnmi too.
    buntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:93: undefined reference to lyd_new_leaf' /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:109: undefined reference to lyd_validate_value'
    /tmp/go-link-3776435132/000028.o: In function lyd_node_leafref_match_in_union': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:174: undefined reference to lyd_validate_value'
    /tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cmacro_ly_errno': /tmp/go-build/cgo-gcc-prolog:115: undefined reference to ly_errno_glob_address'
    /tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_ly_verb': /tmp/go-build/cgo-gcc-prolog:135: undefined reference to ly_verb'
    /tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_merge_to_ctx': /tmp/go-build/cgo-gcc-prolog:231: undefined reference to lyd_merge_to_ctx'
    /tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_new': /tmp/go-build/cgo-gcc-prolog:274: undefined reference to lyd_new'
    /tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_new_leaf': /tmp/go-build/cgo-gcc-prolog:295: undefined reference to lyd_new_leaf'
    /tmp/go-link-3776435132/000028.o: In function lyd_parse_data_path': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:46: undefined reference to lyd_parse_path'
    /tmp/go-link-3776435132/000028.o: In function lyd_parse_data_mem': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:51: undefined reference to lyd_parse_mem'
    /tmp/go-link-3776435132/000028.o: In function lyd_data_validate': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:66: undefined reference to lyd_validate'
    /tmp/go-link-3776435132/000028.o: In function lyd_change_leaf_data': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/yparser/yparser.go:193: undefined reference to lyd_change_leaf'
    /tmp/go-link-3776435132/000028.o: In function _cgo_b9cfa1c2d0dc_Cfunc_lyd_free_withsiblings': /tmp/go-build/cgo-gcc-prolog:211: undefined reference to lyd_free_withsiblings'
    /tmp/go-link-3776435132/000030.o: In function ly_set_log_callback': /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/util/util.go:37: undefined reference to ly_verb'
    /home/ubuntu/sonic-community/sonic-gnmi/vendor/github.com/Azure/sonic-mgmt-common/cvl/internal/util/util.go:35: undefined reference to `ly_verb'

  2. I try libyang-1.0.225 it failed to compile sonic-gnmi too.

dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libyang.so.1 (used by debian/sonic-gnmi/usr/sbin/dialout_client_cli)
Hint: check if the library actually comes from a package.
dh_shlibdeps: dpkg-shlibdeps -Tdebian/sonic-gnmi.substvars debian/sonic-gnmi/usr/sbin/gnmi_cli debian/sonic-gnmi/usr/sbin/gnmi_get debian/sonic-gnmi/usr/sbin/gnmi_set debian/sonic-gnmi/usr/sbin/gnoi_client debian/sonic-gnmi/usr/sbin/dialout_client_cli returned exit code 255
dh_shlibdeps: Aborting due to earlier error
debian/rules:7: recipe for target 'binary' failed
make: *** [binary] Error 25
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2
ubuntu@VM-40-95-ubuntu:~/sonic-community/sonic-gnmi (master)$ ls -l /usr/local/lib/libyang.so.1
lrwxrwxrwx 1 root root 18 Nov 8 21:15 /usr/local/lib/libyang.so.1 -> libyang.so.1.10.17

I don't know how to install libyang for sonic-gnmi

@rockyrth rockyrth changed the title I couldn't find a suitable libyang version for compile help: I couldn't find a suitable libyang version for compile Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant