Java Classes from Ruby w/ C libs

Hi,

Im new to Ruby and JRuby, but had a question:

I am currently trying to generate Java classes from RFuzz’s random.rb.
The
problem ( i believe) is that it random.rb uses a method contained in a c
library. I can generate the class successfully, but it throws errors
when I
try to use it. Here are some snippets:

There are the requires as in the .rb file.

Implements the randomness engine for RFuzz

This is the error I get when I try to use the generated Java class
(FuzzEngine is the class I am calling the generated class from):

at engine.FuzzEngine.main(FuzzEngine.java:7)

All that is included within the source of random.rb is a fuzzrnd.c, and
fuzzrnd.so file. There is also a ruby file called ext_help.rb.

I have tried renaming, and moving the .c, and .so class into my eclipse
project, etc. nothing.

any help? I imagine its an issue with trying to integrate the c library
(which contains a function that random.rb calls).

thanks!

AFAIK, JRuby doesn’t support native library © extensions, so you won’t
be able to use it right now. Some work is being done in this direction,
but hasn’t (?) been released yet.

On Wed, 2010-07-21 at 16:03 -0600, Skyler Onken wrote:

              class RandomGenerator
            at (unknown).new(random.rb:3)

any help? I imagine its an issue with trying to integrate the c
library (which contains a function that random.rb calls).

thanks!


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

The C extension support work is being done in the cext branch at
jruby.org. I’ll add the gem to my list and see if I can get it to run.
-Tim

On Jul 22, 2010, at 11:39 AM, Nick G. wrote:

Im new to Ruby and JRuby, but had a question:

This is the error I get when I try to use the generated Java class


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Cool. Can this be made available to me? or perhaps the instructions to
fix
the issue? thanks!

This is all experimental stuff and right it’s only available if you
install from the branch yourself.
Sorry, but this will take some time to get into JRuby proper.

-Tim

On Jul 22, 2010, at 4:37 PM, Skyler Onken wrote:

On Jul 22, 2010, at 11:39 AM, Nick G. wrote:

library (which contains a function that random.rb calls).


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

After a tiny bit of tinkering, the RFuzz gem compiles and the specs pass
on JRuby cext.

On Jul 22, 2010, at 12:26 PM, Tim F. wrote:

errors when I try to use it. Here are some snippets:

          such file to load -- fuzzrnd

eclipse project, etc. nothing.


http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Where is the branch located?
Sent from my BlackBerry® wireless handheld

Nick G. wrote:

AFAIK, JRuby doesn’t support native library © extensions, so you won’t
be able to use it right now. Some work is being done in this direction,
but hasn’t (?) been released yet.

you could try ffi

If you clone the jruby.org git repository, you’ll find a cext branch.
-Tim

On Jul 26, 2010, at 3:00 PM, [email protected] wrote:

Sorry, but this will take some time to get into JRuby proper.

On Jul 22, 2010, at 12:26 PM, Tim F. wrote:

in a c library. I can generate the class successfully, but it throws
require ‘java’
Caused by: org.jruby.exceptions.RaiseException: no
I have tried renaming, and moving the .c, and .so class into my


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs