Statically linking ruby extensions - build problem

Hi all,

Ruby 1.8.0
BeOS 5.03 Pro
gcc 2.95.3 20010315 (release)

built with --prefix=/boot/home/config --enable-shared

First, the good news. 1.8.0 compiles on BeOS 5 and I
can even ‘require’ standard libraries like “socket”.
Hooray!

However, I can’t seem to get my own extensions to
load. I’ll take my own module, sys-uname, for
example. Seems to build fine - no errors or warnings.
Yet, when I try to ‘require’ it, I get a LoadError.
I get the same error when I built ruby with the
–with-static-linked-ext option.

My next option was to try and statically link my
extension into the ruby interpreter itself. For this
I turned to p.187 of the pickaxe, which says I should
add an entry to the Setup file under /ext. So, I
created a “uname” directory under ext with the
sys-uname contents, added an entry “uname” to the
Setup and rebuilt.

Unfortunately, it doesn’t seem to work. It never even
attempts to build uname. I tried uncommenting “option
nodynamic”, in addition to leaving it out of the Setup
file altogether. Nothing I tried seemed to work - it
just won’t see it during the build.

What am I doing wrong? Is this a BeOS specific issue
or have the directions changed for 1.8.0? Please
help.

Regards,

Dan

···

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

BeOS 5.03 Pro

Cool. Great to see another OS supported. I’ve heard good things of BeOS.
I hope it grows.

However, I can’t seem to get my own extensions to
load. I’ll take my own module, sys-uname, for
example. Seems to build fine - no errors or warnings.
Yet, when I try to ‘require’ it, I get a LoadError.

HHmmm… Try:

ruby -e ‘puts $LOAD_PATH’

And see if it’s looking for it in the right place.

My next option was to try and statically link my
extension into the ruby interpreter itself. For this
I turned to p.187 of the pickaxe, which says I should
add an entry to the Setup file under /ext. So, I
created a “uname” directory under ext with the
sys-uname contents, added an entry “uname” to the
Setup and rebuilt.

Unfortunately, it doesn’t seem to work. It never even
attempts to build uname.

HHmmm… I don’t know.
Did you ./configure again after you made the changes?
Does the new directory contain extconf.rb?

Is this a BeOS specific issue or have the directions changed for 1.8.0?

I doubt either.

Cheers,
Daniel Carrera
Graduate Teaching Assistant. Math Dept.
University of Maryland. (301) 405-5137

Did you try building the Test.c example? What happens?

This is on my machine:

$ ls
Test.c extconf.rb
$ cat extconf.rb
require 'mkmf’
create_makefile(“Test”)
$ ruby extconf.rb
creating Makefile
$
$ ls
Makefile Test.c Test.o Test.so* extconf.rb mkmf.log
$ ruby -e ‘require “Test”’
$

What is the output on your system?

Daniel Carrera
Graduate Teaching Assistant. Math Dept.
University of Maryland. (301) 405-5137

Hi,

···

At Sun, 12 Jan 2003 03:05:39 +0900, Daniel Berger wrote:

My next option was to try and statically link my
extension into the ruby interpreter itself. For this
I turned to p.187 of the pickaxe, which says I should
add an entry to the Setup file under /ext. So, I
created a “uname” directory under ext with the
sys-uname contents, added an entry “uname” to the
Setup and rebuilt.

Did you make MANIFEST file?


Nobu Nakada