libnetconf2 icon indicating copy to clipboard operation
libnetconf2 copied to clipboard

make install of library

Open masif-cs opened this issue 6 years ago • 16 comments

Hi,

I am compiling libnetconf2, but I dont want to make install all depenedent libraries like cmocka, libssh, openssl etc. What I am trying it cmake and make of dependent libraries and directly give the path to CMakelist.txt file, so that it picks directly from folder instead of /usr/bin/ etc folders.

But I am getting following error:

CMake Error at CMakeLists.txt:208 (find_package): Could not find a package configuration file provided by "LibSSH" (requested version 0.7.0) with any of the following names:

LibSSHConfig.cmake
libssh-config.cmake

Add the installation prefix of "LibSSH" to CMAKE_PREFIX_PATH or set "LibSSH_DIR" to a directory containing one of the above files. If "LibSSH" provides a separate development package or SDK, be sure it has been installed.

Could you please help me fixing this issue?

masif-cs avatar Nov 28 '19 06:11 masif-cs

Hi, what are the parameters you are giving CMake for it to find your libraries?

Regards, Michal

michalvasko avatar Nov 28 '19 13:11 michalvasko

Hi,

I was able to solve some of the issue. Below are the details what actually I am trying to achieve and what problem I am facing.

I want to install each of the libraries like libssh, libyang, libnetconf etc in specific directory instead of /usr/local/. I already installed libssh, libyang,cmocka in directory /home/masif/. I have specified paths in all CMakeModules/Find*.cmake scripts to pick up from /home/masif/. But now while I make libnetconf I am getting following error.

-- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version "1.0.2k") -- Found LibSSH: /vobs/nr_5g/ran_3rdparty/oss/netconf/libssh/bin/usr/local/lib64/ (Required is at least version "0.7.0") -- Performing Test HAVE_LIBSSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES -- Performing Test HAVE_LIBSSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES - Failed -- Found Doxygen: /usr/bin/doxygen (found version "1.8.5") -- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1")

I can see all paths are correct. But it is trying to find libssh.h and inside that legacy.h which it is not able to fine. So above error is coming. Can you please help me fixing this?

masif-cs avatar Dec 02 '19 10:12 masif-cs

Hi, this CMake command is used so you can customize it to find the include files.

Regards, Michal

michalvasko avatar Dec 02 '19 10:12 michalvasko

Hi,

Thanks for all your help. I was able to compile and install all libraries at my specific location. But I have one problem now, I am not able to uninstall from my specific location. It normally goes to /usr/local/ to uninstall. Can you please add some fix for this?

masif-cs avatar Dec 03 '19 06:12 masif-cs

Hi, what do you mean it normally goes to /usr/local? What uninstall does is just take the install_manifest.txt, where all the installed files with their absolute paths should be included and removes them all, that is what the CMake module does.

Regards, Michal

michalvasko avatar Dec 03 '19 07:12 michalvasko

Hi,

I compiled all the libraries in CMAKE_BUILD_TYPE=Release and installed it at predefined location using command "make install DESTDIR=/vobs/nr_5g/ran_3rdparty/oss/netconf/bin/" and placed into cloud for execution. I am trying to install yang models using below command /usr/bin/setup.sh /usr/local/bin/sysrepoctl /etc/sysrepo/yang/ root I am getting following error:

[ERR]: Locking a mutex failed (sr_shmmain_lock_remap: Connection timed out). sysrepoctl error: Failed to connect (Timeout expired)

I tried starting netopeer2-server using below command: netopeer2-server -d -v 2 I am getting following error: [ERR]: SR: Locking a mutex failed (sr_shmmain_lock_remap: Connection timed out). [ERR]: NP: Connecting to sysrepo failed (Timeout expired). [ERR]: NP: Server init failed. [INF]: NP: Server terminated.

Can you please help me solving problem?

masif-cs avatar Dec 04 '19 10:12 masif-cs

Hi, you have an old sysrepo version and its shared memory is broken. Update sysrepo and then run make sr_clean. Then this command should succeed.

Regards, Michal

michalvasko avatar Dec 04 '19 10:12 michalvasko

Hi,

I am using 1.3.15 version of sysrepo. I tried again cleaning everything by doing "rm -rf *" of build directory of sysrepo and then installing it again. Still I am getting same error.

masif-cs avatar Dec 04 '19 10:12 masif-cs

Hi,

Now I am able to install all yang modules but I am not able to verify whether it got install properly, because files are coming empty when I run command sysrepocfg --edit=vim -m ietf-keystore sysrepocfg --edit=vim -m ietf-truststore sysrepocfg --edit=vim -m ietf-netconf-server Normally I get some data like which port to listen, tls/ssh etc.

Even when I am running netopeer2-server -d -v 2, I am getting following error: [ERR]: SR: Data provider subscription for "ietf-netconf-monitoring" on "/ietf-netconf-monitoring:netconf-state" already exists. [ERR]: NP: Subscribing for providing "ietf-netconf-monitoring" state data failed (Invalid argument). [ERR]: NP: Server data subscribe failed. [WRN]: SR: Cleaning up after a non-existent sysrepo client with PID 69847. [ERR]: SR: Internal error (/vobs/nr_5g/ran_3rdparty/oss/netconf/sysrepo/ver_devel/src/shm_main.c:946). [ERR]: NP: Sysrepo recover failed (Internal error). [INF]: NP: Server terminated.

masif-cs avatar Dec 04 '19 11:12 masif-cs

Hi, no, you need to execute make sr_clean, like I wrote before. It does not clean the build directory or anything like that, it reset sysrepo shared memory when it is broken. With the latest version it should not happen often, but still can.

So, please reset sysrepo again and then post the first command that does not work as expected. In the output it warns about a crashed client, can you provide some more information about that?

Regards, Michal

michalvasko avatar Dec 05 '19 08:12 michalvasko

Hi,

I did sr_clean. It was not working because i did make sr_clean in build system, but I had to do that in cloud to clear the shared memory. So it worked after that.

But I am still not clear about one thing. I installed all the yang models on cloud but when I run the command sysrepocfg --edit=vim -m ietf-keystore sysrepocfg --edit=vim -m ietf-truststore sysrepocfg --edit=vim -m ietf-netconf-server

I get empty xml files. Earlier it use to have default configuration like to run in ssh mode on port 830 n other stuffs. Am I missing something?

masif-cs avatar Dec 05 '19 09:12 masif-cs

Hi, right. Regarding the configuration files, how exactly did you install them on the target system? Their configuration is empty by default. For these models there are some startup data set by some scripts executed by netopeer2 make install command. Did you do that?

Regards, Michal

michalvasko avatar Dec 05 '19 09:12 michalvasko

Hi,

Thanks you for the help. Now I am able to load default configuration also. But I have one problem, whenever I do ungraceful shutdown/crash of netopeer2 server/cli or application, it starts throwing some shared memory lock issue. I have to do sr_clean which cleans up all installed yang models and configuration. I have to start fresh by doing make install of Netopeer. So is there any way to avoid that and start from where it was crashing.

masif-cs avatar Dec 11 '19 07:12 masif-cs

Hi, are you using the latest version 1.3.18 (SO 4.1.5)?

Regards, Michal

michalvasko avatar Dec 11 '19 08:12 michalvasko

Hi,

I am using sysrepo 1.3.15(SO 4.1.2)

masif-cs avatar Dec 11 '19 09:12 masif-cs

Okay, could you please post the steps and (-v3) output of the applications when the problem appears? Starting with make sr_clean.

Regards, Michal

michalvasko avatar Dec 11 '19 09:12 michalvasko