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

mdns Install Fails on BeagleBone [missing dns_sd.h] #73

Closed
AshuJoshi opened this Issue Jul 6, 2013 · 10 comments

Comments

Projects
None yet
6 participants
@AshuJoshi

AshuJoshi commented Jul 6, 2013

I am trying to install mdns on a BeagleBone to make use of the service. First I ran into a problem with the "npm install mdns" running into a problem with a check on Python version - that was successfully averted thanks to this post [in short per this post - semver.lt fails]: https://groups.google.com/forum/#!msg/beagleboard/-M-xtkMHHk4/lrrazYVloEgJ

I am running into an install problem faced by another user - dependency on the Avahi files [specfically dns_sd.h]. Here is the thread: #60

According to this thread above - I need to get the equivalent of libavahi-compat-libdnssd-dev - I cannot seem to find the equivalent avahi package.

The BeagleBone is running Angstrom Linux: Linux beaglebone 3.8.13 #1 SMP Mon May 20 17:07:58 CEST 2013 armv7l GNU/Linux

I forced install of "avahi-dev" using opkg install but I still get the error reproduced below at the end of the message.

Regards
Ashu

------------------------------------ Error Output --------------------------------

root@beaglebone:/# npm install mdns
npm http GET https://registry.npmjs.org/mdns
npm http 304 https://registry.npmjs.org/mdns

mdns@1.1.0 install /node_modules/mdns
node-gyp rebuild

make: Entering directory /node_modules/mdns/build' CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o In file included from ../src/dns_sd.cpp:1:0: ../src/mdns.hpp:31:20: fatal error: dns_sd.h: No such file or directory compilation terminated. make: *** [Release/obj.target/dns_sd_bindings/src/dns_sd.o] Error 1 make: Leaving directory/node_modules/mdns/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:256:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Linux 3.8.13
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /node_modules/mdns
gyp ERR! node -v v0.8.22
gyp ERR! node-gyp -v v0.8.5
gyp ERR! not ok
npm ERR! mdns@1.1.0 install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the mdns@1.1.0 install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls mdns
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.13
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "mdns"
npm ERR! cwd /
npm ERR! node -v v0.8.22
npm ERR! npm -v 1.2.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /npm-debug.log
npm ERR! not ok code 0

@danilotorrisi

This comment has been minimized.

Show comment
Hide comment
@danilotorrisi

danilotorrisi Jul 8, 2013

I have the same problem. I'm trying to fix this problem using the avahi sources. I'll keep you informed.

danilotorrisi commented Jul 8, 2013

I have the same problem. I'm trying to fix this problem using the avahi sources. I'll keep you informed.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost commented Jul 9, 2013

+1

@previousgtbash

This comment has been minimized.

Show comment
Hide comment
@previousgtbash

previousgtbash Jul 9, 2013

I tried everything and I wasn't able to solve this issue. I switched from Angstrom to Ubuntu ( check out this great site http://www.armhf.com ) and I can now successfully install mdns on the BeagleBone Black.

previousgtbash commented Jul 9, 2013

I tried everything and I wasn't able to solve this issue. I switched from Angstrom to Ubuntu ( check out this great site http://www.armhf.com ) and I can now successfully install mdns on the BeagleBone Black.

@AshuJoshi

This comment has been minimized.

Show comment
Hide comment
@AshuJoshi

AshuJoshi Sep 30, 2013

