Orion98MC / node_rrd

A node.js native binding for RRDtool (node rrd)
97 stars 25 forks source link

node-gyp cannot find the rrd.h #1

Closed sauletasmiestas closed 11 years ago

sauletasmiestas commented 11 years ago

Here is what I get:

/node_modules/node_rrd$ sudo node-gyp rebuild gyp info it worked if it ends with ok gyp info using node-gyp@0.9.1 gyp info using node@0.8.7 | linux | ia32 gyp info spawn python gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp', 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 '/home/justas/node_modules/node_rrd/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 '/home/justas/.node-gyp/0.8.7/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/home/justas/.node-gyp/0.8.7', gyp info spawn args '-Dmodule_root_dir=/home/justas/node_modules/node_rrd', gyp info spawn args '--depth=.', 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' ] make: Entering directory /node_modules/node_rrd/build' CXX(target) Release/obj.target/rrd_bindings/src/node_rrd_create.o In file included from ../src/node_rrd_create.cc:27:0: ../src/node_rrd.h:32:17: fatal error: rrd.h: No such file or directory compilation terminated. make: *** [Release/obj.target/rrd_bindings/src/node_rrd_create.o] Error 1 make: Leaving directory/node_modules/node_rrd/build' 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:256:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:91:17) gyp ERR! stack at Process._handle.onexit (child_process.js:674:10) gyp ERR! System Linux 3.2.0-38-generic-pae gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild" gyp ERR! cwd /node_modules/node_rrd gyp ERR! node -v v0.8.7 gyp ERR! node-gyp -v v0.9.1 gyp ERR! not ok

Orion98MC commented 11 years ago

Thanks for reporting this!

What is the path of your rrd library header file (rrd.h) on your system?

sauletasmiestas commented 11 years ago

I have installed rrd manually: /home/justas/rrdtool-1.4.7/src/rrd.h

Or automatically it will be /opt/rrdtool-1.4.7/include/rrd.h

Orion98MC commented 11 years ago

Sounds like a gunziped archive path to me. Please provide the output of these commands: $ which rrdtool $ rrdtool --version $ echo $LD_LIBRARY_PATH

sauletasmiestas commented 11 years ago

I think I gave you wrong directory, Should be this one: /opt/rrdtool-1.4.7/include/rrd.h

Output:

$ which rrdtool /usr/bin/rrdtool

$ rrdtool -v RRDtool 1.4.7 Copyright 1997-2012 by Tobias Oetiker tobi@oetiker.ch Compiled Mar 29 2012 18:15:48

Usage: rrdtool [options] command command_options Valid commands: create, update, updatev, graph, graphv, dump, restore, last, lastupdate, first, info, fetch, tune, resize, xport, flushcached

RRDtool is distributed under the Terms of the GNU General Public License Version 2. (www.gnu.org/copyleft/gpl.html)

For more information read the RRD manpages

$ echo $LD_LIBRARY_PATH

$

Orion98MC commented 11 years ago

Ok so now give me the output of:

$ ldd /usr/bin/rrdtool | grep rrd

sauletasmiestas commented 11 years ago

$ ldd /usr/bin/rrdtool | grep rrd librrd.so.4 => /usr/lib/librrd.so.4 (0xb7774000)

Orion98MC commented 11 years ago

So, your rrd header should be located in /usr/include/rrd.h Do you confirm ?

sauletasmiestas commented 11 years ago

No... it does not have this file

Orion98MC commented 11 years ago

Ok so that explains why node-gyp fails to locate it! What is your system please? $ uname -a

sauletasmiestas commented 11 years ago

$ uname -a Linux user-Studio-1555 3.2.0-38-generic-pae #61-Ubuntu SMP Tue Feb 19 12:39:51 UTC 2013 i686 i686 i386 GNU/Linux

Orion98MC commented 11 years ago

Right, so:

$ aptitude install librrd-dev

Or something similar... After that retry to build the module from the node_rrd directory by running the 'node-gyp rebuild' command.

sauletasmiestas commented 11 years ago

Yeah it works... I had installed perl rrd module, that is why it has not worked...

Thank you for help, I am really sorry for the time I took...