Closed KevinGrandon closed 11 years ago
Sure, hope I can help! So you're the same one that just reported that you couldn't build on OSX right?
Basically - the part that's confusing on this is linking the libraries that come with OpenNI/NiTE. It seems to be different on various platforms.
On Ubuntu, as you're talking about - I believe things should work as is. I'm not sure if you had changed the binding.gyp file when I was explaining how things are different on Windows/Mac.
To walk you through the binding.gyp file:
{ "conditions": [ [ "OS=='win'", { "variables": {
"ONI_Root%": "../"
}
}, { # 'OS!="win"'
"variables": {
# Set the linker location, the -l flag is fine on Linux with no filepath
# However, we need the additional option -rpath for dynamic linking
"ONI_Root%": "",
}
}
]
],
That first condition applies to Windows as I've found. Though I don't have a Mac, I believe that this first condition applies on OSX as well. The condition creates an "ONI_ROOT" variable (I've named it) to relatively link to the root where your OpenNI libraries are stored.
For some reason, on Windows vs Linux, this is actually important. And in my experience it's been a little finicky where it links from.
I say "for some reason", because on Linux, it appears to not actually care. It just needs to create the dynamic linkage regardless of whether the files (.so library files) exist or not at build time. Therefore, I've created that other condition for non-Windows environments where ONI_ROOT is an empty string. This appears to make it not need to actively look for the library when building the add on - and doesn't raise any complaints.
Unfortunately, only Windows and Linux are accounted for here - Mac...again, I just can't test.
Your problem specifically - if you haven't changed the binding file, I'm not sure. However - as you DID ask about OSX previously, you may have tried changing that binding.gyp file when I was answering your question about OSX. If I do this, and set ONI_Root to that relative path: "../" on Linux, my build process does exactly as yours does. It fails to find the linked files in exactly the same path, and errors out the build process in the exact same way.
So - this could be easy to solve. Perhaps you just need to restore your binding.gyp file? Perhaps you had copied it over from your Mac after altering it?
Hope that helps! I may have to consider that I've installed OpenNI somewhere and set up an environmental variable on my system that makes it OK when I build on my system, but I don't think that's the case - I can't find anything!
Thanks for the extremely detailed explanation. I am trying from a clean ubuntu install, and an unmodified binding.gyp file. Still no dice. I'm going to close this out as I don't want to pollute your issues :)
I'll dig in and try to find something more concrete - I really want to use your library.
Thanks!
No problem - I really spent a good deal of time on this kind of issue specifically with linked libraries, so I'm not psyched to hear that there might be other issues.
I appreciate you keeping at it - please do let me know if you find out the cause, I'd really love to document it for other folks.
thanks!
Hi bengfarrell, I'm now trying to build on Ubuntu (12.04, 64-bit), and running into a few issues. Wondering if you could help me debug this.
Dir structure:
Errors seen:
Let me know if there's anything else I can provide. Unfortunately I'm not too familiar with building node addons, but I'll try to dig into the source a bit!