Here is an update - to bypass the missing dns_sd.h problem on the Angstrom BeagleBone Black, I copied that file over from the source (I used it from mDNSResponder, but it could be from Avahi as well - I just copied for now to /usr/include. NOW the behavior changes of course, it gets past and is able to start building the files, but towards the end it fails to load the files. Here is the error message:

Console Output >>>>>>>>>>>>>
root@beaglebone:/xDev# npm install mdns
npm http GET https://registry.npmjs.org/mdns
npm http 304 https://registry.npmjs.org/mdns

mdns@1.1.0 install /xDev/node_modules/mdns
node-gyp rebuild

make: Entering directory /xDev/node_modules/mdns/build' CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_browse.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_enumerate_domains.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_get_addr_info.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_process_result.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref_deallocate.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref_sock_fd.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_register.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_resolve.o CXX(target) Release/obj.target/dns_sd_bindings/src/mdns_utils.o CXX(target) Release/obj.target/dns_sd_bindings/src/network_interface.o CXX(target) Release/obj.target/dns_sd_bindings/src/socket_watcher.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_ref.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_create.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_deallocate.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_set_value.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_get_length.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_buffer_to_object.o SOLINK_MODULE(target) Release/obj.target/dns_sd_bindings.node /usr/lib/gcc/arm-angstrom-linux-gnueabi/4.7.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -ldns_sd collect2: error: ld returned 1 exit status make: *** [Release/obj.target/dns_sd_bindings.node] Error 1 make: Leaving directory/xDev/node_modules/mdns/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:256:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Linux 3.8.13
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /xDev/node_modules/mdns
gyp ERR! node -v v0.8.22
gyp ERR! node-gyp -v v0.8.5
gyp ERR! not ok
npm ERR! mdns@1.1.0 install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the mdns@1.1.0 install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls mdns
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.13
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "mdns"
npm ERR! cwd /xDev
npm ERR! node -v v0.8.22
npm ERR! npm -v 1.2.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /xDev/npm-debug.log
npm ERR! not ok code 0

Console Output >>>>>>>>>>>>>

The error is about the missing object files - I have picked the actual error message here:

SOLINK_MODULE(target) Release/obj.target/dns_sd_bindings.node
/usr/lib/gcc/arm-angstrom-linux-gnueabi/4.7.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -ldns_sd
collect2: error: ld returned 1 exit status
make: *** [Release/obj.target/dns_sd_bindings.node] Error 1

<<<<<

However I CAN confirm that the files are actually built the same directory - as it is going through the build process - if you navigate to the directory then you find the files are being compiled, but when it get to the linking stage it basically does not find them.

AshuJoshi commented Sep 30, 2013

Here is an update - to bypass the missing dns_sd.h problem on the Angstrom BeagleBone Black, I copied that file over from the source (I used it from mDNSResponder, but it could be from Avahi as well - I just copied for now to /usr/include. NOW the behavior changes of course, it gets past and is able to start building the files, but towards the end it fails to load the files. Here is the error message:

Console Output >>>>>>>>>>>>>
root@beaglebone:/xDev# npm install mdns
npm http GET https://registry.npmjs.org/mdns
npm http 304 https://registry.npmjs.org/mdns

mdns@1.1.0 install /xDev/node_modules/mdns
node-gyp rebuild

make: Entering directory /xDev/node_modules/mdns/build' CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_browse.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_enumerate_domains.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_get_addr_info.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_process_result.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref_deallocate.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref_sock_fd.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_register.o CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_resolve.o CXX(target) Release/obj.target/dns_sd_bindings/src/mdns_utils.o CXX(target) Release/obj.target/dns_sd_bindings/src/network_interface.o CXX(target) Release/obj.target/dns_sd_bindings/src/socket_watcher.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_ref.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_create.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_deallocate.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_set_value.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_get_length.o CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_buffer_to_object.o SOLINK_MODULE(target) Release/obj.target/dns_sd_bindings.node /usr/lib/gcc/arm-angstrom-linux-gnueabi/4.7.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -ldns_sd collect2: error: ld returned 1 exit status make: *** [Release/obj.target/dns_sd_bindings.node] Error 1 make: Leaving directory/xDev/node_modules/mdns/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:256:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Linux 3.8.13
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /xDev/node_modules/mdns
gyp ERR! node -v v0.8.22
gyp ERR! node-gyp -v v0.8.5
gyp ERR! not ok
npm ERR! mdns@1.1.0 install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the mdns@1.1.0 install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls mdns
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.13
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "mdns"
npm ERR! cwd /xDev
npm ERR! node -v v0.8.22
npm ERR! npm -v 1.2.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /xDev/npm-debug.log
npm ERR! not ok code 0

Console Output >>>>>>>>>>>>>

The error is about the missing object files - I have picked the actual error message here:

SOLINK_MODULE(target) Release/obj.target/dns_sd_bindings.node
/usr/lib/gcc/arm-angstrom-linux-gnueabi/4.7.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -ldns_sd
collect2: error: ld returned 1 exit status
make: *** [Release/obj.target/dns_sd_bindings.node] Error 1

<<<<<

However I CAN confirm that the files are actually built the same directory - as it is going through the build process - if you navigate to the directory then you find the files are being compiled, but when it get to the linking stage it basically does not find them.

@AshuJoshi

This comment has been minimized.

Show comment
Hide comment
@AshuJoshi

AshuJoshi Oct 12, 2013

I have managed to create the library (libdns_sd.so) using Avahi sources. I have shared the libraries, and the instructions on my Public share on Google Drive (https://drive.google.com/folderview?id=0B7trJbhoAGc0OEpDQlVVUGxkN0k&usp=sharing). Here are the instructions:

  1. Note: My BBB is running the following version of Linux:

Linux beaglebone 3.8.13 #1 SMP Mon May 20 17:07:58 CEST 2013 armv7l GNU/Linux (Angstrom v2012.12 - Kernel)

  1. Get and untar the sources to a directory – for example ‘xDev’ (for all the following steps – you will have a different path depending on where you downloaded the source and untarred):

root@beaglebone:/xDev# wget http://avahi.org/download/avahi-0.6.31.tar.gz

root@beaglebone:/xDev# tar xvf avahi-0.6.31.tar.gz

  1. Export the flags required for the configure script to find the pthread library:

export PTHREAD_CFLAGS='-lpthread'

  1. Install the required SSP packages:

root@beaglebone:/xDev/avahi-0.6.31# opkg install libssp-dev

  1. Install the ‘intltool’ package:

root@beaglebone:/xDev/avahi-0.6.31# opkg install intltool

  1. Run the Configure script

root@beaglebone:/xDev/avahi-0.6.31# ./configure --disable-static --disable-mono --disable-monodoc --disable-gtk3 --disable-gtk --disable-qt3 --disable-python --disable-qt4 --disable-core-docs --enable-compat-libdns_sd --disable-tests --with-distro=none

  1. Run make – note that I am did not run ‘make install’ since I wanted to manually copy over the files.
  2. Copy over the libdns_sd.so and dns_sd.h to appropriate directories:

root@beaglebone:/xDev/avahi-0.6.31# cd avahi-compat-libdns_sd/.libs/
root@beaglebone:/xDev/avahi-0.6.31/avahi-compat-libdns_sd/.libs#
root@beaglebone:/xDev/avahi-0.6.31/avahi-compat-libdns_sd/.libs# cp libdns_sd.so /usr/lib/.

root@beaglebone:/xDev/avahi-0.6.31/avahi-compat-libdns_sd/.libs# cd ..
root@beaglebone:/xDev/avahi-0.6.31/avahi-compat-libdns_sd# cp dns_sd.h /usr/include/.

  1. Install mdns now (assumes all other dependencies are in place):

root@beaglebone:/xDev# npm install mdns

AshuJoshi commented Oct 12, 2013

I have managed to create the library (libdns_sd.so) using Avahi sources. I have shared the libraries, and the instructions on my Public share on Google Drive (https://drive.google.com/folderview?id=0B7trJbhoAGc0OEpDQlVVUGxkN0k&usp=sharing). Here are the instructions:

  1. Note: My BBB is running the following version of Linux:

Linux beaglebone 3.8.13 #1 SMP Mon May 20 17:07:58 CEST 2013 armv7l GNU/Linux (Angstrom v2012.12 - Kernel)

  1. Get and untar the sources to a directory – for example ‘xDev’ (for all the following steps – you will have a different path depending on where you downloaded the source and untarred):

root@beaglebone:/xDev# wget http://avahi.org/download/avahi-0.6.31.tar.gz

root@beaglebone:/xDev# tar xvf avahi-0.6.31.tar.gz

  1. Export the flags required for the configure script to find the pthread library:

export PTHREAD_CFLAGS='-lpthread'

  1. Install the required SSP packages:

root@beaglebone:/xDev/avahi-0.6.31# opkg install libssp-dev

  1. Install the ‘intltool’ package:

root@beaglebone:/xDev/avahi-0.6.31# opkg install intltool

  1. Run the Configure script

root@beaglebone:/xDev/avahi-0.6.31# ./configure --disable-static --disable-mono --disable-monodoc --disable-gtk3 --disable-gtk --disable-qt3 --disable-python --disable-qt4 --disable-core-docs --enable-compat-libdns_sd --disable-tests --with-distro=none

  1. Run make – note that I am did not run ‘make install’ since I wanted to manually copy over the files.
  2. Copy over the libdns_sd.so and dns_sd.h to appropriate directories:

root@beaglebone:/xDev/avahi-0.6.31# cd avahi-compat-libdns_sd/.libs/
root@beaglebone:/xDev/avahi-0.6.31/avahi-compat-libdns_sd/.libs#
root@beaglebone:/xDev/avahi-0.6.31/avahi-compat-libdns_sd/.libs# cp libdns_sd.so /usr/lib/.

root@beaglebone:/xDev/avahi-0.6.31/avahi-compat-libdns_sd/.libs# cd ..
root@beaglebone:/xDev/avahi-0.6.31/avahi-compat-libdns_sd# cp dns_sd.h /usr/include/.

  1. Install mdns now (assumes all other dependencies are in place):

root@beaglebone:/xDev# npm install mdns

@aallan

This comment has been minimized.

Show comment
Hide comment
@aallan

aallan Nov 22, 2013

A recent update to Angstrom means that it now ships without libdaemon, which means that that avahi configure fails with the following error,

checking for LIBDAEMON... no
configure: error: Package requirements ( libdaemon >= 0.14 ) were not met:

No package 'libdaemon' found

since libdaemon doesn't appear to be available as a package under Angstrom, we need to download, build and install it from source,

opkg install texinfo
git clone git://git.0pointer.de/libdaemon
cd libdaemon
autoreconf -i
autoconf configure.ac > configure
chmod uog+x configure
./configure
make
make install
export LIBDAEMON_CFLAGS=-I/usr/local/include
export LIBDAEMON_LIBS=-L/usr/local/lib

before being able to go ahead and build avahi as above.

aallan commented Nov 22, 2013

A recent update to Angstrom means that it now ships without libdaemon, which means that that avahi configure fails with the following error,

checking for LIBDAEMON... no
configure: error: Package requirements ( libdaemon >= 0.14 ) were not met:

No package 'libdaemon' found

since libdaemon doesn't appear to be available as a package under Angstrom, we need to download, build and install it from source,

opkg install texinfo
git clone git://git.0pointer.de/libdaemon
cd libdaemon
autoreconf -i
autoconf configure.ac > configure
chmod uog+x configure
./configure
make
make install
export LIBDAEMON_CFLAGS=-I/usr/local/include
export LIBDAEMON_LIBS=-L/usr/local/lib

before being able to go ahead and build avahi as above.

@agnat agnat closed this Nov 4, 2014

@AAADiver

This comment has been minimized.

Show comment
Hide comment
@AAADiver

AAADiver Aug 16, 2015

Sorry, I'm a complete noob. I'm trying to solve the same problem on a RPi. I've followed your directions but get hung on "opkg install libssp-dev". It doesn't recognize opkg command. Any recommendations or guidance?

Thx!

AAADiver commented Aug 16, 2015

Sorry, I'm a complete noob. I'm trying to solve the same problem on a RPi. I've followed your directions but get hung on "opkg install libssp-dev". It doesn't recognize opkg command. Any recommendations or guidance?

Thx!

@agnat

This comment has been minimized.

Show comment
Hide comment
@agnat

agnat Aug 16, 2015

Owner

opkg is the package manager of the Angstrom distro. AFAIK, angstrom is not very common on RPI and most distros use apt-get, the debian package manager. That said, I doubt you have to compile your own avahi on a modern RPI distro. The system one will do.

Owner

agnat commented Aug 16, 2015

opkg is the package manager of the Angstrom distro. AFAIK, angstrom is not very common on RPI and most distros use apt-get, the debian package manager. That said, I doubt you have to compile your own avahi on a modern RPI distro. The system one will do.

@AAADiver

This comment has been minimized.

Show comment
Hide comment
@AAADiver

AAADiver Aug 16, 2015

Thanks agnat. Any idea how I could resolve an error where I am missing /src/dns_sd file?

AAADiver commented Aug 16, 2015

Thanks agnat. Any idea how I could resolve an error where I am missing /src/dns_sd file?

@agnat

This comment has been minimized.

Show comment
Hide comment
@agnat

agnat Aug 16, 2015

Owner

No, I don't know anything about /src/dns_sd. No such thing. You probably mean dns_sd.h? This way please: https://github.com/agnat/node_mdns#installation

Owner

agnat commented Aug 16, 2015

No, I don't know anything about /src/dns_sd. No such thing. You probably mean dns_sd.h? This way please: https://github.com/agnat/node_mdns#installation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment