CESNET / Netopeer-GUI

Graphical user interface for NETCONF client
MIT License
37 stars 9 forks source link

make failed - unknown type name ‘LIBSSH2_SESSION’ #92

Closed 0xADA5 closed 8 years ago

0xADA5 commented 8 years ago

Hello! Unfortunately, I have some trouble installing/compiling the Netopeer GUI. Executing 'make', I get this ( - more details below - ):

./mod_netconf.c:162:63: error: unknown type name ‘LIBSSH2_SESSION’

LIBSSH2_SESSION is defined in libssh2.h and is located in /usr/include/libssh2.h. ..but I can't find any 'include' within mod_netconf. However, I searched for 'includes':

grep -ir '#include.*libssh2.h' /usr/include/ => /usr/include/libssh2_sftp.h:#include "libssh2.h" => /usr/include/libssh2_publickey.h:#include "libssh2.h" (no match in /usr/local/include)

I compared the result with the 'Netopeer-Demo' and I found this:

`grep -ir '#include.*libssh2.h' /usr/include/`
=> `/usr/include/libssh2_sftp.h:#include "libssh2.h"`
=> `/usr/include/libssh2_publickey.h:#include "libssh2.h"`
=>` /usr/include/libnetconf/callbacks_ssh:#include <libssh2.h>`

(no match in /usr/local/include)

The 'include' seems to be modified (in my version of this file):

=> `/usr/include/libnetconf/callbacks_ssh:#include <libssh/libssh.h>`

I don't get it... I guess there is an error in my installation or something like that. Can anyone help, please!!! :/

