easybotics / node-rpi-rgb-led-matrix

Pilot your rgb led matrix with Nodejs ! Nodejs binding of rpi-rgb-led-matrix library https://github.com/hzeller/rpi-rgb-led-matrix - Actively Maintained!
Do What The F*ck You Want To Public License
57 stars 17 forks source link

Failed to install with "unknown type name 'cpu_set_t'" #5

Closed redandinvisible closed 4 years ago

redandinvisible commented 5 years ago

I noticed you committed a fix for Issue #1 (Many thanks). I tried to install the latest version from npm, at version 0.3.0, but I get the following error.

$ npm install

> easybotics-rpi-rgb-led-matrix@0.3.0 install /Users/xxxxxxx/workspace/repo/lightmessage/node_modules/easybotics-rpi-rgb-led-matrix
> node-gyp rebuild

  CXX(target) Release/obj.target/rpi-rgb-led-matrix/external/matrix/lib/transformer.o
  CXX(target) Release/obj.target/rpi-rgb-led-matrix/external/matrix/lib/thread.o
../external/matrix/lib/thread.cc:58:5: error: unknown type name 'cpu_set_t'
    cpu_set_t cpu_mask;
    ^
1 error generated.
make: *** [Release/obj.target/rpi-rgb-led-matrix/external/matrix/lib/thread.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/xxxxxxx/.nodenv/versions/10.15.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 17.2.0
gyp ERR! command "/Users/xxxxxxx/.nodenv/versions/10.15.3/bin/node" "/Users/xxxxxxx/.nodenv/versions/10.15.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/xxxxxxx/workspace/repo/lightmessage/node_modules/easybotics-rpi-rgb-led-matrix
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! easybotics-rpi-rgb-led-matrix@0.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1

I removed all my old node_modules in case there was a clash with my local workaround but, same error. Fingers crossed it's something at my end...

samturner3 commented 5 years ago

I got that too when installing on mac, but when running on Rpi it was fine.

Yes it is annoying not sure what is the solution, but for now I have made a separate branch for mac development that does not have the dependency in it.

keptan commented 5 years ago

cpu_set_t is a core affinity setting thing that is linux only, not on macOS. This project relies on the IO of the rpi so I doubt you'll be able to get it working on any apple hardware.

renebigot commented 5 years ago

Install as optional dependency with ´npm install easybotics-rpi-rgb-led-matrix —save-optional’.

NPM will ignore compilation error. It then should work on a RPi, not on other platform but ´npm install’ won’t be blocked anymore if you do some debuging on a Mac (for example)

keptan commented 5 years ago

this issue only comes about on non linux envs only ill reopen this issue when you prove you're running macos on a rpi.

redandinvisible commented 5 years ago

Sorry, how would i prove that? I just had the default Raspbien OS on the rpi. Is it mandatory for this library for it to be running on macos on the pi - i didnt even know you could do that!

Sorry, this is my first ever project with a rpi - although i am a backend dev for a living so i'm not completely out of my depth :)

keptan commented 5 years ago

Sorry Ill take another look

keptan commented 5 years ago

@redandinvisible it really looks like you tried to build it on macOS or a different non-linux OS

because http://man7.org/linux/man-pages/man3/CPU_SET.3.html cpu_set_t should absolutely be available and everyone else having this problem tried building on mac

is it possible you were sshing into a raspi and accidentally tried to build this from the mac you were sshing from? thats the only way I can see this happening to you, what do you think? it also looks like the path you were in is a macos one otherwise im confused