[rrd-users] Trouble installing rrdtools Ruby bindings on Mac

Sanjit Jhala sjhalaz at gmail.com
Wed Jul 14 23:12:00 CEST 2010


It works after I made the following modifications to extconf.rb:
*
dir_config("rrd","../../src","/opt/local/lib/")
have_library("rrd", "rrd_create", "rrd.h")*

and then ran:
*ARCHFLAGS="-arch x86_64" ruby extconf.rb –with-rrd-dir=/opt/local*

-Sanjit

On Wed, Jun 23, 2010 at 11:31 AM, Sanjit Jhala <sjhalaz at gmail.com> wrote:

> Hi,
>
> I am trying to run the Ruby bindings on a Mac OSX 10.6.3. I installed
> rrdtool 1.3.8 via macports. In addition I downloaded the source for
> rrdtool-1.3.8, edited the dir_config in bindings/ruby/extconf.rb to:
> dir_config("rrd","../../src","/opt/local/lib/"), and ran
> "ruby extconf.db; make; sudo make install". However when I run my ruby code
> I still get:
> *
> => Booting Mongrel
> => Rails 2.3.7 application starting on http://0.0.0.0:3000
> /Library/Ruby/Site/1.8/universal-darwin10.0/RRD.bundle:
> dlopen(/Library/Ruby/Site/1.8/universal-darwin10.0/RRD.bundle, 9): Symbol
> not found: _rrd_create (LoadError)
>   Referenced from: /Library/Ruby/Site/1.8/universal-darwin10.0/RRD.bundle
>   Expected in: flat namespace
>  in /Library/Ruby/Site/1.8/universal-darwin10.0/RRD.bundle -
> /Library/Ruby/Site/1.8/universal-darwin10.0/RRD.bundle
>     from
> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
> `require'
>
> *When I run "ruby extconf.rb" I get:
> checking for rrd_create() in -lrrd... no
>
> which seems like a bad thing.
>
> Heres some more info about my machine and rrdtool/ruby binding install
> procedure.
>
> *OS details:**
> sanjit at Sanjit-Jhalas-MacBook-Pro:~/src/rrdtool/rrdtool-1.3.8/bindings/ruby]$
> uname -a
> Darwin Sanjit-Jhalas-MacBook-Pro.local 10.3.0 Darwin Kernel Version 10.3.0:
> Fri Feb 26 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386
> *
> *librrd exists under /opt/local/lib**:
> sanjit at Sanjit-Jhalas-MacBook-Pro:~/src/rrdtool/rrdtool-1.3.8/bindings/ruby]$
> ls -ltrh /opt/local/lib/librrd*
> -rwxr-xr-x  2 root  admin   1.5K Jun 22 10:38 /opt/local/lib/librrd_th.la
> -rw-r--r--  2 root  admin   291K Jun 22 10:38 /opt/local/lib/librrd_th.a
> -rwxr-xr-x  2 root  admin   207K Jun 22 10:38
> /opt/local/lib/librrd_th.4.dylib
> -rwxr-xr-x  2 root  admin   1.5K Jun 22 10:38 /opt/local/lib/librrd.la
> -rw-r--r--  2 root  admin   293K Jun 22 10:38 /opt/local/lib/librrd.a
> -rwxr-xr-x  2 root  admin   211K Jun 22 10:38 /opt/local/lib/librrd.4.dylib
> lrwxr-xr-x  1 root  admin    17B Jun 22 10:38
> /opt/local/lib/librrd_th.dylib -> librrd_th.4.dylib
> lrwxr-xr-x  1 root  admin    14B Jun 22 10:38 /opt/local/lib/librrd.dylib
> -> librrd.4.dylib
>
> **rrdtool is installed via Macports:**
> sanjit at Sanjit-Jhalas-MacBook-Pro:~/src/rrdtool/rrdtool-1.3.8/bindings/ruby]$
> port list rrdtool
> rrdtool                        @1.3.8          net/rrdtool
>
> **ruby binding install procedure:**
> sanjit at Sanjit-Jhalas-MacBook-Pro:~/src/rrdtool/rrdtool-1.3.8/bindings/ruby]$
> cat extconf.rb
> # $Id: extconf.rb,v 1.2 2001/11/28 18:30:16 miles Exp $
> # Lost ticket pays maximum rate.
>
> require 'mkmf'
>
> if /linux/ =~ RUBY_PLATFORM
>    $LDFLAGS += '-Wl,--rpath -Wl,$(EPREFIX)/lib'
> elsif /solaris/ =~ RUBY_PLATFORM
>    $LDFLAGS += '-R$(EPREFIX)/lib'
> elsif /hpux/ =~ RUBY_PLATFORM
>    $LDFLAGS += '+b$(EPREFIX)/lib'
> elsif /aix/ =~ RUBY_PLATFORM
>    $LDFLAGS += '-Wl,-blibpath:$(EPREFIX)/lib'
> end
>
> dir_config("rrd","../../src","/opt/local/lib/")
> have_library("rrd", "rrd_create")
> create_makefile("RRD")
> sanjit at Sanjit-Jhalas-MacBook-Pro:~/src/rrdtool/rrdtool-1.3.8/bindings/ruby]$
> ruby extconf.rb
> checking for rrd_create() in -lrrd... no
> creating Makefile
> sanjit at Sanjit-Jhalas-MacBook-Pro:~/src/rrdtool/rrdtool-1.3.8/bindings/ruby]$
> make
> gcc -I. -I.
> -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0
> -I. -I../../src  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386
> -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe
> -fno-common   -c main.c
> main.c: In function ‘rb_rrd_infocall’:
> main.c:153: warning: assignment makes pointer from integer without a cast
> main.c: In function ‘rb_rrd_info’:
> main.c:192: warning: passing argument 1 of ‘rb_rrd_infocall’ from
> incompatible pointer type
> main.c: In function ‘rb_rrd_updatev’:
> main.c:199: warning: passing argument 1 of ‘rb_rrd_infocall’ from
> incompatible pointer type
> main.c: In function ‘rb_rrd_graphv’:
> main.c:206: warning: passing argument 1 of ‘rb_rrd_infocall’ from
> incompatible pointer type
> main.c: In function ‘string_arr_new’:
> main.c:48: warning: format ‘%d’ expects type ‘int’, but argument 6 has type
> ‘long int’
> main.c: In function ‘rb_rrd_infocall’:
> main.c:153: warning: assignment makes pointer from integer without a cast
> main.c: In function ‘rb_rrd_info’:
> main.c:192: warning: passing argument 1 of ‘rb_rrd_infocall’ from
> incompatible pointer type
> main.c: In function ‘rb_rrd_updatev’:
> main.c:199: warning: passing argument 1 of ‘rb_rrd_infocall’ from
> incompatible pointer type
> main.c: In function ‘rb_rrd_graphv’:
> main.c:206: warning: passing argument 1 of ‘rb_rrd_infocall’ from
> incompatible pointer type
> cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o
> RRD.bundle main.o -L.
> -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib
> -L/opt/local/lib/ -L. -arch i386 -arch x86_64     -lruby  -lpthread -ldl
> sanjit at Sanjit-Jhalas-MacBook-Pro:~/src/rrdtool/rrdtool-1.3.8/bindings/ruby]$
> sudo make install
> /usr/bin/install -c -m 0755 RRD.bundle
> /Library/Ruby/Site/1.8/universal-darwin10.0
>
>
> *I will try and install rrdtool directly from the source instead of
> macports to see if that makes a difference, but other than that any help
> will be much appreciated.
>
> -Sanjit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20100714/e271d931/attachment.htm 


More information about the rrd-users mailing list