jperkin / node-openzwave

node.js interface to libopenzwave
Other
110 stars 55 forks source link

Unable to build on Ubuntu 10.04 #22

Closed glennschmidt closed 10 years ago

glennschmidt commented 10 years ago

Building the module fails on Ubuntu 10.04. It looks like it's failed to include the udev headers or something, or the version of the udev library is incompatible?

../deps/open-zwave/cpp/hidapi/linux/hid.c:384: warning: implicit declaration of function ‘udev_list_entry_foreach’
../deps/open-zwave/cpp/hidapi/linux/hid.c:384: error: expected ‘;’ before ‘{’ token
../deps/open-zwave/cpp/hidapi/linux/hid.c:366: warning: unused variable ‘prev_dev’
../deps/open-zwave/cpp/hidapi/linux/hid.c:365: warning: unused variable ‘cur_dev’
make: *** [Release/obj.target/libopenzwave/deps/open-zwave/cpp/hidapi/linux/hid.o] Error 1
make: Leaving directory `/home/glenn/build/nodejs/node-v0.10.24/node_modules/openzwave/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 2.6.32-54-server
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/glenn/build/nodejs/node-v0.10.24/node_modules/openzwave
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok 
npm ERR! openzwave@0.0.32 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the openzwave@0.0.32 install script.
npm ERR! This is most likely a problem with the openzwave package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
glennschmidt commented 10 years ago

Ah yes, here is the crux of the problem, earlier in the log output:

../deps/open-zwave/cpp/hidapi/linux/hid.c:44:21: warning: libudev.h: No such file or directory
glennschmidt commented 10 years ago

Resolved this by installing the OS package libudev-dev.

apt-get install libudev-dev

Probably the only thing required is to document this dependency somewhere for the benefit of future people who run into this.