bengfarrell / nuimotion

Node.js wrapper for OpenNI/NiTE offering skeletal joint tracking and gestures
http://www.sweatintotheweb.com/nuimotion-for-node-js/
MIT License
74 stars 19 forks source link

Building on MAC OSX fails #16

Closed Schnodderbalken closed 10 years ago

Schnodderbalken commented 10 years ago

Hey guys, I tried to install the whole thing but right before the end, when trying to build it, there seems to be an error:

make: *\ No rule to make target /Redist/OpenNI2/Drivers/libOniFile.dylib', needed by/Users/maRcbook/Developer/Work/prototype-nuimotion/node_modules/nuimotion/build/Release/OpenNI2/Drivers/libOniFile.dylib'. Stop. 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/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 Darwin 13.2.0 gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild" gyp ERR! cwd /Users/maRcbook/Developer/Work/prototype-nuimotion/node_modules/nuimotion gyp ERR! node -v v0.10.24 gyp ERR! node-gyp -v v0.13.1 gyp ERR! not ok

Do you guys know how I could fix that?

Thanks in advance!

bengfarrell commented 10 years ago

Hmmmm, well, the entire path it needs is: "<(OPENNI2)/Redist/OpenNI2/Drivers/libOniFile.dylib", where is the location of the OpenNI download. Did you download and install both OpenNI2 and NITE2 ahead of the NuiMotion install and also create the OPENNI2 and NITE2 paths on your system? I'm thinking you may not have, because of your path - how it would look right if OPENNI2 resolved to an empty string.

Schnodderbalken commented 10 years ago

well, in the .bash_profile it says: export OPENNI2=/Users/maRcbook/Developer/Work/OpenNI-MacOSX-x64-2.2 export NITE2=/Users/maRcbook/Developer/Work/NiTE-MacOSX-x64-2.2

and when I enter $OPENNI2, the response is: "-bash: /Users/maRcbook/Developer/Work/OpenNI-MacOSX-x64-2.2: is a directory"

furthermore, this folder also contains ./Redist/OpenNI2/Drivers/libOniFile.dylib

Any other ideas? :(

Schnodderbalken commented 10 years ago

In fact, you were right! It seems that both of the assignments: "OPENNI2%": "$(OPENNI2)", "NITE2%": "$(NITE2)" at the beginning of binding.gyp somehow fail and return an empty string like you said. But I still wonder why because these system vars exist in the .bash_profile.

bengfarrell commented 10 years ago

Not really! (other than to edit the binding.gyp file yourself).

So I just got out my OSX machine and gave things a fresh install. I tried it first by removing the vars from my bash_profile. I didn't work. Then I put them back in, and it did. I think whatever the problem is, is localized to your setup.

Maybe you're running your node stuff under a different user. Whatever the reason is that these vars don't carry over, you can certainly just git clone the project and then edit the binding.gyp file. Wherever you see (OPENNI2) or (NITE2) just replace with the actual path on your machine. Once done, run node-gyp rebuild in the nuimotion folder, and the project should build

On 06/24/2014 04:27 AM, Schnodderbalken wrote:

well, in the .bash_profile it says: export OPENNI2=/Users/maRcbook/Developer/Work/OpenNI-MacOSX-x64-2.2 export NITE2=/Users/maRcbook/Developer/Work/NiTE-MacOSX-x64-2.2

and when I enter $OPENNI2, the response is: "-bash: /Users/maRcbook/Developer/Work/OpenNI-MacOSX-x64-2.2: is a directory"

furthermore, this folder also contains ./Redist/OpenNI2/Drivers/libOniFile.dylib

Any other ideas? :(

— Reply to this email directly or view it on GitHub https://github.com/bengfarrell/nuimotion/issues/16#issuecomment-46959702.

Schnodderbalken commented 10 years ago

well, I executed the command with sudo. That's because when I tried without, there was this output: gyp info it worked if it ends with ok gyp info using node-gyp@0.13.1 gyp info using node@0.10.24 | darwin | x64 gyp ERR! clean error gyp ERR! stack Error: EACCES, unlink 'build/Makefile' gyp ERR! System Darwin 13.2.0 gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild" gyp ERR! cwd /Users/maRcbook/Developer/Work/prototype-nuimotion/node_modules/nuimotion gyp ERR! node -v v0.10.24 gyp ERR! node-gyp -v v0.13.1 gyp ERR! not ok

Could that be the reason for the system vars not being available?

Schnodderbalken commented 10 years ago

When I manually replace <(OPENNI2) and <(NiTE2) by the actual directories I have set in the .bash_profile the process continues further, however also stops at a point:

gyp info it worked if it ends with ok gyp info using node-gyp@0.13.1 gyp info using node@0.10.24 | darwin | x64 gyp info spawn python gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/Users/maRcbook/Developer/Work/prototype-nuimotion/node_modules/nuimotion/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/local/lib/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/maRcbook/.node-gyp/0.10.24/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/Users/maRcbook/.node-gyp/0.10.24', gyp info spawn args '-Dmodule_root_dir=/Users/maRcbook/Developer/Work/prototype-nuimotion/node_modules/nuimotion', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' ] gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] COPY /Users/maRcbook/Developer/Work/prototype-nuimotion/node_modules/nuimotion/build/Release/OpenNI2/Drivers/libOniFile.dylib COPY /Users/maRcbook/Developer/Work/prototype-nuimotion/node_modules/nuimotion/build/Release/OpenNI2/Drivers/libPS1080.dylib COPY /Users/maRcbook/Developer/Work/prototype-nuimotion/node_modules/nuimotion/build/Release/OpenNI2/Drivers/PS1080.ini COPY /Users/maRcbook/Developer/Work/prototype-nuimotion/node_modules/nuimotion/build/Release/OpenNI2/Drivers/PSLink.ini make: *\ No rule to make target /Users/maRcbook/Developer/Work/OpenNI-MacOSX-x64-2.2/Redist/NiTE2/Data/lbsdata.idx', needed by/Users/maRcbook/Developer/Work/prototype-nuimotion/NiTE2/Data/lbsdata.idx'. Stop. 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/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 Darwin 13.2.0 gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild" gyp ERR! cwd /Users/maRcbook/Developer/Work/prototype-nuimotion/node_modules/nuimotion gyp ERR! node -v v0.10.24 gyp ERR! node-gyp -v v0.13.1 gyp ERR! not ok

bengfarrell commented 10 years ago

Check out this line, you may have a typo: /Users/maRcbook/Developer/Work/OpenNI-MacOSX-x64-2.2/Redist/NiTE2/Data/lbsdata.idx',

This indicates to me that you are looking for the NITE2 redistributable files in the OpenNI2 folder. When you edited, as per my suggested hack, you may have put your OPENNI2 path where the NITE2 path should be

bengfarrell commented 10 years ago

Yup, your sudo comment might be a good indication things are running in different user contexts. When I've tested this add-on I've never really tried running it as root anywhere. So, your personal bash_profile may not be the best place to put your vars if you're running as root/sudo.

Schnodderbalken commented 10 years ago

Yeaaaah! It works now!

What I did is installing everything again (for the 5th time or so) but this time not using sudo (I think this only concerns this line: sudo npm install -g node-gyp)

I also didn't put the DYLD_LIBRARY_PATH entry in the .bash_profile. I hope this helps other users in the future. Thanks a LOT for your effort! :+1: :)