codeboost / opencv-node

Use OpenCV with node.js
54 stars 9 forks source link

Added support for compiling on linux #3

Closed bitbay closed 11 years ago

bitbay commented 11 years ago

On heroku (linux) the build fails with an error: cannot use typeid with -fno-rtti I disabled the 'per-default' option of node-gyp in the binding-gyp file, as commented in this issue. I would love to see this mod in the npm repository, as vendoring the patched version myself gets really cumbersome...

Thank You!

bitbay commented 11 years ago

Although the add-on compiles without any errors (with some warnings) thanks to the patch, but i can't run the example effects.coffee converted to javascript...see below:

module.js:485 process.dlopen(filename, module.exports); ^ phome/node_modules/opencv-node/build/Release/addon.node: undefined symbol: _ZN2cv8fastFreeEPv at Object.Module._extensions..node (module.js:485:11) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:362:17) at require (module.js:378:17) at Object. (/phome/node_modules/opencv-node/scripts/opencv.coffee:4:14) at Object. (/phome/node_modules/opencv-node/scripts/opencv.coffee:18:4) at Module._compile (module.js:449:26) at Object.require.extensions..coffee (/phome/node_modules/coffee-script/lib/coffee-script/coffee-script.js:22:21) at Module.load (module.js:356:32)

Any idea where this symbol should be defined? Is it opencv, python, something else?

bitbay commented 11 years ago

note on the comment above: the error was caused by the binding.gyp not being complete - the commit 5558793 compiled, but did not do proper linking.

Linux build configuration should be now complete with linker and compiler flags getting values from pkg-config. Running tests.coffee results in:


mul PASSED: Exception thrown for 'mul(undefined) PASSED: Exception thrown for 'mul({one: 1}) PASSED: Exception thrown for 'mul(invalid size matrix) PASSED: Multiplied must have same w/h/t ... * Finished * { failed: 0, passed: 56, total: 56 }


Commit (hopefully) ready to pull...