cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2163
Views
10
Helpful
8
Replies

Can't Generate on Ubuntu 20.04

AidanE
Level 1
Level 1

I'm trying to run generate.py on Ubuntu 20.04, and I'm getting this error:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ssh_threads_location
linked by target "ydk" in directory /home/-snip-/Source/ydk-gen-0.8.5.2/gen-api/cpp/ydk

 Based on https://github.com/CESNET/libnetconf2/blob/master/CMakeModules/FindLibSSH.cmake I think that it's not necessary to link separately past LibSSH 0.8.0, is there a way to skip the requirement?

1 Accepted Solution

Accepted Solutions

Based on https://github.com/CiscoDevNet/ydk-gen/issues/826 I managed to make it compile by doing `sudo ln -s /usr/lib/x86_64-linux-gnu/libssh.so /usr/lib/x86_64-linux-gnu/libssh_threads.so`, I believe all that's needed to make it compile with modern libssh is to just skip that import on newer libssh versions.

View solution in original post

8 Replies 8

yangorelik
Spotlight
Spotlight

Hi Aidan

The cmake is looking for libssh_threads.so library, which is missing on your computer. The presence of this library is a requirement since 0.6.0, and it cannot be skipped. The library must be installed under /usr/local/lib. If it is not there (not sure how you managed to install YDK), then I would suggest repeat YDK installation:

sudo rm -f /usr/local/lib/libssh*
cd ydk-gen
./install_ydk.sh --core

That will install all dependencies including libssh.so and libssh_threads.so, C++ core library libydk.a, Python virtual environment, and Python core package.

If you have any issue with the installation, attach the console output for further analysis.

Yan Gorelik
YDK Solutions

Hi Yan,

      After a bit of googling, I've found that past version 0.8.0, released in August of 2018, LibSSH rolled libssh_threads into the main library. There's some discussion on it in these 2 links: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905910 https://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=1320. There've been security flaws fixed since then, is it impossible to compile YDK with these fixes? I'd prefer not to compromise everything I compile locally for the sake of one library. I'd also prefer a method of using YDK without installing it to my system, if possible. I suppose I could put it in a Docker container, that might also help with the security flaws? It's not a perfect solution though.
      Thanks,

            Aidan

Hi Aidan

The libssh and libssh_threads are the most challenging installation components, mainly because each platform has their own libraries implementation and dependencies. The older platforms like ubuntu:xenial and ubuntu:bionic use pre-0.8.0 versions, others - post-0.8.0. Currently it is all balanced for the YDK supported platforms, including ubuntu:focal, and it would be unreasonable to change that now. The libraries are used in libnetconf and libyang - third party software, which are very stable and reliable. I would not want to dive into and change unknown for me code.

At this point, if you follow installation guidelines, you should not have any YDK installation issues. The installation scripts will take care of all the dependencies including libssh and libssh_threads.

I also suggest you on YDK GitHub to open an issue for currently used libssh version 0.7.x libraries, which have known security vulnerabilities. Hopefully somebody will address this issue in the future.

Yan Gorelik
YDK Solutions

Based on https://github.com/CiscoDevNet/ydk-gen/issues/826 I managed to make it compile by doing `sudo ln -s /usr/lib/x86_64-linux-gnu/libssh.so /usr/lib/x86_64-linux-gnu/libssh_threads.so`, I believe all that's needed to make it compile with modern libssh is to just skip that import on newer libssh versions.

WOW!! Great solution. I will try to apply it in the next YDK release.

Yan Gorelik
YDK Solutions

A slightly cleaner solution you might also like to look at is libnetconf2's, they just include libssh_threads in findlibssh if it's older than 0.8.0: https://github.com/CESNET/libnetconf2/blob/master/CMakeModules/FindLibSSH.cmake

Hi Aidan

I followed your recommendations and tried the method on various platforms. It worked well on Centos 8. But on ubuntu:focal, although compilation passes, all the unit tests, which involve connection to confd (local Netconf server), are getting stalled on Netconf client connection to the server. In this regards I wonder if you ran any scripts, which actually connect to the Netconf server.

Thanks,

Yan Gorelik
YDK Solutions