[annonce] ffi-glpk extension demonstrator for jruby

Le 27 janv. 09 à 22:24, Yaron Kretchmer a écrit :

Maurice-
Will that work with Ruby MRI as well?
Thanks
Yaron
I should (or will)!

But ffi is an edge extension and some low level API still evolve.
I try it with JRuby because JRuby include it and it works out of the
box (so if you have JRuby installed it should work)

MRI Ruby still require a gem installation, and is sensible to the Ruby
version or so…
I really think MRI Ruby should include FFI natively!

For now I’v only tried the following (on MRI Ruby) :

ruby -version
=> ruby 1.8.7 (2008-08-11 patchlevel 72) [powerpc-darwin9]
(from macport version on osx)

gem install ffi --remote

type ruby
=>ruby is hashed (/opt/local/bin/ruby) (from macport)

ruby ffi-glpk.rb

=> ffi-glpk.rb:118:in to_array_of_double': undefined methodput_array_of_double’
for # (NoMethodError)
from ./ffi-glpk.rb:103:in glp_load_matrix2' from mini_glpk.rb:61:inglpk_test’
from mini_glpk.rb:74

So there is a problem with MRI (in my environment).
But I’m sure it will be solve automatically whith some
future release of MRI.
(and some FFI developer are probably listening the jruby list :wink:

PS.
Also Yaron, be aware that FFI is not yet able to do
dynamic binding for C++ libraries, only C ones
PS.2
Why not fortran?

solver), C extensions (like glpk) directly in (j)ruby code.
The code provided is the mimimum for writing the glpk doc mini
example in ruby.

Hope this help,
– Maurice Diamantini


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email