Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
rrdtool gem
Haley Thrapp
11/13/2007 4:30:00 PM
I am trying to use RRDtool through ruby. I have installed rrdtool and
it appears to be working(I can run the sample scripts). I downloaded
the RubyRRDtool gem and tried to install it. The install appears to
work without errors. I then tried running the example scripts for the
rrdtool gem and just requiring the gem in irb. I get the same error for
both, shown below (1). I then tried building the gem using the
instructions in the README. I did a 'ruby extconf.rb', 'make', and
'make install'. Make produces the warnings below (2), but no errors.
The install also seems to succeed, but I get the same issue as the
straight gem install. From my investigation so far, it appears that
there are a number of rrd commands that are not defined in RRDtool.so.
Is it possible the gem build is not linking against rrd correctly, and
if so, how might I fix this? I have attached the Makefile that is
produced from the extconf.rb.
(1)
irb(main):001:0> require "RRDtool"
LoadError:
/usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/test/RRDtool.so: undefined
symbol: rrd_resize -
/usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/test/RRDtool.so
from
/usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/test/RRDtool.so
from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
from (irb):1
(2)
i386-redhat-linux-gcc -I. -I. -I/usr/lib/ruby/1.8/i386-linux -I. -fPIC
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386
-mtune=generic -fasynchronous-unwind-tables -Wall -fPIC -c
rubyrrdtool.c
rubyrrdtool.c: In function \u2018rrdtool_create\u2019:
rubyrrdtool.c:317: warning: passing argument 5 of
\u2018rrd_create_r\u2019 from incompatible pointer type
rubyrrdtool.c: In function \u2018rrdtool_update\u2019:
rubyrrdtool.c:590: warning: passing argument 4 of
\u2018rrd_update_r\u2019 from incompatible pointer type
i386-redhat-linux-gcc -shared -L"/usr/lib" -o RRDtool.so rubyrrdtool.o
-lruby -lart_lgpl_2 -lfreetype -lpng -lz -lpthread -ldl -lcrypt -lm
-lc
Attachments:
http://www.ruby-...
attachment/96...
--
Posted via
http://www.ruby-...
.
3 Answers
Joel VanderWerf
11/13/2007 6:29:00 PM
0
Haley Thrapp wrote:
> I am trying to use RRDtool through ruby. I have installed rrdtool and
> it appears to be working(I can run the sample scripts). I downloaded
> the RubyRRDtool gem and tried to install it. The install appears to
> work without errors. I then tried running the example scripts for the
> rrdtool gem and just requiring the gem in irb. I get the same error for
> both, shown below (1). I then tried building the gem using the
> instructions in the README. I did a 'ruby extconf.rb', 'make', and
> 'make install'. Make produces the warnings below (2), but no errors.
> The install also seems to succeed, but I get the same issue as the
> straight gem install. From my investigation so far, it appears that
> there are a number of rrd commands that are not defined in RRDtool.so.
> Is it possible the gem build is not linking against rrd correctly, and
> if so, how might I fix this? I have attached the Makefile that is
> produced from the extconf.rb.
>
>
>
>
> (1)
> irb(main):001:0> require "RRDtool"
> LoadError:
> /usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/test/RRDtool.so: undefined
> symbol: rrd_resize -
> /usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/test/RRDtool.so
> from
> /usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/test/RRDtool.so
> from
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
> from (irb):1
>
>
>
> (2)
> i386-redhat-linux-gcc -I. -I. -I/usr/lib/ruby/1.8/i386-linux -I. -fPIC
> -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386
> -mtune=generic -fasynchronous-unwind-tables -Wall -fPIC -c
> rubyrrdtool.c
> rubyrrdtool.c: In function \u2018rrdtool_create\u2019:
> rubyrrdtool.c:317: warning: passing argument 5 of
> \u2018rrd_create_r\u2019 from incompatible pointer type
> rubyrrdtool.c: In function \u2018rrdtool_update\u2019:
> rubyrrdtool.c:590: warning: passing argument 4 of
> \u2018rrd_update_r\u2019 from incompatible pointer type
> i386-redhat-linux-gcc -shared -L"/usr/lib" -o RRDtool.so rubyrrdtool.o
> -lruby -lart_lgpl_2 -lfreetype -lpng -lz -lpthread -ldl -lcrypt -lm
> -lc
>
> Attachments:
>
http://www.ruby-forum.com/attachment/96...
>
The "-lrrd" seems to be missing from your Makefile (and hence from the
link step above).
Mine looks like this:
LIBS = -lrrd -lart_lgpl_2 -lfreetype -lpng -lz -lpthread -ldl -lcrypt
-lm -lc
Can you show your mkmf.log?
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
Haley Thrapp
11/13/2007 7:03:00 PM
0
Joel VanderWerf wrote:
> Haley Thrapp wrote:
>> there are a number of rrd commands that are not defined in RRDtool.so.
>> /usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/test/RRDtool.so: undefined
>> (2)
>> \u2018rrd_update_r\u2019 from incompatible pointer type
>> i386-redhat-linux-gcc -shared -L"/usr/lib" -o RRDtool.so rubyrrdtool.o
>> -lruby -lart_lgpl_2 -lfreetype -lpng -lz -lpthread -ldl -lcrypt -lm
>> -lc
>>
>> Attachments:
>>
http://www.ruby-...
attachment/96...
>>
>
> The "-lrrd" seems to be missing from your Makefile (and hence from the
> link step above).
>
> Mine looks like this:
>
> LIBS = -lrrd -lart_lgpl_2 -lfreetype -lpng -lz -lpthread -ldl -lcrypt
> -lm -lc
>
> Can you show your mkmf.log?
Thanks, it was the -lrrd that was missing. I had to move the .so files
so that they could be found correctly, but it appears to be working now.
Haley
--
Posted via
http://www.ruby-...
.
M. Edward (Ed) Borasky
11/14/2007 3:16:00 AM
0
Haley Thrapp wrote:
> I am trying to use RRDtool through ruby. I have installed rrdtool and
> it appears to be working(I can run the sample scripts). I downloaded
> the RubyRRDtool gem and tried to install it. The install appears to
> work without errors. I then tried running the example scripts for the
> rrdtool gem and just requiring the gem in irb. I get the same error for
> both, shown below (1). I then tried building the gem using the
> instructions in the README. I did a 'ruby extconf.rb', 'make', and
> 'make install'. Make produces the warnings below (2), but no errors.
> The install also seems to succeed, but I get the same issue as the
> straight gem install. From my investigation so far, it appears that
> there are a number of rrd commands that are not defined in RRDtool.so.
> Is it possible the gem build is not linking against rrd correctly, and
> if so, how might I fix this? I have attached the Makefile that is
> produced from the extconf.rb.
>
>
>
>
> (1)
> irb(main):001:0> require "RRDtool"
> LoadError:
> /usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/test/RRDtool.so: undefined
> symbol: rrd_resize -
> /usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/test/RRDtool.so
> from
> /usr/lib/ruby/gems/1.8/gems/RubyRRDtool-0.6.0/test/RRDtool.so
> from
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
> from (irb):1
>
>
>
> (2)
> i386-redhat-linux-gcc -I. -I. -I/usr/lib/ruby/1.8/i386-linux -I. -fPIC
> -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386
> -mtune=generic -fasynchronous-unwind-tables -Wall -fPIC -c
> rubyrrdtool.c
> rubyrrdtool.c: In function \u2018rrdtool_create\u2019:
> rubyrrdtool.c:317: warning: passing argument 5 of
> \u2018rrd_create_r\u2019 from incompatible pointer type
> rubyrrdtool.c: In function \u2018rrdtool_update\u2019:
> rubyrrdtool.c:590: warning: passing argument 4 of
> \u2018rrd_update_r\u2019 from incompatible pointer type
> i386-redhat-linux-gcc -shared -L"/usr/lib" -o RRDtool.so rubyrrdtool.o
> -lruby -lart_lgpl_2 -lfreetype -lpng -lz -lpthread -ldl -lcrypt -lm
> -lc
>
> Attachments:
>
http://www.ruby-forum.com/attachment/96...
>
I think the most recent version of RRDTool source comes bundled with a
working Ruby binding, which you need to enable when you configure
RRDTool. I ran into some conflicts between RRDTool and the Ruby binding
package in Gentoo, and they went away when I compiled RRDTool with the
Ruby bindings bundled with it.
See
http://bugs.gentoo.org/show_bug.cgi...
and
http://bugs.gentoo.org/show_bug.cg...
If you're not building RRDTool from source, you'll probably need to go
hassle your distro's bug tracker (unless you're using Gentoo, in which
case it just works.)
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
rrdtool gem
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password