There was an error while loading. Please reload this page.
On Ubuntu 10.10, this is roughly what I did, which I originally posted here (there may be other dependencies I've neglected to include):
sudo apt-get install libatlas-dev libatlas-base-dev # modify extconf.rb: have_header("atlas/cblas.h") ===> have_header("cblas.h") # modify linalg.c #include <atlas/cblas.h> ===> #include <cblas.h>
For ruby 1.9, you also need to change a few array things (typical for moving from 1.8 to 1.9 extension code):
diff -r ../narray-new-1.8/narray.c ./narray.c 211,212c211,212 < n = RARRAY(idxargs)->len; < ptr = RARRAY(idxargs)->ptr; --- > n = RARRAY_LEN(idxargs); > ptr = RARRAY_PTR(idxargs); 232c232,233 < const static size_t zero=0; --- > //const static size_t zero=0; > static const size_t zero=0; 463c464 < ndim = RARRAY(v)->len; --- > ndim = RARRAY_LEN(v); 761a763 > VALUE *ptr; 774,775c776,778 < RARRAY(v)->ptr[i] = SIZE2NUM(na->shape[c]); < RARRAY(v)->len++; --- > RARRAY_PTR(v)[i] = SIZE2NUM(na->shape[c]); > ptr = RARRAY_LEN(v); > ptr++; diff -r ../narray-new-1.8/nstruct.c ./nstruct.c 301c301 < ndim = RARRAY(argv[i])->len; --- > ndim = RARRAY_LEN(argv[i]);
% ruby extconf.rb % make # in your code (or irb): require 'narray' # or: require './narray.so'
now, you should be able to play around with it.