OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

nm: /usr/lib/aarch64-linux-gnu/libopenzwave.so: no symbols #315

Closed tfreedman closed 5 years ago

tfreedman commented 5 years ago

I'm trying to install node-openzwave-shared, though it fails when it attempts to build. The device is a Raspberry Pi 3 B+ running Ubuntu 18.04.2:

ubuntu@ubuntu:~/node/ZWave$ apt search openzwave Sorting... Done Full Text Search... Done libopenzwave-doc/bionic 1.5+ds-5 all documentation for the openzwave library

libopenzwave1.5/bionic,now 1.5+ds-5 arm64 [installed] API to use a Z-Wave controller

libopenzwave1.5-dev/bionic,now 1.5+ds-5 arm64 [installed] header files for the openzwave library

ubuntu@ubuntu:~/node/ZWave$ ldconfig -p | grep 'libopenzwave.so' libopenzwave.so.1.5 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libopenzwave.so.1.5 libopenzwave.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libopenzwave.so

ubuntu@ubuntu:~/node/ZWave$ npm install openzwave-shared@1.5.2

openzwave-shared@1.5.2 preinstall /home/ubuntu/node/ZWave/node_modules/.staging/openzwave-shared-58861a49 node lib/install-ozw.js

openzwave-shared@1.5.2 install /home/ubuntu/node/ZWave/node_modules/openzwave-shared node-gyp rebuild

nm: /usr/lib/aarch64-linux-gnu/libopenzwave.so: no symbols gyp: Call to 'ldconfig -p | grep 'libopenzwave.so ' | awk '{print $4}' | xargs nm -g --demangle |grep OpenZWave::Value::GetTypeNameFromEnum | wc -l' returned exit status 0 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:340:16) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Linux 4.15.0-1038-raspi2 gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /home/ubuntu/node/ZWave/node_modules/openzwave-shared gyp ERR! node -v v8.10.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok npm WARN zwave@1.0.0 No description npm WARN zwave@1.0.0 No repository field. npm ERR! Linux 4.15.0-1038-raspi2 npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "openzwave-shared@1.5.2" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ELIFECYCLE

npm ERR! openzwave-shared@1.5.2 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the openzwave-shared@1.5.2 install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the openzwave-shared 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 information on how to open an issue for this project with: npm ERR! npm bugs openzwave-shared npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls openzwave-shared npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/ubuntu/node/ZWave/npm-debug.log

obositii commented 5 years ago

Almost the same problem on Raspberry PI 3+ running Raspbian GNU/Linux 9 (stretch). $ uname -a Linux piserv 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

$ ldconfig -p | grep 'libopenzwave.so' libopenzwave.so.1.6 (libc6,hard-float) => /usr/local/lib/libopenzwave.so.1.6 libopenzwave.so (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libopenzwave.so libopenzwave.so (libc6,hard-float) => /usr/local/lib/libopenzwave.so

$ npm install openzwave-shared

openzwave-shared@1.5.2 preinstall /home/pi/work/zwave/proj/node_modules/openzwave-shared node lib/install-ozw.js

openzwave-shared@1.5.2 install /home/pi/work/zwave/proj/node_modules/openzwave-shared node-gyp rebuild

nm: /usr/lib/arm-linux-gnueabihf/libopenzwave.so: no symbols gyp: Call to 'ldconfig -p | grep 'libopenzwave.so ' | awk '{print $4}' | xargs nm -g --demangle |grep OpenZWave::Value::GetTypeNameFromEnum | wc -l' returned exit status 0 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Linux 4.14.98-v7+ gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/pi/work/zwave/proj/node_modules/openzwave-shared gyp ERR! node -v v10.16.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok

tfreedman commented 5 years ago

I worked around this by compiling the master branch of openzwave, and then installing node-openzwave-shared 1.5.2, which doesn't complain anymore - however, it's really sketchy that the repo copy can't be used...

Fishwaldo commented 5 years ago

@ekarak these tests your doing with ldconfig and nm etc are pretty damn fragile... Why can't you test for features based on things like the presence of class methods etc? (eg,

#ifdef Value::GetTypeNameFromEnum
value->GetTypeNameFromEnum(....)
#else
ValueID::GetTypeNameFromEnum(xxxx)
#endif
ekarak commented 5 years ago

That won't work, preprocessor directives are not including symbol definitions. Inevitably we have to address the issue (API changes within the library), either:

ekarak commented 5 years ago

see branch bugfix/fix-fragile-build

devsseb commented 5 years ago

I have the same problem (Ubuntu 18.04 and libopenzwave1.5).

With branch bugfix/fix-fragile-build : npm install git+https://github.com/OpenZWave/node-openzwave-shared.git#bugfix/fix-fragile-build

I have this error : grep: /usr/include/openzwavevalue_classes: No such file or directory

ekarak commented 5 years ago

@devsseb this shouldnt happen, OZW_INC is a path and should end with a slash (/) . I've just pushed this that branch, can you retest?

devsseb commented 5 years ago

@ekarak the npm install throw ../src/openzwave-groups.cc:175:37: error: ‘class OpenZWave::Manager’ has no member named ‘IsMultiInstance’; did you mean ‘s_instance’? I had to compil openzwave1.6 and it work now. Thanks

obositii commented 5 years ago

It's also working for me after installing openzwave-shared v1.5.3 and fixing an issue with multiple libopenzwave being installed.

All good. Thanks.