( Please note: This issue might be a duplicate of: https://github.com/CESNET/Netopeer-GUI/issues/91 but adding '--without-notifications' does not effect my results. )

Further information concerning my comfiguration and my system:

System Info: Ubuntu 14.04.3 LTS (Oracle VM) - started with a 'fresh system' Architecture: i686 CPU op-mode(s): 32-bit, 64-bit


Previously...

  sudo -s
  apt-get update
  apt-get install subversion kate

I've installed/run the following components/commands:


apt-get install.. cmake apache2 apache2-dev libjson0-dev git libxml2-dev libxslt-dev g++ libssl-dev libcurl4-gnutls-dev libtool libexpat1-dev autoconf libssh2-1-dev libapr1 libapr1-dev libaprutil1-dev php5-common libapache2-mod-php5 php5-cli php5-mysql php5-intl xsltproc libaugeas-dev ssh python-setuptools libreadline6 libreadline6-dev


Install Libbewsocket 1.4


 wget http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/snapshot/libwebsockets-1.4-chrome43-firefox-36.tar.gz --directory-prefix=/tmp/libwebsockets
  cd /tmp/libwebsockets
  tar zxvf libwebsockets-1.4-chrome43-firefox-36.tar.gz
  cd /tmp/libwebsockets/libwebsockets-1.4-chrome43-firefox-36
  mkdir /tmp/libwebsockets/libwebsockets-1.4-chrome43-firefox-36/build
  cd /tmp/libwebsockets/libwebsockets-1.4-chrome43-firefox-36/build
  cmake -DCMAKE_INSTALL_PREFIX=/usr/ /tmp/libwebsockets/libwebsockets-1.4-chrome43-firefox-36/build
  make
  make install
  ldconfig
  mkdir -p /usr/include/libwebsockets1-4/
  cp -r /tmp/libwebsockets/libwebsockets-1.4-chrome43-firefox-36/build/lib/*.* /usr/include/libwebsockets1-4/
  sudo ln -s /usr/lib/libwebsockets.so /usr/local/lib/libwebsockets.so

Don't know if this section is required ...


sudo curl -LsS https://symfony.com/installer -o /usr/bin/symfony
sudo chmod a+x /usr/bin/symfony
php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php
php -r "if (hash('SHA384', file_get_contents('composer-setup.php')) === '41e71d86b40f28e771d4bb662b997f79625196afcca95a5abf44391188c695c6c1456e16154c75a211d238cc3bc5cb47') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); }"
php composer-setup.php --install-dir=/usr/bin/
php -r "unlink('composer-setup.php');"
composer require symfony/finder

cd /tmp/
wget http://security.ubuntu.com/ubuntu/pool/main/j/json-c/libjson-c2_0.11-3ubuntu1.2_i386.deb
wget http://security.ubuntu.com/ubuntu/pool/main/j/json-c/libjson-c-dev_0.11-3ubuntu1.2_i386.deb
dpkg -i libjson-c2_0.11-3ubuntu1.2_i386.deb libjson-c-dev_0.11-3ubuntu1.2_i386.deb

install install libssh


  git clone git://git.libssh.org/projects/libssh.git /tmp/libssh/
  mkdir -p /tmp/libssh/build
  cd /tmp/libssh/build
  cmake -DCMAKE_INSTALL_PREFIX=/usr/ /tmp/libssh/build
  make
  make install

install pyang


  git clone https://github.com/mbj4668/pyang.git /tmp/pyang
  cd /tmp/pyang
  python setup.py install

install libnetconf


  git clone https://github.com/CESNET/libnetconf.git /tmp/libnetconf/
  cd /tmp/libnetconf/
  ./configure --prefix=/usr/
  make
  make install 

install netopeer-cli and server


  git clone https://github.com/CESNET/netopeer.git /tmp/netopeer/
  cd /tmp/netopeer/cli
  ./configure --prefix=/usr/
  make
  make install

  cd ..
  cd server
  ./configure --prefix=/usr/
  make
  make install

And finally ... netopeer GUI


mkdir -p /var/www/
git clone --recursive https://github.com/cesnet/netopeer-gui.git
cd /var/www/netopeer-gui/install
./bootstrap.sh
./configure --prefix=/usr/ --without-notifications

At this ^ point I had some trouble to pass the correct flags etc. to mod_netconf. I wasn't capable add '-I/usr/include/, but therefor
/usr/local/include/ appears twice - don't get it :/ Anyhow, I've tried this:

cd mod_netconf
./bootstrap.sh
./configure netconf_LIBS='-I/usr/lib/' netconf_CFLAGS='-I/usr/include/' CFLAGS=' -I/usr/include/ ' websockets_CFLAGS=' -I/usr/include/apache2/ ' --without-notifications
cd ..
make  

// dont get there: make install

And here the output:


checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking how to create a pax tar archive... gnutar checking for rpmbuild... no checking for httpd... no checking for apachectl... /usr/sbin/apachectl checking for php... /usr/bin/php checking for php module dom... yes checking for php module json... yes checking for php module xml... yes checking for php module pdo... yes checking for php module intl... yes checking for php module sysvsem... yes checking for pyang... yes checking for python... /usr/bin/python checking for rpmbuild... (cached) no checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating netopeergui.conf config.status: creating pyang/Makefile === configuring in mod_netconf (/var/www/netopeer-gui/install/mod_netconf) configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr' --cache-file=/dev/null --srcdir=. checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make supports nested variables... (cached) yes checking for apxs2... /usr/bin/apxs2 checking for rpmbuild... no checking for httpd... no checking for apachectl... /usr/sbin/apachectl checking for php5_module in apache... yes checking for rpmbuild... (cached) no checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for json... yes checking for websockets... yes checking for apr... yes checking for aprutil... yes checking for netconf... yes checking for xml... yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... no checking whether pthreads work with -Kthread... no checking whether pthreads work with -kthread... no checking for the pthreads library -llthread... no checking whether pthreads work with -pthread... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking if more special flags are required for pthreads... no checking for PTHREAD_PRIO_INHERIT... yes checking for libwebsocket_create_context in -lwebsockets... yes checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking for int64_t... yes checking for size_t... yes checking for ssize_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... yes checking for getdelim... yes checking for gettimeofday... yes checking for memset... yes checking for socket... yes checking for strdup... yes checking for strerror... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: creating mod_netconf.spec config.status: creating conf.d/Makefile config.status: creating src/Makefile config.status: executing depfiles commands


mod_netconf 1.0.2

Configuration Options Summary:

Documentation..........:

Compilation............: make (or gmake) asxs.................: LIBS.................: -lwebsockets -ljson-c -lwebsockets -L/usr/local/lib -lnetconf -lxml2
CFLAGS...............: -I/usr/include/json-c -I/usr/local/include -I/usr/include/libxml2 -DWITH_NOTIFICATIONS

Installation...........: make install (as root if needed, with 'su' or 'sudo') prefix...............: /usr python module dir....: webgui dir...........: webgui name..........: httpdmoduledir.......: Apache default path httpdconfddir........: /etc/httpd/conf.d Su user for process:...............: Su group for process:..............: Chown user for sock file:...............: Chown group for sock file:..............:


netopeergui 1.0.0

Configuration Options Summary:

Documentation..........:

Compilation............: make (or gmake) asxs.................: LIBS.................: CFLAGS...............:

Components mod_netconf..........: yes pyang plugins........: yes

Installation...........: make install (as root if needed, with 'su' or 'sudo') prefix...............: /usr python module dir....: /usr/lib/python2.7/dist-packages/pyang/plugins webgui dir...........: /var/www webgui name..........: netopeer-gui httpdmoduledir.......: Apache default path httpdconfddir........: /etc/httpd/conf.d


mod_netconf: ./configure ..


checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make supports nested variables... (cached) yes checking for apxs2... /usr/bin/apxs2 checking for rpmbuild... no checking for httpd... no checking for apachectl... /usr/sbin/apachectl checking for php5_module in apache... yes checking for rpmbuild... (cached) no checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for json... yes checking for websockets... yes checking for apr... yes checking for aprutil... yes checking for netconf... yes checking for xml... yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... no checking whether pthreads work with -Kthread... no checking whether pthreads work with -kthread... no checking for the pthreads library -llthread... no checking whether pthreads work with -pthread... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking if more special flags are required for pthreads... no checking for PTHREAD_PRIO_INHERIT... yes checking for libwebsocket_create_context in -lwebsockets... yes checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking for int64_t... yes checking for size_t... yes checking for ssize_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... yes checking for getdelim... yes checking for gettimeofday... yes checking for memset... yes checking for socket... yes checking for strdup... yes checking for strerror... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: creating mod_netconf.spec config.status: creating conf.d/Makefile config.status: creating src/Makefile config.status: executing depfiles commands


mod_netconf 1.0.2

Configuration Options Summary:

Documentation..........:

Compilation............: make (or gmake) asxs.................: LIBS.................: -lwebsockets -ljson-c -lwebsockets -I/usr/lib/ -lxml2
CFLAGS...............: -I/usr/include/json-c -I/usr/include/apache2/ -I/usr/include/ -I/usr/include/libxml2 -DWITH_NOTIFICATIONS

Installation...........: make install (as root if needed, with 'su' or 'sudo') prefix...............: /usr/local python module dir....: webgui dir...........: webgui name..........: httpdmoduledir.......: Apache default path httpdconfddir........: /etc/httpd/conf.d Su user for process:...............: Su group for process:..............: Chown user for sock file:...............: Chown group for sock file:..............:


make in /var/www/netopeer-gui/install/:


Making all in mod_netconf make[1]: Verzeichnis »/var/www/netopeer-gui/install/mod_netconf« wird betreten Making all in src make[2]: Verzeichnis »/var/www/netopeer-gui/install/mod_netconf/src« wird betreten gcc -lwebsockets -ljson-c -lwebsockets -I/usr/lib/ -lxml2 -I/usr/include/json-c -I/usr/include/apache2/ -I/usr/include/ -I/usr/include/libxml2 -DWITH_NOTIFICATIONS -DHTTPD_INDEPENDENT apr-1-config --cflags --cppflags --includes --link-ld -I/usr/include/httpd -laprutil-1 -o webgui-backend ./mod_netconf.c ./notification-server.c ./mod_netconf.c:162:63: error: unknown type name ‘LIBSSH2_SESSION’ int netconf_callback_ssh_hostkey_check (const char* hostname, LIBSSH2_SESSION _session) ^ ./mod_netconf.c:183:3: error: unknown type name ‘LIBSSH2_USERAUTH_KBDINT_PROMPT’ const LIBSSH2_USERAUTH_KBDINTPROMPT prompts, ^ ./mod_netconf.c:184:3: error: unknown type name ‘LIBSSH2_USERAUTH_KBDINT_RESPONSE’ LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses, ^ ./mod_netconf.c: In function ‘forked_proc’: ./mod_netconf.c:2332:42: error: ‘netconf_callback_ssh_hostkey_check’ undeclared (first use in this function) nc_callback_ssh_host_authenticity_check(netconf_callback_ssh_hostkey_check); ^ ./mod_netconf.c:2332:42: note: each undeclared identifier is reported only once for each function it appears in ./mod_netconf.c:2333:34: error: ‘netconf_callback_sshauth_interactive’ undeclared (first use in this function) nc_callback_sshauth_interactive(netconf_callback_sshauth_interactive); ^ ./notification-server.c: In function ‘callback_http’: ./notification-server.c:192:3: error: too few arguments to function ‘libwebsockets_serve_http_file’ if (libwebsockets_serve_http_file(context, wsi, buf, whitelist[n].mimetype, NULL)) ^ In file included from ./notification-server.c:33:0: /usr/include/libwebsockets.h:1220:1: note: declared here libwebsockets_serve_http_file(struct libwebsocket_context _context, ^ ./notification-server.c: In function ‘callbacknotification’: ./notification-server.c:681:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=] DEBUG("ws send %dB in %lu", n, sizeof(buf)); ^ make[2]: ** [webgui-backend] Fehler 1 make[2]: Verzeichnis »/var/www/netopeer-gui/install/mod_netconf/src« wird verlassen make[1]: * [all-recursive] Fehler 1 make[1]: Verzeichnis »/var/www/netopeer-gui/install/mod_netconf« wird verlassen make: * [all-recursive] Fehler 1

0xADA5 commented 8 years ago

Issue can be closed. For further information see: https://github.com/CESNET/Netopeer-GUI/issues/93

huzaifazafar108 commented 8 years ago

Hi, I was wondering what's the link between this issue and issue 93? I was facing issue 93 a while ago and I resolved it by copy pasting all apache2 .h files from /usr/include/apache2 to /usr/include. And that issue was solved. But now when I try make, this issue (issue 92) is appearing. When I tried to lookup on the internet regarding this, I arrived here but you are referencing issue 93 for that. Could anyone elaborate? Thanks!