Le 27 janv. 09 à 22:24, Yaron Kretchmer a écrit :
Will that work with Ruby MRI as well?
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 1.8.7 (2008-08-11 patchlevel 72) [powerpc-darwin9]
(from macport version on osx)
gem install ffi --remote
=>ruby is hashed (/opt/local/bin/ruby) (from macport)
to_array_of_double': undefined methodput_array_of_double’
for # (NoMethodError)
glp_load_matrix2' from mini_glpk.rb:61:inglpk_test’
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
Also Yaron, be aware that FFI is not yet able to do
dynamic binding for C++ libraries, only C ones
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: