Skip to content

Make Fails With Node 0.10.x #38

Closed
esetnik opened this Issue May 9, 2013 · 28 comments
@esetnik
esetnik commented May 9, 2013
make: Entering directory `***/node_modules/bonescript/build'
  CXX(target) Release/obj.target/misc/misc.o
../misc.cpp:1:0: warning: "BUILDING_NODE_EXTENSION" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
../misc.cpp:21:27: error: variable or field ‘pollpri_event’ declared void
../misc.cpp:21:27: error: ‘EV_P_’ was not declared in this scope
../misc.cpp:21:46: error: expected primary-expression before ‘int’
../misc.cpp:32:5: error: ‘ev_io’ does not name a type
../misc.cpp:148:31: error: ‘EV_P_’ has not been declared
../misc.cpp:148:43: error: expected ‘,’ or ‘...’ before ‘*’ token
../misc.cpp: In static member function ‘static void Pollpri::Init(v8::Handle<v8::Object>)’:
../misc.cpp:37:34: warning: statement has no effect [-Wunused-value]
../misc.cpp:38:38: warning: left operand of comma operator has no effect [-Wunused-value]
../misc.cpp:47:33: warning: statement has no effect [-Wunused-value]
../misc.cpp: In constructor ‘Pollpri::Pollpri()’:
../misc.cpp:51:49: warning: statement has no effect [-Wunused-value]
../misc.cpp:54:18: error: ‘event_watcher’ was not declared in this scope
../misc.cpp:54:46: error: ‘ev_init’ was not declared in this scope
../misc.cpp:56:9: error: ‘ew’ was not declared in this scope
../misc.cpp: In destructor ‘virtual Pollpri::~Pollpri()’:
../misc.cpp:60:48: warning: statement has no effect [-Wunused-value]
../misc.cpp:63:20: error: ‘EV_DEFAULT_’ was not declared in this scope
../misc.cpp:63:33: error: ‘event_watcher’ was not declared in this scope
../misc.cpp:63:46: error: ‘ev_io_stop’ was not declared in this scope
../misc.cpp: In static member function ‘static v8::Handle<v8::Value> Pollpri::New(const v8::Arguments&)’:
../misc.cpp:67:32: warning: statement has no effect [-Wunused-value]
../misc.cpp:84:49: warning: left operand of comma operator has no effect [-Wunused-value]
../misc.cpp:84:55: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:84:73: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:88:53: warning: left operand of comma operator has no effect [-Wunused-value]
../misc.cpp:88:73: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:93:56: warning: left operand of comma operator has no effect [-Wunused-value]
../misc.cpp:93:60: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:93:63: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:93:83: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:99:43: warning: left operand of comma operator has no effect [-Wunused-value]
../misc.cpp:99:47: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:99:64: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:102:48: warning: left operand of comma operator has no effect [-Wunused-value]
../misc.cpp:102:52: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:102:55: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:102:74: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:105:22: error: ‘class Pollpri’ has no member named ‘ew’
../misc.cpp:105:32: error: ‘EV_READ’ was not declared in this scope
../misc.cpp:105:39: error: ‘ev_io_set’ was not declared in this scope
../misc.cpp:106:21: error: ‘EV_DEFAULT_’ was not declared in this scope
../misc.cpp:106:38: error: ‘ev_io_start’ was not declared in this scope
../misc.cpp:111:32: warning: statement has no effect [-Wunused-value]
../misc.cpp: In member function ‘void Pollpri::Event(Pollpri*, int)’:
../misc.cpp:117:57: warning: left operand of comma operator has no effect [-Wunused-value]
../misc.cpp:117:61: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:117:67: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:118:23: error: ‘EV_READ’ was not declared in this scope
../misc.cpp:126:43: warning: left operand of comma operator has no effect [-Wunused-value]
../misc.cpp:126:47: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:126:64: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:129:48: warning: left operand of comma operator has no effect [-Wunused-value]
../misc.cpp:129:52: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:129:55: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp:129:74: warning: right operand of comma operator has no effect [-Wunused-value]
../misc.cpp: In static member function ‘static void Pollpri::pollpri_event(int)’:
../misc.cpp:149:42: warning: statement has no effect [-Wunused-value]
../misc.cpp:150:44: error: ‘req’ was not declared in this scope
../misc.cpp:151:21: error: ‘revents’ was not declared in this scope
../misc.cpp:152:42: warning: statement has no effect [-Wunused-value]
../misc.cpp: In function ‘void init(v8::Handle<v8::Object>)’:
../misc.cpp:160:33: warning: statement has no effect [-Wunused-value]
make: *** [Release/obj.target/misc/misc.o] Error 1
make: Leaving directory `***/node_modules/bonescript/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (***/.nvm/v0.10.5/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
@ericbarch

Getting the same error here. Running on Node 0.10.7. Ubuntu on the Beaglebone Black.

@gerritgriebel

Me too: Node 0.10.10. Debian on Beaglebone black

@rushidesai

Me too: Node 0.10.12. Ubuntu on Beaglebone black

@previousgtbash

Also here, Node JS v0.10.5 Ubuntu on BeagleBone Black

@jadonk
Owner
jadonk commented Jul 19, 2013

My solution to this will be to remove the pollpri stuff completely and move to enabling gpio-keys with standard events using device tree. Hope to get to that in a week or two, but would accept patches to load the gpio-keys driver by automatically producing a device tree overlay and loading it with capemgr.

@korgon
korgon commented Aug 7, 2013

Also getting something similar with v0.10.15 on gentoo...

@ely-az
ely-az commented Aug 14, 2013

Having same problems here. Starting to learn about device tree so hopefully can help.

@manuelsantillan

Having the same issue on 0.10.12 with beaglebone black.

@betolink

Have you guys tried ./configure --without-snapshot? looks like there is a known bug with v8 http://www.armhf.com/index.php/node-js-for-the-beaglebone-black/

@manuelsantillan

I successfully built node.js with the --without-snapshot, the problem lies in installing bonescript, regular node.js works fine.
Thanks a lot, though

@manuelsantillan

I'm a complete newbie in cpp, but seems that removing libev from node on version 0.9 onwards should have something to do: joyent/libuv#485

@lagrz
lagrz commented Oct 2, 2013

there is a warning on it "ev_io is deprecated, use uv_poll_t" I guess newer versions of node does not support ev_io at all. My cpp skills aren't great otherwise id just patch it to use uv_poll:

https://github.com/joyent/node/wiki/How-to-migrate-from-ev_io_*-to-uv_poll_*-for-IO-polling

@fivdi
fivdi commented Oct 3, 2013

According to the comments in the libuv header file, using uv_poll_t to signal the the event loop about anything other than socket status changes isn't recommended. If it was recommended, I don't think it would work either as the EPOLLPRI event, which is the interesting one for GPIO interrupts, is missing from the list of events that libuv currently knows about.

If @jadonk reconsidered and decided to stick with EPOLLPRI rather than switch to gpio-keys with standard events using the device tree, the Node.js epoll module might be an alternative for detecting EPOLLPRI events. According to the author (yours truely) it can detect over 7000 interrupts per second on the BeagleBone, so it will be even more on the BBB. I'll have to admit that it requires in excess of 99% CPU to achieve this. I'll also have to admit that this test was performed with interrupt generating outputs rather than inputs so there may be a difference. The epoll module uses nan so it compiles with Node.js v0.8, v0.10, v0.11, and eventually v0.12.

There would almost certainly be differences in timing if epoll was used. The time between the rising/falling edge of an interrupt and this read in the current BoneScript implementation would be different with an implementation based on epoll.

@fivdi
fivdi commented Oct 5, 2013

As weekend project I decided to fork BoneScript and replace pollpri with epoll to see if it was possible to get things up and running with Node.js v0.10.20. The fork is here and it looks as if a replacement would be possible. This variant of the input.js demo works fine on v0.10.20, as long as setLED returns an object containing a handler property.

There were issues with serialport v1.0.6 which is currently required by BoneScript. It doesn't compile with Node.js v0.10.20, Updating to v1.2.2 solved the compile issue but more than an update may be required.

@manuelsantillan

Sounds great!! Hope to be giving it a try next weekend!

@kmpm
kmpm commented Oct 29, 2013

@jadonk, any progress on your solution? How can we assist?

@justinledwards

Just stumbled in here. What version of node are you guys having to use to make everything smooth? I had a lot of problems with angstrom and switched over to debian, and have been building everything from source. Bonescript is the last piece of the puzzle.

@manuelsantillan

AFAIK, bonescript only works for node v.0.8

@jadonk
Owner
jadonk commented Nov 7, 2013

@kmpm Patches welcome. I'm trying to use a Device Tree overlay to load gpio-keys on pins where an interrupt is desired. This will make the toggles generate standard events such that the loop will break out and POLLPRI isn't required at all. I've seen some projects providing POLLPRI functionality that might provide interesting support, but I feel that I just need to spend a dedicated 1-2 days switching to gpio-keys.

@jadonk
Owner
jadonk commented Dec 15, 2013

I've pushed the change from @fivdi and am working to verify it on Debian with node 0.10.22 and Angstrom with node 0.8.22.

4f40673

@jadonk
Owner
jadonk commented Dec 16, 2013

BTW, the plan is still to move to gpio-keys, but all of the loading and unloading of device-tree overlays is more complex than I thought.

@fivdi
fivdi commented Dec 16, 2013

If I'm not mistaken, the version of serialport you decided to use (1.2.5) will not function together with node 0.8.22 on Angstrom as it's package.json says it requires node 0.10.x. My fork of BoneScript has a second commit which uses serialport 1.1.3. This was the highest version of serialport I could find that supports node 0.8.x and 0.10.x.

@jadonk
Owner
jadonk commented Dec 17, 2013

Thanks @fivdi

@paullryan

How would I go about compiling the versions your working on @jadonk or @fivdi. I've tried downloading and running node-gyp in bonescript and in bonscript/node_modules/bonescript appears that the binding.gyp is missing and I don't know what it should look like.

My application requires v0.10 for other parts and I'm willing to work at this but I'm not sure where to start.

@fivdi
fivdi commented Jan 17, 2014

See here for instructions. It shouldn't be necessary to install node-gyp. Don't forget the prerequisites mentioned here. Depending on the version of python installed on your system, you may need TERM=none directly in front of the npm command also.

@paullryan

@fivdi Thank you much, that worked.

@jadonk
Owner
jadonk commented Jan 17, 2014

0.2.4 is now released and should resolve the issues with installing on Debian and Ubuntu. (Tested on Debian)

@jadonk jadonk closed this Jan 17, 2014
@shrkey
shrkey commented Jan 19, 2014

Installed fine on Ubuntu 12.04 LTS with Node 0.10.x - not fully tested yet, but so far so good :) Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.