Comments (17)
Hi,
it is not enough to have nc_client.h
and nc_server.h
in libnetconf2 (repository) directory, you must install libnetconf2 using # make install
, then it should be found.
Regards,
Michal
from netopeer2.
It is cross compiled so we can not do make install
from netopeer2.
I see, it also seems that those headers are found by cmake, it only cannot find those 2 defines, but I don't see the rest of the log so I don't know for sure. Anyway, what you need is to have those headers in a location where cmake will find them. Then they should include a define for at least NC_ENABLED_SSH
, but that is added automatically during Makefile
generation (running cmake). You can also set the header location manually using cmake variables LIBNETCONF2_LIBRARIES
and LIBNETCONF2_INCLUDE_DIRS
.
Regards,
Michal
from netopeer2.
The issue is i have libnetconf2 generated lib which i am pointing to in findlibnetconf2.cmake with right path for
LIBNETCONF2_LIBRARIES & LIBNETCONF2_INCLUDE_DIRS
here is my .cmake file for libnetconf2
I have manually copied nc_client.h nc_server.h to these location
find_path(LIBNETCONF2_INCLUDE_DIR NAMES nc_client.h nc_server.h PATHS /mnt/local/rajnish.kumar/connector/FLOW_EFC-16.2-dev/3rdparty/libnetconf2/ NO_DEFAULT_PATH)
find_library(LIBNETCONF2_LIBRARY NAMES netconf2 libnetconf2 PATHS /mnt/local/rajnish.kumar/connector/FLOW_EFC-16.2-dev/6500/3rdparty/target/x86_64/libnetconf2/ NO_DEFAULT_PATH)
from netopeer2.
Full Log
- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for NC_ENABLED_SSH
-- Looking for NC_ENABLED_SSH - not found
-- Looking for NC_ENABLED_TLS
-- Looking for NC_ENABLED_TLS - not found
CMake Error at CMakeLists.txt:71 (message):
Missing SSH support in libnetconf2, server requires SSH to be supported.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23")
-- Found sysrepo: /mnt/local/rajnish.kumar/connector/FLOW_EFC-16.2-dev/MaestrOSCommon/mgmt-crd/ui/sysrepo/build/src/libsysrepo.so
-- Configuring incomplete, errors occurred!
from netopeer2.
You shouldn't modify any CMake Find modules, so I suggest you put FindLibNETCONF2.cmake
back how it was. Then, just like I mentioned, try running CMake defining those 2 variables. In detail:
- remove
CMakeCache.txt
from yournetopeer2/server
directory - run
cmake -DLIBNETCONF2_LIBRARIES="/mnt/local/rajnish.kumar/connector/FLOW_EFC-16.2-dev/6500/3rdparty/target/x86_64/libnetconf2/" -DLIBNETCONF2_INCLUDE_DIRS="/mnt/local/rajnish.kumar/connector/FLOW_EFC-16.2-dev/3rdparty/libnetconf2/" .
- then normally run
make
and hopefully it will work
Just to be safe, did you have any problem compiling libnetconf2, was actually SSH support compiled in?
Regards,
Michal
from netopeer2.
Hello Netopeer2 team,
I would like to reopen the issue. I am in a quite similar position and want to build the project in a non standard environment. Cmake is configured with following settings:
export CMAKE_PREFIX_PATH=/x/libyang/build/inst/usr/:/x/libnetconf2/build/inst/usr/:/opt/pcre-latest/:/x/sysrepo/build/inst/usr/:/x/libssh/build/inst/usr/
DIR=$(pwd)/inst
mkdir -p $DIR
export DESTDIR=$DIR
cmake --trace --debug-trycompile -DCMAKE_INSTALL_PREFIX="/usr"
-DCMAKE_VERBOSE_MAKEFILE=TRUE
-DCMAKE_POLICY_DEFAULT_CMP0056=NEW
-DCMAKE_POLICY_DEFAULT_CMP0066=NEW
../
The cmake error file point me to the error that although libyang is in the Prefix_Path the cmake module CheckSymbolExists.c is not finding it, because of the non standard include path. See following part of the error log:
Run Build Command:"/opt/make-latest/bin/make" "cmTC_0396f/fast"
/opt/make-latest/bin/make -f CMakeFiles/cmTC_0396f.dir/build.make CMakeFiles/cmTC_0396f.dir/build
make[1]: Entering directory '/x/Netopeer2/server/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_0396f.dir/CheckSymbolExists.c.o
/usr/bin/cc -I/x/libnetconf2/build/inst/usr/include -Wall -Wextra -std=gnu11 -lpthread -o CMakeFiles/cmTC_0396f.dir/CheckSymbolExists.c.o -c /x/Netopeer2/server/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
In file included from /x/libnetconf2/build/inst/usr/include/nc_client.h:32,
from /x/Netopeer2/server/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:
/x/libnetconf2/build/inst/usr/include/libnetconf2/session_client.h:22:10: fatal error: libyang/libyang.h: No such file or directory
#include <libyang/libyang.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_0396f.dir/build.make:66: CMakeFiles/cmTC_0396f.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/x/Netopeer2/server/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_0396f/fast] Error 2
File /x/Netopeer2/server/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
The trace of cmake showed me that libnetconf2 headers and libs were found.
See:
/x/Netopeer2/CMakeModules/FindLibNETCONF2.cmake(72): if(LIBNETCONF2_INCLUDE_DIR AND LIBNETCONF2_LIBRARY )
/x/Netopeer2/CMakeModules/FindLibNETCONF2.cmake(73): set(LIBNETCONF2_FOUND TRUE )
/x/Netopeer2/CMakeModules/FindLibNETCONF2.cmake(75): list(INSERT CMAKE_REQUIRED_INCLUDES 0 ${LIBNETCONF2_INCLUDE_DIR} )
/x/Netopeer2/CMakeModules/FindLibNETCONF2.cmake(76): check_symbol_exists(NC_ENABLED_SSH nc_client.h LIBNETCONF2_ENABLED_SSH )
/opt/cmake-3.13.4/share/cmake-3.13/Modules/CheckSymbolExists.cmake(52): if(CMAKE_C_COMPILER_LOADED )
/opt/cmake-3.13.4/share/cmake-3.13/Modules/CheckSymbolExists.cmake(53): __CHECK_SYMBOL_EXISTS_IMPL(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c NC_ENABLED_SSH nc_client.h LIBNETCONF2_ENABLED_SSH )
and the defines are there.
/x/libnetconf2/build/inst/usr/include/nc_client.h:
#ifndef NC_ENABLED_SSH
#define NC_ENABLED_SSH
#endif
#ifndef NC_ENABLED_TLS
#define NC_ENABLED_TLS
#endif
from netopeer2.
Hi,
okay, that makes sense. Could you please try the attached patch before I commit it? Thanks.
Regards,
Michal
from netopeer2.
with:
export CFLAGS="-I/x/libyang/build/inst/usr/include -I/x/libssh/build/inst/usr/include"
I was able to configure cmake with no errors. Should this not also work with setting prefix_path?
See:
https://cmake.org/cmake/help/latest/module/CheckSymbolExists.html
CMAKE_REQUIRED_INCLUDES
and
CMAKE_REQUIRED_LIBRARIES
from netopeer2.
Ah thx I'll try your patch.
from netopeer2.
libssh is still missing and must be added to the patch
from netopeer2.
Right, please try this one.
from netopeer2.
I still get following error:
Linking C executable cmTC_5261d
/opt/cmake-3.13.4/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5261d.dir/link.txt --verbose=1
/usr/bin/cc -Wall -Wextra -std=gnu11 -lpthread -rdynamic CMakeFiles/cmTC_5261d.dir/CheckSymbolExists.c.o -o cmTC_5261d -Wl,-rpath,/x/libyang/build/inst/usr/lib -lssh -lcrypt /x/libyang/build/inst/usr/lib/libyang.so
/opt/binutils-latest/bin/ld: cannot find -lssh
collect2: error: ld returned 1 exit status
from netopeer2.
Switching line:
list(APPEND CMAKE_REQUIRED_LIBRARIES ssh crypt)
to
list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBSSH_LIBRARIES} crypt)
worked for me
from netopeer2.
Hi,
yes, that worked because ${LIBSSH_LIBRARIES}
is empty and you actually do not need the library linked, you only need the header. However, I am trying to fix this properly so can you please try the hopefully final patch? Thanks. Still, I do not understand why the previous one did not work, the library is linked with its path so why does the linker fail to find it?
Regards,
Michal
from netopeer2.
Hi Michal,
thx a lot! The patch works as desired.
I think ld did not find it because the ssh directory was not submitted to the linker and the ssh files are also in the pre-staging dir /x/, instead of standard directories like /usr/lib. But I do not know why -L${LIBSSH_LIBRARY_DIR} does not do the job.
Old linker flags till patch two:
-Wl,-rpath,/x/libyang/build/inst/usr/lib -lssh -lcrypt /x/libyang/build/inst/usr/lib/libyang.so
With the final patch -lssh is replaced by:
-Wl,-rpath,/x/libssh/build/inst/usr/lib /x/libssh/build/inst/usr/lib/libssh.so
See following in the CMakeOutput.log:
-Wl,-rpath,/x/libssh/build/inst/usr/lib:/x/libyang/build/inst/usr/lib /x/libssh/build/inst/usr/lib/libssh.so -lcrypt /x/libyang/build/inst/usr/lib/libyang.so
from netopeer2.
Okay, I have committed the last patch then. It will probably still not work with libssh < 0.8.0 installed outside standard path because of an unknown reason but the rest of use-cases should now be fine.
Regards,
Michal
from netopeer2.
Related Issues (20)
- A potential mistake need to be tested and verified HOT 1
- Does netopeer-cli support public key based authentication HOT 4
- Cannot connect Server HOT 8
- Query on listing existing subscriptions HOT 15
- Query: any API to terminate the particular client's netconf session with particular user from application HOT 5
- New SSH server key added every time I trigger a call-home, not checking the known_host file. HOT 1
- Failed changing permissions of directory "/usr/lib64/netopeer2-server" (Read-only file system) HOT 2
- Unable to receive callback when trying to subscribe custom yang model using sr_oper_get_subscribe() HOT 1
- Delete subinterface and network-instance not working with netopeer2 HOT 5
- Error with TLS Call Home connection using netopeer2-cli HOT 2
- netopeer2-server dont open port in openwrt HOT 6
- Example configuration xml tags are not aligned with yang modules HOT 5
- The "apkg build" breaks due pam.de/netopeer2.conf path issue HOT 2
- After changing a user from public key auth to passwort auth, the user can still authenticate using the key HOT 2
- Setting both password and key auth leads to broken "two-factor" auth that requires the same factor twice HOT 4
- Mechanism for distinguishing notifications between multiple subscriptions HOT 2
- Timeout on large request leaves server in a broken state HOT 8
- ietf-netconf-server config correct ? HOT 2
- Failed to unlink SHM sub_ietf-subscribed-notifications.oper (No such file or directory) HOT 5
- Problem to keep the connection for ssh when using netopeer2 HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netopeer2.